|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% U+ j; u% M: ]- Z ~& J
+ M/ F1 ]+ X+ ^, G9 H
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 h2 K* e) E5 g6 Q/ n, B
: r" z. M8 `# xbegin P_read arriving! L/ r2 J7 ~$ A% Z" q, F
while 1=1 do begin
9 S Q5 \+ @+ o2 @ read A_tote from "data.txt" with delimiter "\n"
; d6 f9 `- X6 q F3 [: g read A_time from "data.txt" with delimiter "\n"7 N7 V/ Q _# o) z' m& K
read A_leave from "data.txt" with delimiter "\n"; e5 M z/ U1 u9 X% S2 q
read A_picks from "data.txt" with delimiter "\n"
4 Q* J. v/ n/ I9 t; X4 S; e set load type to A_tote
q/ X# l, w% i8 |# H8 N if A_tote="tote 1" then set A_induct to 1; l, ?/ E" {! f7 C
else if A_tote="tote 2" then set A_induct to 2
% L' Q1 ]- _$ b4 Z else set A_induct to 3
3 K! V5 W& k- Q set A_i to 09 k: S0 q& ^2 Y9 C; y8 t
clone 1 load to P_induction
. {5 q6 g- [' K: G) q; p wait for A_time sec
& Z5 G4 E: v9 p# T. R& u& e! k# K end" D, a! e P* x2 }0 N/ Y4 ?
end
% W" Y! P; V" ]3 @! E2 q" M3 F9 x3 @
begin P_induction arriving, T5 C, j& n j3 K. Y
if A_induct=1 then clone 1 load to P_pick1
9 m$ E7 F1 [4 m# t# D. A) ^ else if A_induct=2 then clone 1 load to P_pick2' r/ {; d" [7 ~5 E' V: s) i$ M: n
else clone 1 load to P_pick34 V! A/ q/ |' g2 Q, W# w
end1 @, I+ c$ y+ F5 q' o. @' A1 V$ t
+ y6 Q7 J) A8 A; n! b$ A5 g% tbegin P_pick1 arriving: G) K2 w% Y: k
set A_i to 1" X" N4 [) \9 s( }( ?
move into Q_induct1
8 }5 d+ [7 p( f8 f( \5 I" a3 W move into pickaisle.induct1
t! m5 Y6 Z1 b! A! r) ` while A_i<=30 do begin1 `+ k$ v7 @$ b) @' m% s- z/ n) j
travel to pickaisle.con(A_i)
5 \, }8 l9 _6 c5 O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec P4 x) Z1 S: @# j% H* U( i% h
else wait for 10 sec
+ b0 o! E q k if A_i=A_leave then send to die
! N! u: v2 r( u4 V- u else inc A_i by 1
& z5 s( o6 m, R$ J% S7 }) i4 E end
) o5 |/ {1 a9 K, a. ~) Y9 p) V1 [end
1 l7 V' \) B( H# Z) U
# h# q' d2 i- f: q( r3 y1 Cbegin P_pick2 arriving3 U; N+ Q5 k; |
set A_i to 110 Q- `' x' d# d/ J8 f9 h( A
move into Q_induct2
! D( ]0 e8 K; E7 }) o move into pickaisle.induct2
' x. \( X: J* u* E& j% S while A_i<=30 do begin0 e1 t/ o _% i) D) g; J L; G* M o
travel to pickaisle.con(A_i)
! O3 H4 ~! a9 h( ?+ z' k# t( s if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& D, s* [4 x- J& i# w5 G7 q
else wait for 10 sec; e7 N: {+ S( A/ o+ ~: P$ v
if A_i=A_leave then send to die9 n! j9 D% M* W5 w& o7 y
else inc A_i by 1
/ P+ l4 y7 `2 @$ v: p end6 Y/ n3 a; N0 }; P
end$ X- [7 t& f! J. V6 |0 W+ t( M: ?
9 j- d$ [1 X! s8 C% J+ P
begin P_pick3 arriving
9 [& n4 \0 T, m" n set A_i to 21! o/ ?: p5 W# I6 c
move into Q_induct3! d2 p& L. \+ H/ t3 F0 [
move into pickaisle.induct3
! Y# ~7 c2 @1 c while A_i<=30 do begin3 G4 Z/ s- h9 E0 b4 I& Q, k
travel to pickaisle.con(A_i)
0 z+ u/ q! u: l/ l$ q7 h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: p7 i1 B) D/ Q( T7 D, J
else wait for 10 sec Z8 w: i* L$ ^
if A_i=A_leave then send to die
$ J8 V: }9 c$ T$ G1 V2 E else inc A_i by 1
9 T, ^% g6 [% n& F( @ end
* P! y+ |6 x! `. U7 dend |
最佳答案
查看完整内容
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,其它按你的 ...
|