|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ I0 Q7 z) G4 g6 f/ l0 A
! r! E. U: P/ P' o9 I+ Z我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 J4 m: F# N) `% n$ [( a; _
; ?( R: w/ b3 x i* ]begin P_read arriving
* A# W: T3 E' M! O# q% y( t/ i while 1=1 do begin. h% P% k( t u# t) n; a
read A_tote from "data.txt" with delimiter "\n"2 X' x' n0 B+ s& _$ w3 Z) |
read A_time from "data.txt" with delimiter "\n"
# J ]2 l' X$ d$ x8 X. `# q read A_leave from "data.txt" with delimiter "\n"6 J. V: B8 g1 ~; s; ^
read A_picks from "data.txt" with delimiter "\n"" C6 o6 L* o4 p- x
set load type to A_tote
9 i' _1 p: y9 w/ o X. i if A_tote="tote 1" then set A_induct to 1
* w1 y& i( t0 j2 w6 k( U" I else if A_tote="tote 2" then set A_induct to 28 r9 D( }7 [+ U& n4 l
else set A_induct to 3 ' }- S$ x$ u0 T. z
set A_i to 02 \2 J2 k! G. g' i2 C
clone 1 load to P_induction
. |9 `( G4 R8 ?! | wait for A_time sec
1 U( |2 B' u3 l0 Z" W$ W8 r end, i* I% {; J3 z2 T
end
) W! P6 v9 w& F3 S& @" U$ U! a i3 C( D+ |7 b% ~* B
begin P_induction arriving
; t2 N8 V' D/ U if A_induct=1 then clone 1 load to P_pick1
/ o/ q3 A0 o9 F else if A_induct=2 then clone 1 load to P_pick2% X- f- m& ` g* X
else clone 1 load to P_pick38 p2 i. t- |# W6 _3 T* g- ~# \5 P
end% O& W" x- j7 a6 g
# c' l& D9 _ t ^* [; D% i
begin P_pick1 arriving
" d0 r1 `/ A1 M1 d3 E. y set A_i to 1
0 g6 K, d |$ d; m( H move into Q_induct1+ W0 o9 q6 h4 u) P* a
move into pickaisle.induct1
$ E2 j) ~: M/ p( O* a( d2 a9 L while A_i<=30 do begin, L1 J2 k3 z3 b& M0 u; C# U
travel to pickaisle.con(A_i)" ~ ^9 e, b4 B+ m2 \+ E. S+ ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" e @2 L0 C! ~* F
else wait for 10 sec
( v5 K. [; X, C% m, h; t( i if A_i=A_leave then send to die
( f8 @3 T2 Q1 }7 G2 u0 Z) _ else inc A_i by 18 L; P( |1 I' E1 L- d8 r
end
& p$ s* c6 F7 Send6 f) j, N/ S4 L5 ~: J
- c# Q; e. B4 C$ Z9 Q* I
begin P_pick2 arriving
; Y* |! e0 P$ H2 H# D3 @* b% r set A_i to 11
5 ?& T4 g1 O& Q4 F1 f; s move into Q_induct2. {& R6 c2 q4 z1 _7 I
move into pickaisle.induct2
. G& T/ ?/ V5 O4 r9 b7 G while A_i<=30 do begin
; n d) h! y& { N/ c( k: E/ O travel to pickaisle.con(A_i)" [- A, j/ Z. x; }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 t% T# \: Z/ r6 `- e# |3 K
else wait for 10 sec! L+ I" X. A" W; a& a
if A_i=A_leave then send to die
4 @" t/ p0 V4 `2 J# _, V0 R; ]/ ^ else inc A_i by 10 ^3 _7 S& u* P% H4 w1 w
end
) l+ y# v4 ^7 Yend7 h0 L- A& x' o5 ` o* F) g. {) e- v
5 r, J' j D Z# K; c8 e f
begin P_pick3 arriving
E- R7 i; K! B1 [2 e& a set A_i to 21
7 E! c& r6 y8 r+ J2 _ move into Q_induct3
: `; ^1 z, f; m" F) l, c; Z move into pickaisle.induct3$ ~ \1 A1 r( w- D4 t
while A_i<=30 do begin
9 } K2 M' }! X' B a& U+ c travel to pickaisle.con(A_i); l' y. w ~8 n- l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 i7 q) N! a. l6 f- T
else wait for 10 sec
# L5 A, u$ T9 m if A_i=A_leave then send to die
+ o6 L+ `7 f1 t' o( X' j else inc A_i by 1+ h9 E. r' Z. a
end
: c: Q. s1 A3 T4 e' aend |
最佳答案
查看完整内容
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,其它按你的 ...
|