|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 }+ \4 M" Q7 {; k7 }
0 y" ?: }! }$ F" U6 E' o+ t1 V我的问题是,在每个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" g ^: o2 c* ~, h" z7 w
& W4 n. V# R3 C$ B; }) t
begin P_read arriving8 @* Q) q! N2 i9 f" ?+ m' V
while 1=1 do begin. f% d8 o8 Z! T3 N! A* H
read A_tote from "data.txt" with delimiter "\n"
0 Z r# u5 u. B read A_time from "data.txt" with delimiter "\n"
2 X6 k% P( b& w1 d, z3 S% u" Z" M read A_leave from "data.txt" with delimiter "\n"2 n6 P* R* J: x& q
read A_picks from "data.txt" with delimiter "\n"
& X8 Y( B6 @3 e5 ^ set load type to A_tote
" p: R, ^8 L$ g- g+ @! w: R/ X7 } if A_tote="tote 1" then set A_induct to 1& R- _; k+ V5 g/ b
else if A_tote="tote 2" then set A_induct to 21 z0 x/ r/ j1 T. q6 `! ]1 m
else set A_induct to 3
3 H/ V7 s' p# {1 ` set A_i to 0
f; e% H$ O: d+ _2 S! `5 ? clone 1 load to P_induction, K! l% N5 B/ b) G. ^( A
wait for A_time sec' N7 C% C$ c0 c y$ G
end
, K5 w0 \; ], _6 A) zend# o. S: [8 V+ `7 l' g' l
; [6 @- o5 F& c' xbegin P_induction arriving
. e1 U& ^; G0 n0 g if A_induct=1 then clone 1 load to P_pick19 \7 U s% P$ O. y1 O
else if A_induct=2 then clone 1 load to P_pick2 V1 b+ W4 \' u9 y5 ^
else clone 1 load to P_pick38 ?. ]! N' \5 A+ W! @8 k
end; U4 U4 T' t5 N1 {; i1 O
0 g; _3 S% s) {4 ^" Z! Tbegin P_pick1 arriving
1 X J$ {" m$ E, i' y set A_i to 1
- s( R" C2 B* y2 d. ]+ \ move into Q_induct12 G' M4 N$ I W, P, n% {
move into pickaisle.induct1
) ~. N; _& ]$ O" S while A_i<=30 do begin
1 n2 ]6 J( z; r6 d. X1 z& Q travel to pickaisle.con(A_i)
# ?( l! N/ A; w; z6 \9 A+ Y- Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 a1 u0 ?( z4 M c6 I7 W
else wait for 10 sec
* f" a: T! N4 C9 }/ q, n) n if A_i=A_leave then send to die+ d; T$ M }" K# q4 s6 r* b7 ]0 E
else inc A_i by 1
; g4 V1 }5 V$ H1 b4 L; ~9 n3 J% k% r end
4 A! ]5 E. X4 }; k# A5 _- }end; R5 d; s* q- @% J% t
* p) x4 E4 u% r" A3 D& ibegin P_pick2 arriving
! l) n( w( ~; g, L" H set A_i to 11
6 C1 j+ p1 g4 T1 Z! } move into Q_induct28 i$ Z* n' O& ~4 _7 H
move into pickaisle.induct2
; Z1 \1 g) Q6 ~! y) r. l. J while A_i<=30 do begin
' I3 P# H$ T( O. h/ J$ p) W2 D8 S" | travel to pickaisle.con(A_i)
5 E! B% l7 V% k) X: u) A if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 h3 D [6 W. Y* h+ ] else wait for 10 sec
# c# H( X! g; | if A_i=A_leave then send to die
! M, s+ A, b& G; K7 e: c else inc A_i by 15 Y6 B q$ D4 i6 }3 _4 K) ?' Z
end
+ N6 ]1 ~- f6 X* Zend+ v/ A; i8 t5 i% P" I4 N
0 u) g: L6 m! W! E. @. U' zbegin P_pick3 arriving
9 [% W: q8 H1 W1 ] set A_i to 21. U( I/ f3 G1 n5 |
move into Q_induct3* F' L* K* }$ g
move into pickaisle.induct3
I) P/ g# a3 i6 g while A_i<=30 do begin
) Y! |6 n# [& P0 B+ y, `( o% [ m travel to pickaisle.con(A_i)/ r9 z! |9 p0 y# g6 c: d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 U! j# j0 S: }; O else wait for 10 sec F7 A& Z3 u$ y( k9 j1 G
if A_i=A_leave then send to die
+ Q' O" X9 F: I1 H. H else inc A_i by 1
) ~7 _' M+ ?0 u9 w+ z+ s end
9 J/ ~8 [, o1 Y- fend |
最佳答案
查看完整内容
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,其它按你的 ...
|