|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ \/ a" l" Q; K: D4 e& P* K
' T0 U5 P) \+ U' ]我的问题是,在每个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 _: F5 @6 y' y9 ?. h9 p# T$ e6 |, K* V# S9 S5 M2 ]+ |1 `- U. G
begin P_read arriving( y) T7 H% q8 [4 ]
while 1=1 do begin
- ?4 \/ L/ i. Z8 J- t0 i; p2 Z read A_tote from "data.txt" with delimiter "\n"
: b7 p* C5 T" [/ k2 F read A_time from "data.txt" with delimiter "\n"
, V/ B q4 j; l ]9 F- A read A_leave from "data.txt" with delimiter "\n"+ x \( u$ v1 L- A0 q
read A_picks from "data.txt" with delimiter "\n"
& n- G2 V* J, K1 @( I! t& N. E0 O2 b2 n set load type to A_tote
" t/ L4 s! B2 {& s) ~ if A_tote="tote 1" then set A_induct to 1
; z, @$ y' _) C3 g4 {$ T0 P else if A_tote="tote 2" then set A_induct to 2
+ ?" [5 A8 J8 w7 f( @8 C else set A_induct to 3 4 S+ y; i3 `+ K
set A_i to 0! Q% e' I& k; c
clone 1 load to P_induction# ?# L s7 q) B: f; J# z
wait for A_time sec4 ?1 @2 {, b) z2 E6 z* g8 J5 a v
end& m4 c$ e. R! c h3 i) \7 d
end
" t6 _4 j) j7 J/ q4 j% X% Q6 o, _0 b- O6 L$ i
begin P_induction arriving
% \( O& }+ g. k/ X- K if A_induct=1 then clone 1 load to P_pick1, C$ e7 i7 ~" }
else if A_induct=2 then clone 1 load to P_pick2! j R* T2 d0 W
else clone 1 load to P_pick3
Q/ f, p( D1 D5 hend
7 W; l' m7 \# Z. `8 \5 Z$ x8 i& [& |/ s4 b0 i1 f- v
begin P_pick1 arriving( {3 w6 T+ @1 i) U- s* [+ |$ r
set A_i to 1
% }8 W* u+ ]( \7 m" ~3 ~ move into Q_induct1; k. M7 h, C5 @* v4 `
move into pickaisle.induct1
- I/ y0 m( ^! S* o- C: T5 D' R& q; ?( H while A_i<=30 do begin
) R' u2 {/ g+ C/ R/ S" _5 C; b travel to pickaisle.con(A_i)
) L: H/ d! a. Q0 a0 G+ |( h6 C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 p8 Q2 n9 p. [/ P7 w else wait for 10 sec
) U9 V8 c8 }2 k8 X/ B4 c) B if A_i=A_leave then send to die8 l# M; @0 `2 U
else inc A_i by 1
' A+ V! q ^6 f; |: S9 D end9 p6 P/ l" |+ R0 ?% o
end! D* o, _/ ?% a! C, I& L6 {/ V
$ M( D5 I/ |: I2 j# P2 Y3 G
begin P_pick2 arriving, W/ I* e* u! [( o1 |' o
set A_i to 111 d! Y n! {6 O; s# Q+ n
move into Q_induct2! j% g) S d' m6 ~# D
move into pickaisle.induct2
$ @, S* `8 [, f) k# W" I& k while A_i<=30 do begin
: w. _- S, H0 i& Q. ]& E P travel to pickaisle.con(A_i)1 a' y; j+ R! v( Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 k* w. ^ z- i/ } else wait for 10 sec
5 z0 {9 c' h7 ]. ?8 N if A_i=A_leave then send to die
6 D9 T+ s' t K r: M6 \ else inc A_i by 1
- f5 x% L4 T" A2 }- Z- w$ V end) g5 K* W5 @9 w# J
end
5 C4 b9 P% @: {7 Y4 ], c' F! T" q: p9 m' v
begin P_pick3 arriving3 D% z8 l2 q& W1 A* K) M
set A_i to 215 r1 F7 @: q# Q8 r
move into Q_induct3
6 l, g4 x" U5 P6 F move into pickaisle.induct3# V9 K* R7 E: S8 K: \1 |, k
while A_i<=30 do begin
! G' c. m/ Q8 ]0 f* R) l travel to pickaisle.con(A_i)
! Q1 U! T0 l# v) M$ U% Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 N+ k V$ M9 c% F6 N! X
else wait for 10 sec
* G G- E1 E0 z7 g' z6 n! a if A_i=A_leave then send to die
$ X1 n# w$ U' v9 Z6 j else inc A_i by 1
4 N6 U+ ~$ G0 A* ^7 l }' \# Z end
- u/ \: b$ K3 u$ V4 G/ x+ Aend |
最佳答案
查看完整内容
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,其它按你的 ...
|