|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ G! h6 X) u5 d+ L) c5 S3 e" L+ `& |
6 e- k7 p1 Q8 I+ z# J& e, f我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 |/ [* f- y$ l2 U) K6 `
) l1 n" Y9 s! u4 w# B" ^begin P_read arriving
. c7 j5 G; h$ M1 z+ [! B0 g( A3 V while 1=1 do begin
% A# I W4 U4 V$ C. \5 F4 e* M( } read A_tote from "data.txt" with delimiter "\n") E4 n& e, J, F# J9 r
read A_time from "data.txt" with delimiter "\n"
# X3 e' Z& v7 k, S% q I read A_leave from "data.txt" with delimiter "\n"% ]: T( P1 A; q' t- G
read A_picks from "data.txt" with delimiter "\n"! h! J* i& F- F8 J
set load type to A_tote
% ]" L0 z) d8 B) _ if A_tote="tote 1" then set A_induct to 1, u; u. e! ?% ?
else if A_tote="tote 2" then set A_induct to 2" B$ K; p4 y. }1 u8 ^
else set A_induct to 3 ! M2 S' d5 t5 _) J3 z
set A_i to 0
8 w8 Y5 e; R5 c1 D; ^7 c. I clone 1 load to P_induction3 y0 ^! y" q# ]$ l9 Y: j3 I
wait for A_time sec, m# o/ s$ b, L; s) D3 Q! D% i# o
end3 I7 K% k( x* d0 H1 g K
end8 T, ]8 l6 D+ W6 c7 F" c1 {$ O, A
) U" k0 n" H- w: `: I: U4 |begin P_induction arriving; _3 M; `. H. \" k: e* L! y" _
if A_induct=1 then clone 1 load to P_pick1- d5 k; t4 I8 M6 }* }3 K
else if A_induct=2 then clone 1 load to P_pick2
! ?" H/ y( _% s) ] else clone 1 load to P_pick3 D) D( h& \ e5 e; o* @0 {7 r
end5 ?# t! B- J& m' t3 q. t
7 V0 A9 o) i. b2 ~1 p H
begin P_pick1 arriving
1 n4 L$ a1 K$ z, g/ c1 p set A_i to 1+ H( k" x4 m$ _, P1 D. a
move into Q_induct10 a) `# \; r% \0 s0 X/ S" Q
move into pickaisle.induct1
3 I# s- P) ~; V while A_i<=30 do begin
/ W3 `! P2 t% A& P" [" t6 `; w4 a travel to pickaisle.con(A_i)" [; j/ n% g' }! U' ^ E, x2 {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( N7 x6 j, \8 _ else wait for 10 sec
+ S C& L1 y- c' F% x if A_i=A_leave then send to die
7 t6 y) c8 m) `4 \ else inc A_i by 1
( G6 b0 a! r1 i2 ^ end# ?4 P0 Z" c; _
end
$ N5 e+ |# ?5 ]. ?. K
7 U+ x6 z& Y7 L6 `: xbegin P_pick2 arriving
2 n7 z5 @, g2 V) d6 \& }- Z set A_i to 11, S/ _8 m% V* I, K( }% C' O$ m! W
move into Q_induct2
8 h6 k/ x/ f0 l move into pickaisle.induct2
# P+ B5 g# k8 v( |3 r+ k) `+ t7 H while A_i<=30 do begin
1 I& l$ v% T r6 z( U, T travel to pickaisle.con(A_i)
" A$ l1 a$ w& Y7 F4 e: k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# Y. V" z2 T" n: y' k' [
else wait for 10 sec- e7 X3 t* B9 I
if A_i=A_leave then send to die
' c1 O& G3 R( C/ [, [% I else inc A_i by 1/ i; l4 B; y3 Q
end m; y* F b, d5 o+ ?. j
end
/ I- F' r, c4 Y. R) S
$ ^! F5 p8 C7 v t5 K/ W- `7 Ibegin P_pick3 arriving
: n, ^4 e1 U7 O, W$ R8 L set A_i to 21
) V: p: G% s4 S) k' K& ~( |% s move into Q_induct3
3 U; N5 B2 ?( s' w2 ~ move into pickaisle.induct3* `3 }4 i' ` N7 a
while A_i<=30 do begin
6 S0 u; Z, q6 q, ] travel to pickaisle.con(A_i)7 |. b& j3 s( X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( P% t; {1 `4 U: W- l else wait for 10 sec% C4 N! y9 M3 {2 U; A
if A_i=A_leave then send to die
|: l4 b* {& z# t% l( H0 F else inc A_i by 19 q$ i9 I# F/ R! g
end
+ b7 O/ O1 p- \! D+ Q- |9 Rend |
最佳答案
查看完整内容
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,其它按你的 ...
|