|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 v5 `: u/ r) |6 l, F, T# g
, L, G, G0 F6 L- N) F- K
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. }( |% _3 u8 H5 f& ?5 N4 i
4 T; j3 ^; ^! S6 e$ ~' f9 Gbegin P_read arriving
, f( b" j$ D# b5 D" ? while 1=1 do begin
' ]+ m5 s) h3 Y6 F7 t read A_tote from "data.txt" with delimiter "\n"
: S" t7 M1 ]: r3 H$ ~1 j read A_time from "data.txt" with delimiter "\n"
4 V3 ?, e0 X9 M+ T9 {2 ?4 f) m; F read A_leave from "data.txt" with delimiter "\n"
. K0 Y9 q4 E: z9 e- J- E1 V read A_picks from "data.txt" with delimiter "\n"
/ O0 n9 e. u, _( V, b set load type to A_tote9 w; F4 A* B4 O6 q: r% J
if A_tote="tote 1" then set A_induct to 1 _% M" F1 a" i4 S1 ]
else if A_tote="tote 2" then set A_induct to 2) x: y& D, o; Z. N( o; A$ K
else set A_induct to 3 8 T& I& g0 W9 N- e7 q$ D" o
set A_i to 0
( X3 Q1 l- i! R clone 1 load to P_induction- E+ y0 I1 J3 @2 V6 D3 ?
wait for A_time sec
' q/ E) e. H3 E9 ?. U: m end
: d$ v) {* \( z4 K: yend, G. {1 w' [5 h$ m" n" H; W
& H2 S* f5 K+ \0 X: M" d0 Ibegin P_induction arriving
6 f. V, G2 W. @# H' Q if A_induct=1 then clone 1 load to P_pick1
; U U9 j. S0 N5 R g else if A_induct=2 then clone 1 load to P_pick2. w7 B' c( ~6 h& v
else clone 1 load to P_pick3) i! }. i& {& C; z4 c* _, Y
end9 p$ N% [" g4 I; f% u' h# k
" |6 ~. G$ X6 w2 \$ `; I/ m9 [
begin P_pick1 arriving
3 x; y, G' q) C/ U4 | set A_i to 14 o1 ~- J, f2 y4 D, v
move into Q_induct1
K7 u1 a9 M( C; ~ move into pickaisle.induct1# g1 Y Y) I$ V. z; x2 ~0 L) I9 M, }
while A_i<=30 do begin6 ^( d1 [; ]2 ~8 [4 }
travel to pickaisle.con(A_i)$ |- l+ y/ P) @+ a' c/ ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# e* P: C9 S ?4 L5 R
else wait for 10 sec* H8 X' A- a4 A9 o7 x+ ^
if A_i=A_leave then send to die
# X. D$ G, c* G; n8 @3 y else inc A_i by 1
& e6 V. u& p' s$ i8 |6 w end" U3 M) _0 I+ s% Z& K) Q/ W
end
! _; ~: H6 p+ l- I6 t9 U G5 { a
begin P_pick2 arriving
( h' U% \" I: V7 x set A_i to 111 s& Y% u+ ^0 [) q8 } U
move into Q_induct2
/ O& x; [, j; u+ z q7 b2 ` j: M move into pickaisle.induct2) R* F: W) ?" @* `1 A3 ~- J
while A_i<=30 do begin2 f$ P# z" n1 R$ |$ K/ I
travel to pickaisle.con(A_i)
" |$ n& U1 m: r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 p' F. A4 U1 q2 h8 V( a
else wait for 10 sec
; g/ c0 J1 D c if A_i=A_leave then send to die2 r$ c1 G; M) n7 r, B
else inc A_i by 19 A4 A, m7 `. C& w
end
/ F2 z" X+ L3 fend& g5 J @) J! X/ p3 n9 }
8 [& H- q4 h2 }7 E
begin P_pick3 arriving/ n, S* K) F+ L" ^# G! v
set A_i to 217 t4 X1 @4 o S& O7 _! `
move into Q_induct37 s9 h$ E4 K3 z$ Q0 y7 b
move into pickaisle.induct35 ?8 v4 `4 \% }9 v2 ]
while A_i<=30 do begin6 Q% I, w& |+ R9 `% _ L
travel to pickaisle.con(A_i)
: D5 ^5 e7 h8 W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' y; O- Y* _1 V. C: Q3 p" f, J$ e
else wait for 10 sec
, v: _* q! T1 _. Y# o6 U* I* X if A_i=A_leave then send to die
/ P: `; |( I5 k/ j else inc A_i by 1
7 I& Q; P s) q( P9 h4 T7 j end
+ j+ G! {" |; l) V( qend |
最佳答案
查看完整内容
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,其它按你的 ...
|