|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 g7 n- m$ `3 b0 v' {0 J
# J8 w4 H5 U' z* C' p B) H; 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中的数值,不知道会不会有什么不妥。
( k+ y! }; P9 l5 I! n8 v. X C3 B8 K0 r F) I5 \
begin P_read arriving
0 K) l" H V- }' E while 1=1 do begin
& U, a- y3 e$ ]8 F+ w( C0 G! v read A_tote from "data.txt" with delimiter "\n"
& q0 j$ \" |# [ read A_time from "data.txt" with delimiter "\n"
3 X4 B- @9 A( K2 x; S2 H read A_leave from "data.txt" with delimiter "\n"
7 s2 u0 e4 F0 q1 F5 u read A_picks from "data.txt" with delimiter "\n"
* q; P- o x5 u' p* W+ Q" l. b. r set load type to A_tote6 G9 K0 v% t" e& v) d: O' [8 Z$ k
if A_tote="tote 1" then set A_induct to 1
5 |3 D& ]' ~& @4 P else if A_tote="tote 2" then set A_induct to 2
3 C9 B7 h. g( q- b X else set A_induct to 3 5 d F- z& @0 f' O0 u8 ~5 _& D
set A_i to 0" w: `6 g& Y- D$ ?) A, D6 y; F
clone 1 load to P_induction
& c3 o2 K y/ Z wait for A_time sec4 b) O k5 I1 v$ k7 X
end
) x3 M- A/ }) V; C$ D; `5 N% Wend
4 k: |, S* k" T6 P" D. d& @' ^2 _( d+ q
begin P_induction arriving
2 i% {" f) J% v if A_induct=1 then clone 1 load to P_pick1
, f$ D: y; }0 a& p; b& p9 t else if A_induct=2 then clone 1 load to P_pick2
! ]8 v2 }, k) j9 ^3 }( G- W else clone 1 load to P_pick32 H4 q, G% P- B
end/ T3 w9 D; f1 V7 y
r! F0 ]4 P+ v. D7 H( @begin P_pick1 arriving
# b5 H0 Y5 O+ \ set A_i to 1. @# i/ N/ V* [1 S: g
move into Q_induct1
% l- j: X$ \3 X/ x; M+ _/ l move into pickaisle.induct1# t7 V( p) ^4 B2 m& M+ ?
while A_i<=30 do begin
& n: h/ q2 L! |8 z travel to pickaisle.con(A_i)
* h$ O. ^' Q& C5 [5 m: y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 w( i3 \+ L. J$ Q0 J0 E
else wait for 10 sec
& o8 p) e7 Y. S+ p. m ] if A_i=A_leave then send to die! r2 b( S6 ?# P6 q/ K# N
else inc A_i by 1' A/ H7 |: a" Q" X
end; R b' e& v6 x. h: @) M
end4 k; Q+ f0 k% k2 c$ w
A5 e" I Q2 r/ Y( ~. |, w2 b
begin P_pick2 arriving
' x8 H4 Y7 c3 R+ V set A_i to 11
. U( B) \; T5 _! ]+ n move into Q_induct2 M* r3 H' B( A4 \: i, B' g5 N. W3 l
move into pickaisle.induct2
& ]3 d* i) I7 \ while A_i<=30 do begin
& G' y& s. U8 W; w5 e travel to pickaisle.con(A_i)
+ G" b( P0 S% r8 F# O& L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 E% v, h3 c) m; @2 ~ else wait for 10 sec
6 J( l# x$ \! f( I/ m" l if A_i=A_leave then send to die
7 ]0 l M9 _& h/ q else inc A_i by 15 y" B6 ^+ ^# L, |3 t" W
end. U6 ]/ m5 e2 T
end m# R+ q- i/ [3 R
: K% P3 ~1 c: O; M8 R" |begin P_pick3 arriving
# f) J; K2 b+ ^8 I! Q) n set A_i to 21) k" K; N1 p' s+ j: e9 q
move into Q_induct3
% y5 F& ?. a- C. A9 y move into pickaisle.induct3 w, E' h1 c7 h0 j( H8 U+ |- g% r
while A_i<=30 do begin" Q; g. s: z0 u
travel to pickaisle.con(A_i)2 f& f* t9 I3 |: R. K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" `& u4 H# x3 Y6 ? else wait for 10 sec
3 \; c. {% k) D' m) F if A_i=A_leave then send to die$ c7 q0 A1 |2 t' ^
else inc A_i by 1
6 o; ?! x( y" Z1 N8 L0 @1 h% Y end
" C& R% S: m2 N5 ]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,其它按你的 ...
|