|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& z8 a. O3 Z8 E s# ]
g1 a. k5 J/ f' J/ K M; n E我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 n, D$ B2 J) u$ K
& ?" G( m5 a1 M$ w% T4 x+ T1 ]7 Qbegin P_read arriving
7 x8 n0 @* s! d5 F- ` while 1=1 do begin
: r5 o# v, E! r6 r3 c5 W4 K* d read A_tote from "data.txt" with delimiter "\n"- D6 |+ R* N1 F4 J
read A_time from "data.txt" with delimiter "\n"4 Q/ X9 M& _; J% ~
read A_leave from "data.txt" with delimiter "\n"
& D$ o- h% N0 ~+ V3 g$ N read A_picks from "data.txt" with delimiter "\n"
: h* R; E- ^/ t3 B# } set load type to A_tote% A! d, n% l, o; C0 v' J
if A_tote="tote 1" then set A_induct to 1% ^# f- S3 E7 x1 y! Z
else if A_tote="tote 2" then set A_induct to 2
# J& @# \( ~% Y9 h0 I( z1 y' R else set A_induct to 3 ) [# b" g _/ [* c* ^0 u
set A_i to 0
0 s# \8 k. Q! q- H8 ~& e4 j7 P* } clone 1 load to P_induction
G& ?1 X# H* T. v7 P wait for A_time sec
) W6 |0 c* }( Q end
- o' B3 @4 {# j7 Y: b+ b$ Tend- l# m D1 h* b( D0 m" ]8 S- o
& i4 O4 K4 Q! i; D1 u
begin P_induction arriving7 g* m a$ b2 Z F& G# c/ I! P& Z$ H f
if A_induct=1 then clone 1 load to P_pick1
7 p) ~- h" b/ v( p else if A_induct=2 then clone 1 load to P_pick2
+ e2 f% }- f! y) g* f5 \ else clone 1 load to P_pick3" x8 {$ R- l* n
end; c7 N" U! N" Q8 `$ V, Q/ @
& N: B8 y5 L7 b$ y: q7 @
begin P_pick1 arriving8 {5 w9 @2 B. Q+ T
set A_i to 1
+ M+ ^; n* d! m2 } move into Q_induct1* N q( X* H, G, U- ]1 C
move into pickaisle.induct1! \' T$ K! w/ W! x4 o" O
while A_i<=30 do begin
f. J7 W- I x$ b j travel to pickaisle.con(A_i)6 Y8 C- V" d1 h2 d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 P5 t/ Y+ ~5 T0 k% P2 T else wait for 10 sec6 q x2 s* ^- p7 e$ ]7 S
if A_i=A_leave then send to die* ]% [- S, J) W7 y. w
else inc A_i by 1# Q u7 D% @7 E$ |3 F) N* n1 z. N
end
7 |' c; o" j+ m, C# Cend
" u8 T1 Y$ n- C5 w5 A# b9 u% @
begin P_pick2 arriving
1 u o" ^+ z* f/ U set A_i to 11! v4 E; ]( b9 C9 C* g
move into Q_induct29 P# r% U( k: n
move into pickaisle.induct2. a/ R f; M( o0 v
while A_i<=30 do begin6 H1 ~! X" |8 O3 v: Y p2 W
travel to pickaisle.con(A_i), w2 G4 y' Y% t+ L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# i4 ^/ a! _* N! \8 D8 L# k! P
else wait for 10 sec7 F3 F4 i' u3 r7 N/ i# G) G
if A_i=A_leave then send to die: {: R q. E5 s' p! L) o
else inc A_i by 1
9 q" e/ F9 H4 f1 }* j, {" P end- E0 l: k$ F" w6 i) T) L
end8 {/ ^3 F3 ~3 G# ~' K( f1 k2 C5 n
4 L- Z9 e: ]! I Rbegin P_pick3 arriving
3 v; c! i4 v! G! L- H, D- x set A_i to 21: u, n" O: ]0 q5 a
move into Q_induct3+ I a L% C4 n9 |, K2 m" j8 `* q
move into pickaisle.induct32 S# D8 [9 ], S1 I
while A_i<=30 do begin
+ D5 j# D P* ]' h: [+ H travel to pickaisle.con(A_i)# C" x/ L0 a% u; H, k+ W0 Z$ b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 F) J! h# |4 a$ r& ~
else wait for 10 sec7 M; P4 R$ Z/ R* M4 e' `/ _
if A_i=A_leave then send to die
6 h- c, U z z# o else inc A_i by 1
, |5 y& T/ Z; O! M+ l: U' i end; s- `4 t1 l1 ~* d6 D
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,其它按你的 ...
|