|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- S* [: S! [4 k7 C) t
$ h' d4 y/ m2 _0 ~, r5 O" C& P我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 O# D: z+ @/ o- a7 x% Y* D
& f, U3 D" J( o+ m4 N% tbegin P_read arriving+ P3 r* E- b9 Q
while 1=1 do begin
) k1 {- w, w0 H$ O# G/ E1 g, U read A_tote from "data.txt" with delimiter "\n"/ y6 X% J0 U$ u/ M
read A_time from "data.txt" with delimiter "\n"
@( W* s/ S" _2 g4 d8 p read A_leave from "data.txt" with delimiter "\n"1 \' R2 x7 ]1 C' J: V
read A_picks from "data.txt" with delimiter "\n": c( Q$ [/ G% N7 w( `* H. o
set load type to A_tote
& v8 r- s/ e, Y* p if A_tote="tote 1" then set A_induct to 19 W. ~$ |: N8 T; N6 P- V: Q9 U% a
else if A_tote="tote 2" then set A_induct to 2$ T# V9 {' K2 U# e
else set A_induct to 3
3 C2 {7 w- `( y6 b8 } set A_i to 0
0 j1 B( U6 k9 J/ l& X clone 1 load to P_induction
- S* b m9 z) ]& @3 N wait for A_time sec
! C7 y4 N# {0 y end8 h. u1 @+ Y/ E9 F4 U; k
end- I& I5 f/ `9 p( U6 K7 y
# {) J& D1 I- ]# _ k8 x1 wbegin P_induction arriving
, H$ t( B# i) d5 X ] if A_induct=1 then clone 1 load to P_pick1# Y; U+ w Q* |2 s
else if A_induct=2 then clone 1 load to P_pick2 k! s! Z5 t2 [+ D" W3 z v9 u
else clone 1 load to P_pick35 Z( k% U# f m3 ~$ s( y9 V- D K' D- H
end
+ ~3 \& x6 a1 T$ c" v1 i" [3 }% p7 g" \4 Q' u( ?
begin P_pick1 arriving" d& G" o% Y4 N' a- F" v6 R/ Q) Y
set A_i to 1
4 S. |6 I) c; b C1 W move into Q_induct1
- Z/ x4 L$ x2 G5 ? move into pickaisle.induct1
8 ^% z% }! t5 x8 L1 ]7 U: q: b6 S while A_i<=30 do begin2 {* p" U) L+ j1 b/ B9 d9 m
travel to pickaisle.con(A_i)' F$ I+ O( e5 n, u* G: m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* g4 s4 Q" p) U1 Z' ]
else wait for 10 sec
4 W7 X) @+ k! @! @$ S if A_i=A_leave then send to die
8 g0 [& ?# E4 }- T j else inc A_i by 1, W( B. F; [$ ]3 o9 @
end
8 ] \/ M; q- x; @6 a( \end! J4 I$ i R! h/ t; D) i0 r# w0 M
! i! j+ r3 q, O# k- I! d& V5 z' ]& |
begin P_pick2 arriving7 S8 K4 f Z) r4 a
set A_i to 11
& }* L- [1 J4 @7 D0 T move into Q_induct2
/ x; s# Z0 ~; ] move into pickaisle.induct2
$ u; R0 E% M1 k) [1 a1 M while A_i<=30 do begin
: M q- z' h: V( V( U5 @7 u7 _( |1 I travel to pickaisle.con(A_i)0 x4 X5 C# I) W4 o: X4 `; q: G* B2 u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ D4 b9 H8 Y' m+ f/ @
else wait for 10 sec) P4 a6 B9 n7 e
if A_i=A_leave then send to die5 e: Q* I0 H! Y3 k1 j8 R
else inc A_i by 1
5 A1 |: ^% o/ ]2 B; w3 U6 q end0 S; H; O# e- F* B+ ]3 [. o2 k3 {
end& D' ?5 f8 t( I- G9 T& g. G$ }. D
. B. ]3 G" U; l& ]; Q) M
begin P_pick3 arriving
5 g J4 W* e( c: S: P set A_i to 21
K! `0 i" q- G H1 J move into Q_induct3
0 P+ L+ I7 ]( Z move into pickaisle.induct3
/ ~% E1 e, ]! ~4 V, f ^* o while A_i<=30 do begin7 j3 j. L6 X4 B- y; p
travel to pickaisle.con(A_i)3 `+ \% x" C& ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- j j$ z0 L! ^6 T, ]& t. y0 w else wait for 10 sec
j0 |* m+ B" V- h& a- K5 l# o. v% s4 S if A_i=A_leave then send to die
: X( Q. Y: |2 b9 @* x6 B# ]6 h else inc A_i by 1
0 y" [$ W2 x5 Q0 y7 h f& J end
+ i$ B8 s; ]1 Eend |
最佳答案
查看完整内容
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,其它按你的 ...
|