|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* i3 y" k9 b# C2 b7 }$ J2 S
! D% q9 X5 |! z# Q7 K
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
- Y- B7 } v# Y% ~' p# u# u6 `; T8 I- x8 z5 t
begin P_read arriving# d+ j7 a8 \$ d8 l
while 1=1 do begin3 i* g) }7 R2 g& W
read A_tote from "data.txt" with delimiter "\n"
5 t9 N A3 p+ [/ f. x$ [ read A_time from "data.txt" with delimiter "\n"4 G# n! [4 g7 Y4 T& \$ P
read A_leave from "data.txt" with delimiter "\n"/ _! w- J A7 B- D
read A_picks from "data.txt" with delimiter "\n"
# F0 y5 C$ R+ G set load type to A_tote+ |8 i) s4 `7 ~8 {" U: F
if A_tote="tote 1" then set A_induct to 1
3 u% ]5 j. {4 ~5 g9 q+ O! I, ^ else if A_tote="tote 2" then set A_induct to 2% ^% d+ d4 k( z& C0 Y
else set A_induct to 3 # e1 e K; N- P" V8 H& D9 ?' G( ^ X
set A_i to 0
/ D# `, R, V5 S- U clone 1 load to P_induction4 g1 ~& m4 A4 _5 w2 C
wait for A_time sec
3 C Z$ `8 W# |2 _: z2 u end
4 Y J: D. _6 J9 p& O* E1 `# Qend
, g. S- V' y2 a6 ^0 X, y; k% h) j8 _
begin P_induction arriving1 d1 L3 E6 p' ~; H! W+ i3 J7 c* M
if A_induct=1 then clone 1 load to P_pick1% b7 w6 Q5 W. Y4 o! o" U
else if A_induct=2 then clone 1 load to P_pick2
8 Z! b9 q* ?) Z5 M1 w9 S else clone 1 load to P_pick39 M. e5 s; z: ^. y; \3 T
end
2 F* Q, s( I, g. f2 B4 P6 Z4 I
, o j" W0 V; [6 ~9 @ Gbegin P_pick1 arriving8 e7 m% _$ h4 n' U3 X) l* X8 z/ f
set A_i to 1
/ u6 V4 n% ~' n* p* E9 F move into Q_induct1
$ }( c; T: o. {. Q6 k, @8 e move into pickaisle.induct13 i, X* I$ r0 }1 D/ {6 ^9 O
while A_i<=30 do begin( _, I- {, d+ u" K
travel to pickaisle.con(A_i)" B9 S, g& I0 m6 Y& a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ G* @* {( C; D# `. {- C
else wait for 10 sec0 g$ V) o$ l t+ O8 F0 c
if A_i=A_leave then send to die
6 z2 j6 o9 N5 e; `; P# v; S else inc A_i by 1
. T' p! t4 n# g8 h. x. H7 n end5 N6 o# K- t, o
end) r X7 [/ J6 O$ k! b
& |" R! D( D& k; R, ^* U9 P
begin P_pick2 arriving5 V* T# |% x2 @. g. O& q
set A_i to 11
5 A S0 F9 h* U4 K- S. U move into Q_induct21 @5 ~0 p7 u6 N* U
move into pickaisle.induct28 A" k" b" g" p+ Z- E5 v
while A_i<=30 do begin
* i3 y' G/ i+ e6 r: x1 H7 [ travel to pickaisle.con(A_i)1 e/ g9 M2 U9 U1 G, @& p2 X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 C+ m- `2 L# u4 L% E8 ? else wait for 10 sec# y8 _4 u* t7 @( V$ `8 M3 P) X
if A_i=A_leave then send to die
8 i; }& X% z8 B0 M+ P else inc A_i by 1, Y7 p: y& r% d. v7 @) p
end
- G9 Y/ U, \ O' L& E. ^" Fend. b! a. }2 F' _
) i6 o$ x; A2 E. M" q( D9 H0 Cbegin P_pick3 arriving2 l& e& {! s% d. J% V$ _
set A_i to 21
4 s( x" S7 v8 C) N4 B1 C move into Q_induct3# r q3 }, Q+ t
move into pickaisle.induct32 G$ x) v2 C( A+ u$ c
while A_i<=30 do begin! I; U/ |7 K n0 v/ a" M
travel to pickaisle.con(A_i)
7 q4 l/ A2 _8 \! _9 z$ |" c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 n6 Q& e5 e- H+ E) B
else wait for 10 sec
. p) j- s8 O( ^ ` if A_i=A_leave then send to die
, y% F% k+ L- N# I9 V5 k. k else inc A_i by 1
0 q1 ?/ p( n' q. L end0 _* J* M! P- J* u. N* F
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,其它按你的 ...
|