|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 d2 ^8 k- F2 c# g! L4 y8 G
5 g/ w, _/ r, D" h; ]. v$ x7 _我的问题是,在每个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中的数值,不知道会不会有什么不妥。
I5 U1 |2 y; y! Q+ G/ S- l( r% n, a( V; R4 t: I
begin P_read arriving$ D0 g/ m a& G* n, a, O
while 1=1 do begin
4 @! v& y8 W8 o5 ?+ C8 h read A_tote from "data.txt" with delimiter "\n"
/ B9 w, t( u$ H: O4 r/ K: L! a read A_time from "data.txt" with delimiter "\n"$ @0 z/ j2 e7 a/ B' C) m
read A_leave from "data.txt" with delimiter "\n"3 }0 r, b) B( r+ n3 u1 {
read A_picks from "data.txt" with delimiter "\n"( M2 D6 D2 p: [2 |2 C
set load type to A_tote
! m X- l+ V0 B" f2 H- n! r3 S( o if A_tote="tote 1" then set A_induct to 14 v# U# Q# m9 }: q G9 M& s
else if A_tote="tote 2" then set A_induct to 2
) p9 |! X- ^, C" W9 S) G& |; v else set A_induct to 3
* D" p6 l9 C/ P. D+ X8 P set A_i to 0- Q8 f7 C9 J; Z0 d" I3 r
clone 1 load to P_induction
9 w, o1 i. I: g' l2 h4 O- q; g: u$ [ wait for A_time sec
- o' Z$ s! N) ]/ [. k end
+ G* x1 G- e6 H4 _6 A" xend% `; L9 i/ V$ p! c
" u4 h, g; d4 I \+ a4 V# `, Bbegin P_induction arriving
% X/ M7 `7 W7 K$ O* w6 ?+ R$ M if A_induct=1 then clone 1 load to P_pick1. P9 {& K1 c4 t: N7 t( h6 E
else if A_induct=2 then clone 1 load to P_pick2) J5 O/ ?& Q* C9 ?1 {
else clone 1 load to P_pick3
( _ } Z s5 P; mend- i# z: Q, T% K! Q0 O1 ~8 f s4 U
! I( x: }' c- {& D( }: Sbegin P_pick1 arriving
8 A) L# g$ i2 }8 \ set A_i to 1# Z/ g8 N6 J3 I2 o9 U" R0 t
move into Q_induct11 H9 e! T( }6 E5 g: U6 r
move into pickaisle.induct1$ n% ^8 G \4 v+ x& W+ c1 _: O& Y
while A_i<=30 do begin& J0 p7 H2 [: g* Y I
travel to pickaisle.con(A_i)
- c6 Q S4 D6 `) X* J. z' ~8 K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# u) L6 i5 [' k# ^$ D
else wait for 10 sec& t! `% E8 ~0 L6 c' R* V
if A_i=A_leave then send to die
1 x2 \$ s' }3 T7 L* Z# J# O else inc A_i by 1
/ q y( U7 S: L# \! s f, q3 o5 ^- A9 U end
! ~% I! K4 u7 t% g( f& u) q( [6 Eend/ m% `& q6 e4 Y3 ?
7 i" b! O( ]' ?3 ]8 w# t- v3 L9 A( `begin P_pick2 arriving: `' w$ N* z3 \; _4 w# x1 G
set A_i to 11% x8 O9 G% R: I3 F R6 s
move into Q_induct23 F6 V) Z" a5 g. ~3 L
move into pickaisle.induct2
' r* }$ N. {2 _; S a( E while A_i<=30 do begin
: e& C1 x; d, l travel to pickaisle.con(A_i)
% Q7 `& T& D% X6 g1 G9 n# k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% Y v7 E3 c, X2 }" I v. @ else wait for 10 sec
& G$ S5 l2 b j& T( u8 ` if A_i=A_leave then send to die
# n* }) c7 z2 a else inc A_i by 1! @9 L4 e% ^) ^( H1 a& J1 i8 L
end/ n$ u# N7 } U+ x4 W
end
8 e2 w5 p5 j Q( j+ ]6 O% |, g, ` u
begin P_pick3 arriving
. }+ o# P3 ?- X" Y" k& g `) y set A_i to 21
% }+ C7 y/ d& e3 b* ]; _* O' I8 l move into Q_induct36 D( ]5 @& H+ T6 }* O' Q
move into pickaisle.induct3
- y! {) x9 z8 Z# t while A_i<=30 do begin
7 }) ?! C. X1 v. I# M z9 T$ k0 v travel to pickaisle.con(A_i)( N0 T" h Y" O" [( q$ ]7 m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ _% l7 |/ d" K* P% Q
else wait for 10 sec
- @5 M4 `: d" v if A_i=A_leave then send to die
7 u4 T/ _( i {4 h3 } else inc A_i by 1
' C) l P: ?6 C6 r5 }+ x' P end: b" c Q# }( n. O
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,其它按你的 ...
|