|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 T C7 R; \$ E! |0 c
1 ?. Q- H2 k, u% U3 g) U
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。- d9 V7 B' Y. c$ R9 @- i( e7 b
3 u B4 L, Q hbegin P_read arriving- C/ \% _# R% B# P
while 1=1 do begin
. o1 C `4 V; ]) w5 \ read A_tote from "data.txt" with delimiter "\n"+ h, n0 n6 Z2 Q3 C& W& u! S
read A_time from "data.txt" with delimiter "\n"
; g% q1 A$ n# I$ V/ x3 w read A_leave from "data.txt" with delimiter "\n"+ C* m/ W7 ?, g, z
read A_picks from "data.txt" with delimiter "\n"
% \: N/ B V" x; m( a ?. K& l set load type to A_tote
$ [4 a4 N A2 a) O# v: @ if A_tote="tote 1" then set A_induct to 1
1 s9 l! K: O+ t$ Z. C else if A_tote="tote 2" then set A_induct to 2
3 v0 v0 f7 s) V) K$ q* r$ x else set A_induct to 3 ) I+ g- M% W1 d+ }0 I, V
set A_i to 0& }# R" i5 ?' m; U- ?4 b
clone 1 load to P_induction& a7 l: y# E+ G! G) f
wait for A_time sec
! u5 a0 R1 z: O# S5 S end
- M. N2 i5 a- a" yend
. u7 ?& Z* G; {- L5 `
^0 m& h: C) w4 F$ _2 i* l `3 Ybegin P_induction arriving0 D) e9 j! l' o7 A) o. f
if A_induct=1 then clone 1 load to P_pick1
' F7 H% P: p/ i. |5 H else if A_induct=2 then clone 1 load to P_pick2
) P7 p3 j0 Z- T- R. n6 O$ e else clone 1 load to P_pick3
' Z9 _% p/ {, V4 ^! r* P4 cend& Q/ ~ ]% C t- K
3 c* A9 ^. {) _, C5 x9 abegin P_pick1 arriving
% ]% o5 R D6 y set A_i to 10 S! z) _3 ?# v# E, n b" o
move into Q_induct1
) S, i; x w, Z0 x. n8 n move into pickaisle.induct1
1 \" _% j$ \4 U8 W while A_i<=30 do begin
( R2 J) k2 P U. i travel to pickaisle.con(A_i), g" N. ~5 z2 A5 C2 O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# t4 }6 e I6 \5 R' s
else wait for 10 sec
8 K$ U8 o2 J* M- R8 s# G Q if A_i=A_leave then send to die* j4 B( ]$ e; u8 R
else inc A_i by 11 j8 F# L/ T% g% ^
end7 m1 C$ l- T. f; k$ F8 @
end O& E9 y* {* I4 K5 H7 B/ A* e$ E7 ~6 L
9 v# z& q- v; c* s
begin P_pick2 arriving% K& }3 e' D* R* b+ E1 T
set A_i to 113 h! u8 {: o5 }' g$ p
move into Q_induct2
& y5 ?' d! y: x s+ ^2 O/ o% d2 N0 h move into pickaisle.induct2% p2 w. a. b' Y- ^$ M, d, h' `
while A_i<=30 do begin: _' A8 D5 o8 I, a; [
travel to pickaisle.con(A_i)% i+ E0 H5 L* a. \6 c+ x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- P9 f- q2 C7 o! t/ L3 \$ X1 Y- M else wait for 10 sec1 y& V# k" @: o6 _# J1 R4 Y8 I
if A_i=A_leave then send to die$ j7 l- E5 x/ b0 |5 U! V# {0 J
else inc A_i by 1 ?3 l- X. J2 C# m! W# ~
end
& F: x4 `7 w2 U- A9 Rend% O5 [) E R0 L3 K: D% x
: m& p" r) v; ^* Y
begin P_pick3 arriving: w6 v8 p2 Y, T/ i$ z
set A_i to 21' [8 P& ?# s4 j' t' j
move into Q_induct3
0 x3 r* j8 c1 j move into pickaisle.induct3
$ {! N7 a2 x& J7 \* ?4 | while A_i<=30 do begin
0 ~' c* }7 q5 g) E6 @. P' k travel to pickaisle.con(A_i)
' F" c; a. M& B if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ F2 U: _+ D$ ?5 f
else wait for 10 sec& V1 {' w M3 l) V8 Y6 ]
if A_i=A_leave then send to die# o& h1 ?/ L2 O* m/ Y
else inc A_i by 16 }1 f8 r& ]3 u
end9 b' F3 d. O+ r( |, |7 \) K
end |
最佳答案
查看完整内容
pickaisle.induct1/2/3是个什么东东?
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
|