|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( q3 Q; x. \6 W& X) k
( B2 H7 W# i! d, ]
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' \' o: `; I7 q# H9 o+ M+ \
( P, ^8 a3 T% Xbegin P_read arriving
: z; o. V, ^( p while 1=1 do begin
2 i# g# f. |+ ]9 t read A_tote from "data.txt" with delimiter "\n"
( l3 z' g$ `! p5 Q$ w A- p6 [! { read A_time from "data.txt" with delimiter "\n"& E- N* R, p" _3 ^. W2 }: z
read A_leave from "data.txt" with delimiter "\n"$ w( x' p/ L& q% l9 l9 b/ Y
read A_picks from "data.txt" with delimiter "\n"; X5 z+ i. S, r3 f. `
set load type to A_tote
" n8 l2 S* ?1 b( [ if A_tote="tote 1" then set A_induct to 1 z* D' A1 B4 N2 t
else if A_tote="tote 2" then set A_induct to 2
0 h1 x) v' B C$ m; Y else set A_induct to 3 # G+ i2 \$ J8 E; J
set A_i to 0
- @$ Y% @' W1 k$ F$ ?) g7 j clone 1 load to P_induction
+ {* J" V$ i/ H/ b wait for A_time sec* u9 s V4 Q) T2 g/ B
end
6 p) H7 O/ T" R$ T0 b$ Q. k Send; h3 Q+ c* t" k G2 C
! J# Z* P v& y1 F" b& Dbegin P_induction arriving
5 g" b8 x) t3 @ if A_induct=1 then clone 1 load to P_pick1) W' Y3 c+ Y6 [/ @2 c7 U
else if A_induct=2 then clone 1 load to P_pick2
' s/ P7 J1 ]2 P6 f, `$ p else clone 1 load to P_pick3
/ m3 N7 ^5 s8 D: R& i1 jend
1 T7 E9 m; S p. b& _$ Y" w0 C3 N6 S$ A0 h' H
begin P_pick1 arriving
# u7 @8 o# D# Q' U; B0 y set A_i to 1. {; c! K+ U( N. d5 Z
move into Q_induct1( E( B/ ], }3 K- x
move into pickaisle.induct10 @4 z' u/ ^ U3 a- c2 Y& G
while A_i<=30 do begin
8 u+ @1 C8 _' W p2 Y travel to pickaisle.con(A_i)( w1 U3 l$ \2 x7 `# [+ y# U9 P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 T9 i& k0 {3 C8 M% J+ [6 u
else wait for 10 sec
7 Y% c4 m. n. n; L if A_i=A_leave then send to die
) }$ R! o5 z$ J8 y a* | else inc A_i by 1
4 k; f6 `! Q7 R2 t0 u3 { end
% p/ G/ Z9 [. t7 k7 Eend' j; H8 F- d4 ?$ ]5 \& m+ d
* P: N' a) W \/ k i. u1 Abegin P_pick2 arriving% n: [3 V- q+ M: ]
set A_i to 11; _+ i0 `3 P4 i4 y$ F& S S
move into Q_induct2
8 o% X' j2 I0 D; E move into pickaisle.induct2$ A; D- g' X" e: o$ T1 }2 y3 v
while A_i<=30 do begin% b2 h6 ^3 b8 ^& n4 Y i
travel to pickaisle.con(A_i)2 Q0 ?3 O& @9 b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: z0 ?1 a. w+ F
else wait for 10 sec' O5 R5 L9 X* J# ? b, h2 s: \) ]
if A_i=A_leave then send to die' E4 K- p% K3 ^9 ~. j
else inc A_i by 1$ i! A6 w& t5 ^7 Y- i0 P
end
& P: B2 I8 t: @" G, o5 Z, S' lend
. {( F7 o. F) E5 H& v0 {& l% S7 i% u: Y8 O8 t4 E: l+ Q- S
begin P_pick3 arriving4 d. k" o* G5 @! b0 i
set A_i to 218 f0 g5 Q- p8 v4 ]* i, P1 H4 U4 e2 ~6 H
move into Q_induct3
, S5 I$ I2 N( A+ @+ g move into pickaisle.induct3
; h/ c P h5 s; G while A_i<=30 do begin! e4 Y9 K8 D9 T5 ^$ Y
travel to pickaisle.con(A_i)
5 @% R, |* W3 Q! N" @$ o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: X+ a7 F* Z, T2 l2 n
else wait for 10 sec4 P& R( M# W+ l0 x
if A_i=A_leave then send to die, u) J) a8 W9 |* H! ]0 `
else inc A_i by 19 l3 o# \2 s$ L7 p
end
4 O( }4 } l7 O S \* T, ~* h" Nend |
最佳答案
查看完整内容
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,其它按你的 ...
|