|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& t8 r5 T7 |* C8 B/ J* _. V7 t% X7 R5 Q5 J
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) e3 @. {$ ]3 I( g- f
$ F, Z) o. G; E0 @( Z# \ m& R `begin P_read arriving7 _/ I% w1 x3 ]+ @4 j
while 1=1 do begin) B: j" c$ i7 L8 N
read A_tote from "data.txt" with delimiter "\n"+ t7 H6 O* X( C ?
read A_time from "data.txt" with delimiter "\n"
. y9 `. K- c5 [/ Y5 j read A_leave from "data.txt" with delimiter "\n"4 W/ J& J1 L# n
read A_picks from "data.txt" with delimiter "\n"
2 i7 E( o! q' w: x' H3 ~& N set load type to A_tote
7 u, p* [+ F( J: C* l if A_tote="tote 1" then set A_induct to 1
0 s _. a; s& T6 b else if A_tote="tote 2" then set A_induct to 2
+ D5 [( M6 W7 a0 F* E else set A_induct to 3 / @, I9 [* w; ^5 I
set A_i to 0( P* D( S, [4 l% q- L+ Q) |4 x
clone 1 load to P_induction. u8 x8 X l7 c, @
wait for A_time sec* L8 N5 c. Y& R; F. ]: H/ D b
end
: `+ r3 \, J; J4 b/ {end5 ? f6 n% A% r9 X9 L# x
$ d8 C1 P3 @ Z6 y: U3 w) L
begin P_induction arriving1 L z6 A1 l# i
if A_induct=1 then clone 1 load to P_pick1
' c( U$ n7 @9 Z e% G# Z else if A_induct=2 then clone 1 load to P_pick2
: k1 e6 b5 { q$ i# y else clone 1 load to P_pick3" y4 W; K3 q' `9 B
end4 V& L6 _7 M- x% q9 m/ Q5 H
, T3 g2 n; A- c1 ^
begin P_pick1 arriving2 E/ m0 K0 ^( J' c3 I
set A_i to 1& f4 y/ [- c- v
move into Q_induct1, d( v4 f' F4 u. X. C5 N
move into pickaisle.induct1
I/ ]& D" h; w* p r; ?. h while A_i<=30 do begin9 o2 T' [% J- O4 S- d, t
travel to pickaisle.con(A_i)5 b' ]: ~7 Y9 ?5 `$ N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 D$ \- f6 s4 c# J. D& C0 U5 N
else wait for 10 sec
) z; ~7 j& T/ N) P if A_i=A_leave then send to die
! y: p& T" ~1 b9 a# V+ ` else inc A_i by 1
/ a# z# ]1 c3 b: ]) o end! E8 f6 }6 }% n% e) i/ Q
end$ E+ U' s2 L( W1 D
3 W, U9 g3 |5 J% M( T& pbegin P_pick2 arriving, ~- m5 A* f% [* k& R3 D" d* |3 ^
set A_i to 11. J m5 @3 N. U& \
move into Q_induct2
O# N! g, c! I* V; }" H move into pickaisle.induct2
. A u( U" r# O _$ k' { while A_i<=30 do begin
; z' l& S7 @4 ~ C/ I) O travel to pickaisle.con(A_i)
4 l4 k5 L) F( R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) w7 A4 r+ U+ _& x5 ] e7 C0 K else wait for 10 sec" r9 z9 F* d8 w" d+ G* |& j
if A_i=A_leave then send to die F; x- }8 n* X; c1 w" ]' q4 h
else inc A_i by 13 I" y9 ~: p7 i# d2 t& s$ C
end
2 n& s# g; S! f; h( Gend- }. k4 T! \! `$ `8 a4 W2 c' r! R* t
4 }! S/ n* e6 t6 u: Vbegin P_pick3 arriving* E3 A' q9 l) l, b: V4 Q0 t
set A_i to 21; {# q' S4 a# R" A+ g5 V* G
move into Q_induct3
+ x m: b0 N3 F7 q6 A4 x* W move into pickaisle.induct35 E* f3 n. f0 n. S
while A_i<=30 do begin
, h9 t; S' U( h5 O0 [ travel to pickaisle.con(A_i) ~: z% _( [- M/ r* R8 K& N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 b2 {: M4 U9 g) l else wait for 10 sec# Q% |& y2 q3 F b
if A_i=A_leave then send to die
/ y6 w. N+ S! e g* q else inc A_i by 1
( H ]! [7 I$ k end2 o1 ?3 S, r) m4 m6 z0 G
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,其它按你的 ...
|