|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) ?9 D" ^: d0 Q6 H5 n
# h G7 R9 H6 A8 i
我的问题是,在每个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 H8 J2 d! p8 J7 p7 t$ X2 a s
6 u3 Z6 t$ d. f2 \5 y5 i& tbegin P_read arriving, g R* z# k7 i9 z: e
while 1=1 do begin
9 b7 I, ]/ V, j6 H, m9 Z2 ^7 D7 ] read A_tote from "data.txt" with delimiter "\n"
4 G: F" n4 U" w5 } read A_time from "data.txt" with delimiter "\n" G" V* M* q; O* I' f
read A_leave from "data.txt" with delimiter "\n"# L. d, r$ ]2 |. x0 N
read A_picks from "data.txt" with delimiter "\n"6 {0 P4 H u" ?* e# ~5 D7 H
set load type to A_tote! f6 ^+ ?3 }% }3 P( Z; t
if A_tote="tote 1" then set A_induct to 1
% O5 l1 ~/ p- E- Z! e8 H% c) R8 x0 j3 f else if A_tote="tote 2" then set A_induct to 2
* X6 H& x& Y% f) Q+ ^- o else set A_induct to 3 3 m/ j& B ~4 h* t n, s
set A_i to 0
& q4 q& q7 o. [1 z3 |2 j clone 1 load to P_induction- U: ]( O) }! P
wait for A_time sec
# e% ]* J1 o' y/ N5 T0 E end
6 E) w( U; `6 Z; j0 _0 q; \4 p) Kend
+ x2 O# d# B T* e' [* W5 ^
' J; N" u% L( U3 h* @begin P_induction arriving
% c/ F+ x; G+ e- B$ [. z+ R if A_induct=1 then clone 1 load to P_pick11 f/ Z6 L9 ^$ v# V+ E
else if A_induct=2 then clone 1 load to P_pick2# @' o1 l+ ^) y* Q9 D
else clone 1 load to P_pick3
/ r, L( V% C3 Hend
3 L+ y7 _( X8 @# W; M& Y
l9 C" M! b/ H) H" a' ~( B/ V# vbegin P_pick1 arriving: O" U G& q0 B$ K1 U
set A_i to 1
* K- ]7 Q8 t; Y8 o9 e' u move into Q_induct1
. p1 k* w% V R* H, f move into pickaisle.induct1
# S& g6 H( ^& p- D4 p% e while A_i<=30 do begin+ p; c4 x1 ~% b1 Y0 |
travel to pickaisle.con(A_i)( |8 B. K, E* P X3 B, Y i) ^- ]' N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 i% x# ]1 l& ?9 _5 P* Z4 F else wait for 10 sec9 V0 t+ _8 Y4 d7 k; }% A
if A_i=A_leave then send to die4 D4 }8 I% I' I3 F2 P# d
else inc A_i by 1& @/ W# ?7 Q1 I- L6 x
end/ z- L2 J# H5 s+ S2 k
end( u: u0 H7 q# c6 y9 d
% C$ w/ H: U( u5 \0 R6 l) c* pbegin P_pick2 arriving2 }. i U7 m6 d. Q3 G7 q5 e
set A_i to 11
7 c8 H3 G( H- }' `8 J. A& e move into Q_induct2
) F/ g; S6 P+ K, V1 V" K6 a move into pickaisle.induct20 q, c. l0 E5 d! w8 f+ f" v
while A_i<=30 do begin
: s( g/ C ]8 f! d8 O9 j. Q3 g! @ travel to pickaisle.con(A_i)! I0 f6 g& `7 D8 C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) I2 r% J/ L7 k H1 H a4 A else wait for 10 sec' ?6 M5 D1 U# G/ i" h
if A_i=A_leave then send to die/ c4 B$ p7 p9 w6 N, P3 T
else inc A_i by 1
S* g/ b% z2 ~) g# u5 G1 o' s end( |, F" b% M' A4 m, n/ h( \ o& y- ^
end- L7 l% W7 ?, C+ \
& Z! Z: n" \- \ J1 }! t& ]
begin P_pick3 arriving. |! Q/ m* E8 L5 O( T
set A_i to 21
& N( }' k7 n7 R move into Q_induct3
8 x& f4 _) |1 w, x' y* f, S move into pickaisle.induct3
7 r8 X4 _$ m6 D% Y0 \) g while A_i<=30 do begin
) ]8 @9 {1 D' a' Z2 x3 C) c+ i2 A travel to pickaisle.con(A_i)! b( @8 r0 ]3 s- n' s3 }+ ]3 i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 g: J) |& o3 i( e! z' ~ else wait for 10 sec
0 r: W" R- v* J$ Q2 _; v if A_i=A_leave then send to die
7 N) O! Z: ~+ D E+ x; M8 K3 j" ^ else inc A_i by 1 z( e' m. M1 S$ K: V5 z9 A* M
end( M2 d+ @1 Y% d
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,其它按你的 ...
|