|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ ?: S1 q t5 L9 O1 d d; J! e' N3 a# F y0 x
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 f, V3 B: H1 ]2 ?4 Z. Y/ Q2 C
5 L: \/ \& H2 q9 Qbegin P_read arriving
! h$ i' D/ N: ? while 1=1 do begin; l8 H9 _9 ^! l' @7 J7 m
read A_tote from "data.txt" with delimiter "\n"% }3 G, u# N+ Q: F5 [
read A_time from "data.txt" with delimiter "\n") h, K6 z2 V; X4 z3 c) S; y
read A_leave from "data.txt" with delimiter "\n"! V1 p; r4 Q# k" m, r( \8 K
read A_picks from "data.txt" with delimiter "\n"8 G' M: g% l. U2 B: N: s9 A
set load type to A_tote! J9 `7 F8 d, J1 b
if A_tote="tote 1" then set A_induct to 18 z; Z# G+ I/ P$ ?
else if A_tote="tote 2" then set A_induct to 2: P( `" e; O' {/ o+ X3 W
else set A_induct to 3 # h/ A& e% m9 c# e
set A_i to 0
$ t; X& e! D4 ?% d8 K% s" N clone 1 load to P_induction2 r2 z3 r* |' D) `/ V1 P
wait for A_time sec/ \1 V/ S; s- n( O
end
. n. N/ H& }! X; a' Rend! e0 [0 A) O5 x% U7 }! ~8 E
4 F4 D* E4 a/ n) ybegin P_induction arriving
5 G$ J7 ?! D3 A: r1 k1 V2 z0 ` if A_induct=1 then clone 1 load to P_pick1$ ~1 _# j L% V( x
else if A_induct=2 then clone 1 load to P_pick2
) B' }7 v4 T( c else clone 1 load to P_pick35 ~4 _$ L C) ? U1 [" |' a+ F
end' _: [( j8 s/ ?. P0 i. _; x* O
# }# _: _9 N4 ybegin P_pick1 arriving
& _5 k: Z6 M7 H8 d4 \3 x, ^( t set A_i to 1
+ I( M' |$ b+ x1 q+ \3 y' j3 N move into Q_induct13 r' w7 _7 ~; y- Y0 F
move into pickaisle.induct1
* y! i6 z, {; [$ H- I9 f while A_i<=30 do begin
/ H5 h V- O! q8 S b2 o travel to pickaisle.con(A_i)
& @5 T- M2 O5 J* e% {7 F# l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; K1 I6 E3 l3 h+ s/ k else wait for 10 sec- s d* @8 y# `( D9 z5 g
if A_i=A_leave then send to die
+ y# b/ a& ^6 S, i- e+ V else inc A_i by 10 X, }6 b" {5 T D @+ V
end( j! m5 i) Y9 V# u9 Z
end. {8 k4 W# t2 V. p
+ j7 j" X( p+ r5 z
begin P_pick2 arriving0 I; C4 e4 n% ]4 v" _6 `
set A_i to 11
X, H! V5 g$ q0 X1 P& M3 M move into Q_induct2
! z' e' Y/ |- @8 ] move into pickaisle.induct2
# Y# O2 [( c- T4 X while A_i<=30 do begin& l2 j2 l8 k9 \2 `& T1 A7 n
travel to pickaisle.con(A_i)0 ?" }- L0 `" ^) A$ H7 f+ b) f8 \$ z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 g2 f- Y. u/ [! r c2 J; M" l0 B else wait for 10 sec- x. I( {9 i" V5 Z7 t% Y( B2 b
if A_i=A_leave then send to die
x! S8 Z! J9 b/ I5 s) v, x else inc A_i by 1
: n) P6 A% G% F0 N5 @$ `, i end! f6 x* x) V- N/ ~+ R! P
end
2 F3 J% T9 Q6 E+ V! \6 W' T2 M I& V
begin P_pick3 arriving5 i& ]/ N5 p' n) ?% R4 I5 @
set A_i to 21& _8 q \' p1 Z3 M% Y" H
move into Q_induct3
C4 O& o8 s9 a! X2 z8 n move into pickaisle.induct3
* y& m: U+ L- q w/ Q1 d4 n. f) m while A_i<=30 do begin
; o& `/ P( r) ~ travel to pickaisle.con(A_i)* f1 K+ J9 I1 m5 ^, W6 C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* b% s$ z* H/ T! t' a. w
else wait for 10 sec9 P+ f' K! g" S7 K) m1 o$ S
if A_i=A_leave then send to die _! I7 n7 b9 G1 D' V' ]
else inc A_i by 1& V, L3 N* @: |1 v% @6 d. J5 h
end9 A6 n0 K# m4 ~6 T$ o" J3 N
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,其它按你的 ...
|