|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" w3 a5 A- M; n9 t- d
, r4 v( q1 I9 l! Q2 a' R
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! \0 `$ e( m: Q' j- h5 V& t% Y# _
* v0 N/ s1 z0 [. W" A. r
begin P_read arriving
9 L6 w& r+ ^& ]+ z while 1=1 do begin
8 u3 @( e& R. Q read A_tote from "data.txt" with delimiter "\n"$ e$ Q$ e2 D% O# J
read A_time from "data.txt" with delimiter "\n"4 r$ y2 c& s8 n, e* p
read A_leave from "data.txt" with delimiter "\n"1 e2 W: f4 I6 U# a! v- @' X; I
read A_picks from "data.txt" with delimiter "\n" O7 n H1 P0 C$ {6 C5 s
set load type to A_tote
/ _) n$ a% r6 J- i, x if A_tote="tote 1" then set A_induct to 11 I% |# Y# d- P" Q7 V( a
else if A_tote="tote 2" then set A_induct to 2
0 {' q# |: b- l" T% a' K5 W8 n* J else set A_induct to 3 / k4 R, q) E& O, Z& E) e
set A_i to 0- J/ @9 \3 o: ^1 H$ f) \
clone 1 load to P_induction5 f4 N- X: ]) i( G1 d4 ^
wait for A_time sec
; C& f1 ?' A9 {+ m% g# w J end
! |! p' l) l( t' Send# E4 w, `' @- W0 F8 Q& j* {% w
1 y( J* J2 l8 f/ P7 C& } D
begin P_induction arriving: M, A" m0 n8 k+ ~! V* j& ?7 Z
if A_induct=1 then clone 1 load to P_pick1
1 u6 n4 S n: b) f else if A_induct=2 then clone 1 load to P_pick2
( J6 l+ m7 q+ M4 q4 ? else clone 1 load to P_pick32 f: ^! Z( Q6 o! D. W7 X
end
; ]3 a$ @) U# Q; Q1 q, j: W6 O$ h% @3 L/ Q
begin P_pick1 arriving& P E1 ]/ Q2 N1 h; r/ @
set A_i to 16 Q' }+ b3 ^! X" p7 u3 [. Z
move into Q_induct1- U8 f6 `) W7 I+ p3 T: I* a
move into pickaisle.induct1
- q6 g F" i n) r" {% n! ~ while A_i<=30 do begin. {& @ g# L r
travel to pickaisle.con(A_i)
( H) \' h( `/ Y8 ]5 f( S4 ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, S8 }; e+ i: H$ t" j# N else wait for 10 sec
; w3 o# H j$ ?' L7 A5 ]# e if A_i=A_leave then send to die j$ U b! ]4 T
else inc A_i by 1/ p8 p n* U' d* h) M
end
p) g! _ U5 n5 kend: E/ U+ i9 ^$ w6 l
0 h: H- I) l9 R' r: |' w1 l8 B9 C5 k' qbegin P_pick2 arriving
, x; J& B+ G5 K, u; x6 B set A_i to 11
; v, e6 i) h0 E8 @% H' N/ S+ f. A move into Q_induct2
$ P, @9 b" P- U& S move into pickaisle.induct2, B4 g2 \; [6 ~
while A_i<=30 do begin
% F3 O8 S, Q/ e; Q9 x. b. @8 K travel to pickaisle.con(A_i)2 F8 s2 b) F% j; p& l& V, w* I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' b2 d) X$ F3 ?9 H [7 v, X else wait for 10 sec+ F9 G, y3 A# c' K' I3 N
if A_i=A_leave then send to die
9 i' q* u3 n$ ?9 o& s else inc A_i by 1
! z' o9 c! i3 k" I3 B end
" _" B' j$ n3 D Fend! y2 q7 S$ K! {4 A0 l
, Y) ], S" D2 L- W4 `, N
begin P_pick3 arriving
- J% E: l4 B: L# s set A_i to 21
- t: p% Z& M3 H; F) [0 O move into Q_induct37 ~+ B3 j) j7 d) W+ p4 e4 h8 D
move into pickaisle.induct3
) ~4 |: L( R7 P: Z/ r2 e while A_i<=30 do begin
6 w* ]+ m. Y3 p travel to pickaisle.con(A_i)) }) V( z% f" |& ~! f0 P, c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" C6 I* t- O+ P- Y1 b
else wait for 10 sec
, r2 @" l& A% v/ n7 ^/ O" F5 t6 G8 B if A_i=A_leave then send to die7 Y* q9 |& @8 l! d. ^: a) f' f& Q$ `
else inc A_i by 1
7 n9 Z3 W m* I. i! w0 e5 e end
9 C6 v, g( J! r4 c$ r: X, Yend |
最佳答案
查看完整内容
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,其它按你的 ...
|