|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 }1 I) ^/ ^- Y7 Z; V
% z- Y% h$ h# u0 e/ A我的问题是,在每个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中的数值,不知道会不会有什么不妥。! O% z. E4 N' s
4 U& U8 A% r# G( }
begin P_read arriving& w2 P( s- o# S' G% C* i1 M
while 1=1 do begin
& }4 i+ n1 X' n read A_tote from "data.txt" with delimiter "\n"; Q3 m7 [ c \3 [+ ?% [2 E: ]
read A_time from "data.txt" with delimiter "\n"
' g( i" Q/ N/ M: y v* w: j' ^' V: d read A_leave from "data.txt" with delimiter "\n"2 u: e8 `2 Q% ?% o- w R
read A_picks from "data.txt" with delimiter "\n"
* E* G# [' ?0 |7 q set load type to A_tote
; Q& E0 W+ X4 K0 `- ]1 r if A_tote="tote 1" then set A_induct to 1
) R1 ?- V' \2 L$ @! P; G# z$ B9 a9 T else if A_tote="tote 2" then set A_induct to 2
- B% _+ _( w, s4 Z v else set A_induct to 3 , k$ A9 v8 }! Y; c. U: N2 _
set A_i to 0
/ h- v9 a: Z0 G& O clone 1 load to P_induction2 ^1 R; x' k) Y8 f1 w
wait for A_time sec
9 ]6 \; U6 U5 V. C. H end
1 Z' k1 R, Z8 G1 _9 T$ R3 @end
0 M- t+ K* X. V$ X4 o4 u3 |% H# U" t4 Y& t4 [" k4 n: I
begin P_induction arriving* X& s4 i( Z3 r2 c2 P
if A_induct=1 then clone 1 load to P_pick1. O; X0 ?0 r; H' y) I
else if A_induct=2 then clone 1 load to P_pick2
+ e9 V" O+ M5 m- i" p else clone 1 load to P_pick3% @1 y$ w6 H8 b5 i9 k- G* M. \
end
& t7 Y4 R9 V/ O' n: [; o4 |7 l1 r2 _+ r! @
begin P_pick1 arriving
6 t; u4 ^% f9 e2 L set A_i to 1
) W8 Q/ A( w+ ^6 T- D7 j5 H6 K9 j# { move into Q_induct1
5 o" K; q9 f, x8 _ move into pickaisle.induct1
8 H. {0 k9 y- R( @2 c8 W0 e& W while A_i<=30 do begin( G* o! x7 H! b6 w0 |% U
travel to pickaisle.con(A_i)
`5 Y3 {8 |4 k( Z7 ~! u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 [% ]& Y" X; [4 ?# a else wait for 10 sec8 Q, @7 u" F$ W4 c- m0 P
if A_i=A_leave then send to die, e8 m( L6 U4 ^8 J0 W
else inc A_i by 1, a% i- u% O% _9 G& V; l+ c, J
end
7 ^& p$ R# z, p1 W6 Iend: V2 ]1 I& Y- E) O
0 I0 `, }) {. i
begin P_pick2 arriving
4 B2 N% M. X; u/ }3 z set A_i to 11
, c& ]: {4 ^ n2 t# ^7 p& e9 n move into Q_induct2) W2 }4 H5 r) d6 G- G- R
move into pickaisle.induct2
1 @8 k+ O% @, n; Y while A_i<=30 do begin
! f. L( @5 ^/ ^% R1 l* f" t travel to pickaisle.con(A_i)0 D7 f3 }( w' g/ N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" g0 n" F5 [8 H M8 x+ c
else wait for 10 sec8 F7 C. y5 F* p
if A_i=A_leave then send to die
9 s' r4 _; j7 w& x4 X: \ else inc A_i by 1) K' @9 j3 d; d* [- [
end
% d7 O% T( y" Yend
- K/ I5 D( r$ |) R3 n9 j$ h4 n& [: @2 B/ b1 v1 u) E' [( e
begin P_pick3 arriving7 E% x: g* l( Z) b
set A_i to 214 L1 v+ P0 T' G
move into Q_induct3
7 F8 }5 S8 u5 S+ v$ H; N move into pickaisle.induct3
2 G/ R* k; X' X! @ while A_i<=30 do begin* V2 v+ {2 x3 y5 L2 ?: k5 [8 E
travel to pickaisle.con(A_i)
( O# Z5 I* t( ~9 q* C! V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' s( y# u9 p" g1 _* x% F
else wait for 10 sec: f( _- }: h& B& r% \; H8 b1 t
if A_i=A_leave then send to die
0 U: ]) x5 }9 p6 @, V( z& t else inc A_i by 1! [: y8 P# Q: e5 C( y
end
8 v/ h( Y+ A, P. {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,其它按你的 ...
|