|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" s5 k: _ X( R3 K' l: L1 I% z1 w: ~
5 M2 Q& o1 c) A7 T3 y我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ L! W" Y7 d6 V, a/ o
7 b* @9 c" N: J& w1 B, y* v5 ebegin P_read arriving) d9 h" s5 [. g% w& e) ?8 |" M
while 1=1 do begin% c, z" _/ ^2 U7 B0 u
read A_tote from "data.txt" with delimiter "\n"
& O! Q5 |- D$ P- D' w1 T read A_time from "data.txt" with delimiter "\n"
1 K" X' K2 c( I# K read A_leave from "data.txt" with delimiter "\n"" T3 @! N* K# y2 D/ u# L# d9 C
read A_picks from "data.txt" with delimiter "\n"
% _9 {! I: A* s0 l* J$ o set load type to A_tote
$ s- R% I4 f+ U% F* @ if A_tote="tote 1" then set A_induct to 1+ i0 f- u0 j- Y" J! T( `
else if A_tote="tote 2" then set A_induct to 2/ N, ~+ b- W; q5 ]! ^6 W! @
else set A_induct to 3 2 \: n7 F1 ^ S# M" m2 q4 N" Z
set A_i to 0, B& q- T4 ]7 o
clone 1 load to P_induction
7 R* |. u3 q, ?6 K j5 P. y8 C wait for A_time sec( o1 }* o, t6 X, x
end; M( H- S# n; {& q
end
2 v* ?4 p6 T$ y6 S/ j- e0 O9 s0 a+ c9 i* K& F# d# c
begin P_induction arriving
/ Q) a1 [, x" Z, L" K+ X if A_induct=1 then clone 1 load to P_pick1% w) R# L7 t% w& w
else if A_induct=2 then clone 1 load to P_pick2
' B/ x0 B e* O" T. F4 k" l else clone 1 load to P_pick3
* Y& M8 ]% U/ Q% A t% Cend
; R5 ], G9 q7 x( G( d1 W* z$ X+ ]6 z- {. S+ U' x
begin P_pick1 arriving) O5 q: ^4 \$ J: x% A8 \
set A_i to 15 ~" d- E& A. u3 G. S4 b
move into Q_induct1
8 q9 ^' _. Z' O9 ]) q) `: f move into pickaisle.induct1
% `+ @/ t3 c- s' N6 H$ F while A_i<=30 do begin
1 y! H/ h% V, z travel to pickaisle.con(A_i), t+ X8 e* f9 @ P8 I7 c* `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
X& r8 I) F, r# b2 c else wait for 10 sec8 j6 z/ q5 ?/ i) `3 t8 w( E6 _7 z
if A_i=A_leave then send to die
4 @- t5 T: A" f7 F; w3 U; x else inc A_i by 1
; C" @2 O0 a [8 x N- c% E) _ end
) f R5 x+ o+ S# M O9 Vend. u: Y/ a9 e0 ^7 i+ |4 y& w
2 C% G# q5 o! h& b: q2 ybegin P_pick2 arriving- a4 o6 t& V3 E
set A_i to 11
$ |" _. ~0 b9 h move into Q_induct2
3 Q0 B! J6 k( v* p move into pickaisle.induct2
4 B$ [# a6 t! c while A_i<=30 do begin
3 |0 [7 Q$ M4 i/ x4 p( p; B travel to pickaisle.con(A_i)
; Q2 O: E. d& e, {; _: A: o) j2 { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! ~, m; f8 r$ w& [* i: V
else wait for 10 sec, ?- n3 F) Q" x% [
if A_i=A_leave then send to die& m$ \7 e. o' e5 T0 ~2 [9 F
else inc A_i by 1
7 R5 J* R/ F* z' O% ] end: l% D" G5 I! [2 h+ u7 E' W
end
2 j8 e6 |& o# U& ~( f, p5 Q# Z7 q9 Q6 g- ~" `& ]0 I7 K% k) ]
begin P_pick3 arriving) A0 y# h- z+ O$ \( m0 ]0 m ?( Q5 l
set A_i to 21, @. @3 A* _3 |4 C8 q
move into Q_induct3
0 R0 v V: O3 t' f$ d move into pickaisle.induct3
% L% M9 O { k+ { while A_i<=30 do begin
; f" p2 n+ Q. l, R7 k. r travel to pickaisle.con(A_i)
5 y. }8 z& t: p+ P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 F: b: p' I0 n( C7 W s. Q$ ?' S
else wait for 10 sec
: d7 [7 E2 W2 w. G' V if A_i=A_leave then send to die0 I3 Y. B$ q8 ?; V% c; x' a
else inc A_i by 1
1 U( z7 i9 @# n" H3 T end+ } a# v% [: q( t+ V+ X5 N
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,其它按你的 ...
|