|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 y6 W' d# C( z( o& G5 g5 X
2 s) [3 |/ k2 K" C/ ? ~& s# a* 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中的数值,不知道会不会有什么不妥。
8 u5 ?8 L' t1 H1 H; C; j- }% ]: w- _- N- t+ g7 _) E' ^
begin P_read arriving
3 E; \; H7 m- f. j! t) r% Z while 1=1 do begin1 v% A: \! {1 A5 q# F* M5 B
read A_tote from "data.txt" with delimiter "\n"
2 [$ t; t$ r/ d( i; ` read A_time from "data.txt" with delimiter "\n"
. k8 B7 }5 x$ k/ ^* U5 _ read A_leave from "data.txt" with delimiter "\n"
4 f m0 E- Q# ]- V read A_picks from "data.txt" with delimiter "\n": t) t$ j' ]0 e2 C4 C) H ?$ X( T [
set load type to A_tote0 ^/ W; j) X5 z* A2 B3 a
if A_tote="tote 1" then set A_induct to 1* o7 B5 H& r6 P+ r$ l/ l3 I8 L
else if A_tote="tote 2" then set A_induct to 2* O7 m; s; m2 j' X5 N
else set A_induct to 3
6 q6 k R8 z: U2 l, E set A_i to 0' }: r( c5 G7 p: a! C
clone 1 load to P_induction
! c* J- \/ {7 E: j. B8 y wait for A_time sec
0 u7 K6 y1 `- ]* x' f% ~7 _ end
; k3 w9 s/ E1 S" Rend- A" T' v% G3 ]. E
0 b# e( _* U$ n0 e' X
begin P_induction arriving
, V3 r `( y2 R$ k3 l; ~0 A if A_induct=1 then clone 1 load to P_pick1
5 S: B& x2 ]6 T& U' O else if A_induct=2 then clone 1 load to P_pick2
; h: P3 A d$ h) V7 _; q2 H% w4 u* c else clone 1 load to P_pick39 W1 k; |! A# W U+ x
end8 p" `6 \2 ^$ m9 J6 K1 |
/ ?, |+ J- S5 |- s
begin P_pick1 arriving9 }5 `/ G; S7 Y/ S
set A_i to 1) Z( N u3 \- }& f b: k+ `# c
move into Q_induct18 f8 w! v' A' ^) T1 Z8 E5 a
move into pickaisle.induct1+ v! s: q# w) f. c; r4 c* _
while A_i<=30 do begin
2 V6 J0 {' B5 G: d3 p travel to pickaisle.con(A_i)
" b4 ^$ N1 u! z( x3 E X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 ?$ @& a5 W' ]- y8 J8 c4 @: K else wait for 10 sec6 i- G; |& m& o8 H+ Q
if A_i=A_leave then send to die) s. A+ I& F3 d( Q+ L8 A: M6 g: d
else inc A_i by 1& g2 \7 v6 l) e- a0 ?* D$ \
end! V/ v6 O% _$ a1 ?: B
end/ i2 p$ `) @4 X& J: L
0 @. I4 A; B; u+ `begin P_pick2 arriving8 m- f. |; s, m3 P3 J# D+ H6 |! k( x
set A_i to 11( ]& p! Y2 I6 n4 w
move into Q_induct2 u4 o$ g: v: \$ {/ }
move into pickaisle.induct2
9 b% c/ x8 K+ s* b ` while A_i<=30 do begin9 L3 g. F6 w( V- y
travel to pickaisle.con(A_i)
/ `9 Y5 F4 e& n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 N) ]# D* t3 u" t: {" X else wait for 10 sec
7 T* V3 x* B5 g( Y$ [2 ] if A_i=A_leave then send to die k' ]4 r& G, Y3 n3 S; ?
else inc A_i by 13 M- c V1 N: h [+ ?1 n
end/ x! L; u/ Y. g# L" w; Y( \1 m/ W
end
* L; z- a( `9 ?$ t; z* F& c# f1 q
' w* x8 b' L _. u2 e- C/ pbegin P_pick3 arriving8 N U6 r K7 ?, }( o1 C
set A_i to 21
' B9 e7 D. T: p0 b move into Q_induct32 I9 h9 S2 y, U2 r! S7 m
move into pickaisle.induct3& y+ q0 q; t% n5 b% a9 m/ q
while A_i<=30 do begin8 i; @/ P6 X4 B
travel to pickaisle.con(A_i)4 O) K( Y* n4 p6 X8 c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. j2 m/ s1 y. S* p7 P; i$ U3 D9 H# M! J else wait for 10 sec$ o7 w! T1 Q$ _1 O. g8 q8 ]9 c
if A_i=A_leave then send to die$ k! Z& j. W* X$ K
else inc A_i by 1- m" G' F7 q: e7 | P$ l. c" B+ w
end7 p* t8 R" T$ f1 q" c6 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,其它按你的 ...
|