|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- f, h1 w" Q$ @2 ]2 A
) y, Z4 }% J2 @5 p% I& y" }3 P* R
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, Y! f6 U3 C$ X" V# |) Q0 O
5 t( T w- b' a4 K3 W$ u5 b wbegin P_read arriving
7 d' k7 D' O- S, C' d3 m! n3 A8 `4 W while 1=1 do begin$ ^* D3 {$ X! a" i: V6 H
read A_tote from "data.txt" with delimiter "\n"
/ z2 d4 t) C. f- Z* ]8 b0 R& ~ read A_time from "data.txt" with delimiter "\n"7 P# P4 ]" B4 w. k
read A_leave from "data.txt" with delimiter "\n"
/ p1 a' \/ ^# \. [: K read A_picks from "data.txt" with delimiter "\n"
! ~7 i4 V- o! Z" D. ^" h set load type to A_tote
' s9 _* B& G8 w7 _) q/ w if A_tote="tote 1" then set A_induct to 1( G# E& ]/ T; @/ C) B% `- M
else if A_tote="tote 2" then set A_induct to 2
% [+ a( N1 _2 K; b& \4 P else set A_induct to 3
5 T. x$ j) P1 k+ t set A_i to 08 R& p, C6 p! o6 s2 V
clone 1 load to P_induction3 u8 s7 |! L7 P; l% y. ]
wait for A_time sec3 R0 I* K" L6 ?, e
end
& I0 a( G8 D$ j+ c( Yend9 C- q- W' y! C
0 a% s+ {; P/ h% S! E
begin P_induction arriving8 ^6 U0 T$ u: j8 q7 Y+ a
if A_induct=1 then clone 1 load to P_pick1
' t, K2 T+ v8 B" o! n3 m else if A_induct=2 then clone 1 load to P_pick21 P/ \( G' [1 G2 Q2 {3 C% X
else clone 1 load to P_pick3
& h! y! U8 L1 B3 J3 @. T) x8 Mend
8 S7 J% x+ W( ?# x
3 ^7 ~/ E/ k) a, Xbegin P_pick1 arriving
, L( A1 i* ]% a' t; x) U! i set A_i to 1+ I5 W$ M! R. v; F* q2 k
move into Q_induct1 M. P* A, `1 v! l
move into pickaisle.induct1
8 f" _+ u* W6 {% `, Y+ l" r; h while A_i<=30 do begin: B1 \0 v4 m6 B; p" o& X
travel to pickaisle.con(A_i)
4 J" n; b) }3 o! h! [8 M$ ?! H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: T" O) ?: j% D
else wait for 10 sec
' R4 i: W9 v& T% } A if A_i=A_leave then send to die/ f l$ f" _# {, h5 {. d8 Q
else inc A_i by 15 {- u {: e) s# H- i$ L& \9 B1 g
end3 O- I5 j# P* ?6 h
end6 q8 h, |9 w& I& [" D
) E6 m% j* Z6 j$ D( N' r
begin P_pick2 arriving! d3 |3 Y3 {9 i9 p
set A_i to 11
! W+ v# U& r" @/ B8 B8 n8 w2 x move into Q_induct28 D+ K' u% H! g
move into pickaisle.induct2$ b: w9 O( ~% f O
while A_i<=30 do begin
" v$ }5 @: c; u9 o8 w travel to pickaisle.con(A_i)4 Q5 b# I. C! K* p X" n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) a3 P; ]2 m4 g4 {; } else wait for 10 sec
0 E: S1 w$ m( E0 ? if A_i=A_leave then send to die
& V/ e3 {3 k f" B6 Q else inc A_i by 1
$ _2 V8 Y$ |8 c+ c8 p, B& F end' `$ h6 M4 K0 @" b3 W& }2 [' L# y* y. W
end' X% R7 U) ?2 {3 e" ?, i0 X- o, H
' y" s) G8 f. A9 c5 ^
begin P_pick3 arriving% v: `) ~ Y+ c; }1 R) y9 z, |7 M: |
set A_i to 21
7 N r( ]% Z9 r+ L2 _, Z: b: y move into Q_induct3' m( k* w) s# O4 u' I) z
move into pickaisle.induct3
# z7 z7 d* G- L! p4 `' K while A_i<=30 do begin
' U& Q& A0 e* w2 M! D0 ^1 m travel to pickaisle.con(A_i): l4 G9 R7 {$ j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 t! Q* Z$ S/ K+ W7 m else wait for 10 sec$ s% _* Y/ }: W p7 i$ r" g! l" |" ?
if A_i=A_leave then send to die! [. H0 D0 u; r' i' v: o4 K
else inc A_i by 1
4 t( P. _' }2 h6 o end
Q) \$ E' E# p! j1 t9 jend |
最佳答案
查看完整内容
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,其它按你的 ...
|