|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- Q: q" w. V: q. S8 ~* I
$ y1 t; U, i$ J$ F o我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 z) s6 D' B" e' C/ x! L. X/ U5 e9 ]8 c% R
begin P_read arriving
7 s ^- q" c( B: H l while 1=1 do begin
0 ]. d# X- o4 V Q' I5 E read A_tote from "data.txt" with delimiter "\n"* k8 q' u" U+ A
read A_time from "data.txt" with delimiter "\n"& h) P. v, j( \3 I4 Q" |
read A_leave from "data.txt" with delimiter "\n"3 q; Q- ]7 B$ F$ @+ {6 q
read A_picks from "data.txt" with delimiter "\n" c+ T! n( i2 n1 }$ o) \5 _
set load type to A_tote+ Q; y3 }/ H, d+ G
if A_tote="tote 1" then set A_induct to 1
- Q$ o$ K$ x3 q, w6 j8 O. [ else if A_tote="tote 2" then set A_induct to 2+ H* U# F" ~6 ]$ s
else set A_induct to 3
9 u8 |3 y5 S$ _2 E5 ?& A set A_i to 0* e* G& B0 N4 q' [2 A' S6 Y5 W
clone 1 load to P_induction
0 R" J3 K- O5 X5 D# V7 Z& N wait for A_time sec' w! r4 c9 ?$ S/ s. M$ L p
end
' U5 w4 K) z7 c. Y: nend% I. F/ e+ c0 d, q) ]
6 i' r4 E: r! n: N7 s7 T9 wbegin P_induction arriving
% k1 y: l7 E% E if A_induct=1 then clone 1 load to P_pick14 | E& C5 b9 Y3 n/ A. C4 v
else if A_induct=2 then clone 1 load to P_pick2
! q! a9 S: Q* d$ {7 c0 d else clone 1 load to P_pick3/ S+ L2 J7 l& H/ q
end
8 a; ~. ~" I' B4 c% J% `1 e: p4 h8 `) k4 K. Q
begin P_pick1 arriving
9 b( b: s) l, j+ k6 u set A_i to 1, N) j+ b) E+ c! z
move into Q_induct14 L* H! S: P- d9 L' O9 F8 }& o8 l
move into pickaisle.induct1! R1 e* V W7 _6 E) W- e. ]( s
while A_i<=30 do begin
' K( U" X8 _! S5 @ travel to pickaisle.con(A_i)+ U" t- ~# l1 ^/ l8 z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 N( z a, |/ S' o else wait for 10 sec0 z) E" y7 J0 @2 C7 }! m4 X% T% h
if A_i=A_leave then send to die
( a% u+ ~- L* g1 M! K3 A else inc A_i by 1
5 l$ K0 q/ R0 E end
9 I9 M# [8 P; D; C! P4 N5 Cend
. p6 X$ b3 N- `8 c$ A6 b7 h! W3 h* t4 Y# O3 i9 e) B- c! G8 t- i
begin P_pick2 arriving
% U3 _6 P+ k+ Y9 ^: {: [ set A_i to 11
, D7 ]( t7 x' G move into Q_induct22 C5 }% X4 k) Y: F5 ~( _# O
move into pickaisle.induct25 N ~/ U0 @$ ?- z; v7 R
while A_i<=30 do begin
; B( ]% S5 h/ ~- k! B travel to pickaisle.con(A_i)4 D0 |5 O8 S7 P4 J8 i" B3 p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; f* s( \) D3 n, [ t else wait for 10 sec! ]0 E! O' P: [0 j; d
if A_i=A_leave then send to die
3 S! J2 x, E) R6 k else inc A_i by 1+ t3 |! F! Q" @% Z
end) N) F7 q |/ q3 {* G: L# l
end
) p7 a. O) L( I& ?$ o
6 T6 P* X9 I& w2 u ]! tbegin P_pick3 arriving
3 ^, C9 L/ H; i8 a( R' o- ^6 K set A_i to 21. J4 O5 c1 a+ _
move into Q_induct3
, p) I+ n+ p4 o- J& x9 n' V: K4 L0 T move into pickaisle.induct3
. r1 R5 X; r8 _# H- q while A_i<=30 do begin a/ F) V" Q& l. D" _1 _* Y, d
travel to pickaisle.con(A_i)8 \/ D u, z$ P) Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' D6 E- X# ]+ f$ A5 f0 I8 _
else wait for 10 sec4 P/ M! y7 x) E* u3 S" Q ^% t8 J
if A_i=A_leave then send to die
9 U- u, W$ r1 y$ q$ \% v else inc A_i by 1
7 F- |$ j h, ?+ L, p d8 ]2 ]5 a end0 ^- _! U+ O. h( L! a$ ^0 x
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,其它按你的 ...
|