|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
d4 r E, q8 H; Z) J3 n9 k
" [& V6 R' Q- I; t6 g我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, E) P& y y( ~
' B( J' F3 q% k6 A4 n+ tbegin P_read arriving
' M4 ]5 v2 l4 ?. ?$ ]' c3 b& C1 ? while 1=1 do begin
& ~$ h( w/ @4 F' S. O2 R0 r$ l* h read A_tote from "data.txt" with delimiter "\n"! t0 |( {# o1 N) Y0 e
read A_time from "data.txt" with delimiter "\n"
0 V. i5 n% ?) Y; ]! r4 @, W read A_leave from "data.txt" with delimiter "\n"4 O1 F6 v9 u# P3 `
read A_picks from "data.txt" with delimiter "\n"- g, {. {& S' r5 W& v. w; R. T
set load type to A_tote
& x" h; T- B6 O1 o) R( q! z if A_tote="tote 1" then set A_induct to 18 a8 K s! P; c1 Z3 E6 y
else if A_tote="tote 2" then set A_induct to 20 `- _9 c) ~# G2 C9 z' J! a
else set A_induct to 3 6 T# B9 A5 h& ?
set A_i to 0
. h4 L& }, I) D" ]: ~ i: ] clone 1 load to P_induction
: Y0 Q; R9 Z! M& h2 |: K wait for A_time sec" v5 ]/ R, t* p% K7 f
end
2 p. K, c$ }- k5 ^end
. Y* z/ g* P7 A* ]2 X
~7 I& v% V; `begin P_induction arriving0 [0 _+ L5 \- C! J$ E9 h
if A_induct=1 then clone 1 load to P_pick1
7 M) L1 B2 n1 Q5 W7 o9 j3 r6 x. A3 q else if A_induct=2 then clone 1 load to P_pick28 M% c9 b7 a( ^9 E% q& @: D
else clone 1 load to P_pick3& y& S" U5 z8 a
end
w* _# P% Q, H' Z$ w. q6 ~' s: P9 V% i+ u6 S8 j4 q9 n" H
begin P_pick1 arriving
; o+ ^% V9 {! o E1 a$ S set A_i to 1
: I3 I1 O+ p) K- k% n) H! j move into Q_induct1
" S9 y* K9 G2 z$ E, I' _* N% f- B move into pickaisle.induct1
0 c) n" R! U/ u; L while A_i<=30 do begin
. u% z& O- @8 | travel to pickaisle.con(A_i)
' X' Y& |& ?* z4 _ g( v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 p+ H* n; {1 f1 g
else wait for 10 sec
; |4 s/ D$ y. D8 K if A_i=A_leave then send to die
' I/ p6 L9 d/ X# ?9 ^ else inc A_i by 1. }) {1 y! z2 T+ ]: }4 t+ H
end
% ]' A0 O' v8 }4 `end7 E2 H( N* a+ @$ I7 f; g
$ _% a- } N/ Z" G( I9 i Hbegin P_pick2 arriving
. @' O$ v7 a! N set A_i to 11
+ u+ A1 M# \! ^4 z( ? move into Q_induct2& |/ F/ F& y" H
move into pickaisle.induct2/ v' |* W Q! U6 S4 p+ W- k
while A_i<=30 do begin9 m, g( I9 d, q- Z
travel to pickaisle.con(A_i)
9 b) ]# e0 J5 k' l2 {: J% w: {3 n+ y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, v2 d" L$ |$ H2 d. r3 E; w" w else wait for 10 sec& d' ~) k) B8 _4 m/ k
if A_i=A_leave then send to die0 @1 D3 D) W; G! K& k$ v. e U
else inc A_i by 1
; x! H7 F0 j8 G$ R, `8 \ end
" W& {+ d+ @% w5 n. E: zend8 k& F$ j2 h6 g" P/ [
6 E2 T; W, X @begin P_pick3 arriving
1 n) f" h! j' w$ D) n+ n3 j set A_i to 21/ B2 H( d2 v- u: p: h7 l
move into Q_induct3
: [" C+ m! y _6 C S& v* X X0 y: j move into pickaisle.induct3. `/ {5 a4 ` |% H, I
while A_i<=30 do begin
6 y! v8 X7 M2 B# g% ?9 R1 d, o travel to pickaisle.con(A_i)6 I0 ?0 b! C a1 [ X. q! w' r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! [: p0 ]7 I( M( i3 H8 V: U' h' w( o
else wait for 10 sec
1 k5 q% u+ |& E7 v0 w if A_i=A_leave then send to die4 b" J, e' F. m( A2 [
else inc A_i by 19 F6 T0 x. f- l2 H/ ?
end7 b7 V* h9 O' v, S
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,其它按你的 ...
|