|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' M$ N8 ?8 D8 R9 d
- D) }# r7 L# ?2 m3 h, S我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* S3 i# B8 P/ a, d/ P
, H+ |* \4 ^: H4 d8 r& Pbegin P_read arriving
S+ o+ b* Z& Q while 1=1 do begin
+ G+ D+ [& _, R0 N: q- L read A_tote from "data.txt" with delimiter "\n"
7 R/ Q1 p* n/ I read A_time from "data.txt" with delimiter "\n"% n* i4 T- h8 H, W. o( s
read A_leave from "data.txt" with delimiter "\n"
& B2 s ]% h% p5 |6 j* e+ ] read A_picks from "data.txt" with delimiter "\n"7 W$ S6 j: ]1 r4 t8 M
set load type to A_tote" o, o2 w/ b9 a. j
if A_tote="tote 1" then set A_induct to 13 |) C9 b& q, z. i3 z% i
else if A_tote="tote 2" then set A_induct to 2
9 \/ K& e1 {1 J, r8 Y5 \ else set A_induct to 3
( Y! ~- h- @) g8 `" f; G set A_i to 01 W! c: O8 | Y. P7 }' G$ e* R
clone 1 load to P_induction6 I7 N. ?- y9 \: ~( f; ^
wait for A_time sec: {( A, J7 p% T: O q+ {
end- w% j" Z/ b6 |6 |& }1 x7 M
end
# C! q% P! _) I T1 U, L
$ c( W3 m" w8 F) R4 ~2 ?# o. \begin P_induction arriving
) a8 N3 N: ] [7 U R& ] S' F5 Z if A_induct=1 then clone 1 load to P_pick1
' N, K. w# ~& k" U# E else if A_induct=2 then clone 1 load to P_pick2
) M* m, [6 B* h9 z" k0 q else clone 1 load to P_pick3& m% ^% Y9 ?) c1 \9 j) e" O
end
9 f5 W% Q% c0 l+ c
% ~7 E% J: h9 @0 k- J$ Hbegin P_pick1 arriving
& y' U9 P% e" H set A_i to 1
i: g3 g+ @$ J( G! m4 a move into Q_induct1
8 Q3 R) }* e. X& W- y+ ^ move into pickaisle.induct1% K5 d$ s8 H3 U& e- M9 t9 D
while A_i<=30 do begin% |& i1 T% u/ Z" y/ @5 I4 k
travel to pickaisle.con(A_i)
3 X# m, y+ G( _$ e) C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ L/ D% e5 a4 y$ P' Z. [1 J! e! J else wait for 10 sec! q. k3 ~4 b0 ^1 g' M
if A_i=A_leave then send to die) h. p& J" r3 Q, R8 y; a
else inc A_i by 1& m2 Z1 n/ ~4 V2 e3 W9 g F
end1 X5 a; y( n- U+ f0 l# t
end
, t8 B$ k* Z9 x
) J7 `) Y' ]& }5 qbegin P_pick2 arriving
P- Q& W1 e- e, w5 Q4 Q set A_i to 11) k+ U' `, w; B) N/ \) p. Y
move into Q_induct2
; P; V1 Y9 \( }2 T" q l) C7 t move into pickaisle.induct2
' s* X" y, a7 ? e! G2 W5 e( u9 b while A_i<=30 do begin/ l4 P' X f& ~/ q0 ]$ ~$ n
travel to pickaisle.con(A_i). `+ R' X8 I4 _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% ~" m+ }( T0 c) m; d
else wait for 10 sec
; D# \7 ]. I1 N; @- } if A_i=A_leave then send to die
) K$ L' M$ U( \1 ?& X1 C- H- U else inc A_i by 1
) r; w* N1 ? S+ | end
6 X5 n4 ]0 w4 Lend
- B6 @, ~1 H1 ?7 O! G& h
* U2 g. ?5 G% p, g( Kbegin P_pick3 arriving* V' `& a& \. i7 Z2 @2 T! B
set A_i to 21
% F5 Z8 e" y( G0 ?( m3 L, e. g$ ~ move into Q_induct3
- m* U) D, S; U move into pickaisle.induct3 v v$ M: J H$ }+ D, G. l
while A_i<=30 do begin
9 b" M$ e; ~4 |' x& u3 ~ travel to pickaisle.con(A_i)
# P) A0 ~, |: v& D' t8 z( N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ x& v& L1 H8 i3 I) G k else wait for 10 sec& ?5 b# [7 J: G2 k: F) u- V8 x
if A_i=A_leave then send to die5 y- v( W& v( o: p* M+ z
else inc A_i by 1
! Q* v) }7 Y+ b# h: v end4 S4 w9 N2 \1 c- V* B6 T
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,其它按你的 ...
|