|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 A$ h1 q, }% U. ]6 h @9 } u( l$ C' U9 p$ d; p1 e+ P8 P
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 A1 a! S; t$ h4 r2 _
]$ j# @' B' p. Ubegin P_read arriving
2 [* o3 s# E; V while 1=1 do begin7 {5 X. o+ U1 M" w0 \
read A_tote from "data.txt" with delimiter "\n"
( V5 R% p9 l+ H5 b1 [7 R read A_time from "data.txt" with delimiter "\n"
1 X3 l" @" H e0 A, B read A_leave from "data.txt" with delimiter "\n"
8 M# p+ k8 R: c( N. @1 w8 M# L+ [ read A_picks from "data.txt" with delimiter "\n"
8 @, ~5 M9 g+ H% u" M set load type to A_tote5 o* E- V( A! ]5 e
if A_tote="tote 1" then set A_induct to 1/ f# V% d7 q5 J
else if A_tote="tote 2" then set A_induct to 21 V9 F% ^7 c4 p/ P( |
else set A_induct to 3 1 g) ?& u3 ^9 }2 B' @6 o9 I S) g, _
set A_i to 0, U# A1 v8 o# y7 R! n3 ]
clone 1 load to P_induction% d, o* h6 c$ _7 k* B0 e
wait for A_time sec1 t$ e1 c E) h! Y- F
end# q- G& c+ ]4 L: y p) @3 o' m$ g
end
: p# C2 R& w1 a( W, G/ ^% V0 l
5 D- a4 K+ T; q0 @; [begin P_induction arriving
7 M) f* X3 W# T' P- d if A_induct=1 then clone 1 load to P_pick15 t+ i; v$ }8 |+ P4 v# E
else if A_induct=2 then clone 1 load to P_pick2# h0 ^! I3 T' P% t. Q; v( F
else clone 1 load to P_pick3
- \8 H6 X* w2 c( p$ Kend; h. C1 Q0 a( n3 g
+ C* O) B9 V) vbegin P_pick1 arriving
. t8 ~1 t! Y5 q* W set A_i to 1
5 T7 i) `! T* o g move into Q_induct13 V5 t4 z' u8 t9 L, {
move into pickaisle.induct1
* F( V. O6 Q; \4 \ while A_i<=30 do begin8 K% f; p, r8 d- @/ U; x
travel to pickaisle.con(A_i)1 B) M' {5 v% [+ y$ [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 P* d: Z; w+ S, s
else wait for 10 sec
) Y$ \8 g- V3 J# v& C, K: I% K if A_i=A_leave then send to die5 X* P# w0 _- m/ `
else inc A_i by 1/ @7 }3 k, Y; Q/ _0 Y/ C5 G! F
end
6 V, N7 J F% fend8 {7 p9 b" B& _' v. Y* q
9 f3 O5 t- k' r* V; y3 gbegin P_pick2 arriving" R' }& g3 v, x8 s" V$ C" i
set A_i to 11
, V7 q3 K3 K+ |1 t* Y3 b: i move into Q_induct2
* t; W' m7 \& e. u) x- a move into pickaisle.induct26 v7 y+ r# l9 M& {: {4 r7 u
while A_i<=30 do begin4 O8 G% ^( X: S$ X7 h" Y. @ f2 |
travel to pickaisle.con(A_i)
, p% {0 _$ T+ r% @' C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! {$ O Q0 S7 | else wait for 10 sec
/ l& d" |* {$ r& ^5 Z if A_i=A_leave then send to die
" C( ^/ Q: t! O) V else inc A_i by 1
f. b1 h) T! U* x! U end; \1 k2 H7 \* m8 w- }2 o; x, }. M
end. R) @9 z% m6 ]3 J7 R6 y# E* Z
' j- u" Z6 ~! n
begin P_pick3 arriving
. w& d: b4 ]8 J5 |3 ? set A_i to 21; j+ v2 R' C# v4 Q+ v# |! a/ t, L
move into Q_induct3! V0 J7 V7 j3 K) t) }
move into pickaisle.induct3
; M( e4 j4 K3 m3 d. E# h* j while A_i<=30 do begin
- D% C2 U1 q6 X x travel to pickaisle.con(A_i)8 S* I0 n% i% l7 v) I( v: B. M( y; [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. \0 H5 c \& X6 g; B* Z1 B$ l else wait for 10 sec
0 X" t- L* H1 a/ f$ N if A_i=A_leave then send to die) b5 F# A4 E1 ~8 B+ d: O% k
else inc A_i by 1
# ?) X% w. I3 K: m% n5 k end
4 M) C4 Y- v" f+ E) uend |
最佳答案
查看完整内容
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,其它按你的 ...
|