|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; ^3 w% ~7 ^5 H% _8 s
# `, N2 e( _1 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中的数值,不知道会不会有什么不妥。: ]. n, k& ~* e
/ E2 w5 \1 Q. {8 C- X1 Abegin P_read arriving
' o: c! z0 g2 g, g while 1=1 do begin) m. Y( t; s- z: w6 o- a# z
read A_tote from "data.txt" with delimiter "\n"6 Q% h% R) I8 \ g x; w
read A_time from "data.txt" with delimiter "\n"
5 V W) w6 r$ Z read A_leave from "data.txt" with delimiter "\n"
, r3 t+ G% |" o4 k0 x read A_picks from "data.txt" with delimiter "\n"
5 k, O5 S% ?. x$ k& d set load type to A_tote# V. a! s( N: k
if A_tote="tote 1" then set A_induct to 1# V) Q, w; E( X3 g: g9 [; f# A. _
else if A_tote="tote 2" then set A_induct to 2, m; U! g6 Z1 Q7 h. {
else set A_induct to 3
, C' P' z& ]7 Y8 H# M set A_i to 09 e5 |. }7 y9 H+ n
clone 1 load to P_induction
' w1 o# O0 ?2 C wait for A_time sec( w5 ]! f6 a1 k
end) B' S1 \7 U& s7 p' Z
end
& |: }9 |3 x3 s, i$ ~$ g8 {' j$ }
9 d* p; t$ q `" y' K; M: g; sbegin P_induction arriving
1 o. c3 n! k7 a& }' R. y if A_induct=1 then clone 1 load to P_pick1: l) N6 a. V9 u' U8 X) b5 V2 T* ~
else if A_induct=2 then clone 1 load to P_pick2
- ~2 v6 d! G) [/ D. q else clone 1 load to P_pick3
# y, Y, o, E) _" o/ {0 v6 j \end+ O7 E% m' o, I$ S: h# ?
5 X: Q- p: E# f/ Xbegin P_pick1 arriving! h9 k5 g$ C0 f4 l$ F; O' p
set A_i to 1
5 D8 {: \3 j1 `0 g2 { move into Q_induct1% b; B6 @# I# I. K
move into pickaisle.induct17 _4 b g7 q" s2 p
while A_i<=30 do begin
. m, p `, [; N, i; @ travel to pickaisle.con(A_i)
) Z K+ ~' {9 v0 K( |7 _ ^: G# T) l6 W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 a" K7 ?2 l0 M, B2 z9 ^ else wait for 10 sec; Y& v" z% j7 K
if A_i=A_leave then send to die
6 \+ Y: ]$ Q" ?; U$ B6 q else inc A_i by 1
2 J/ c8 U4 x3 l7 s2 N end
6 O6 t, |' }/ D+ C& w- ~end
" R. x7 h; ~- i/ }0 M1 M2 G$ c$ G
begin P_pick2 arriving
2 N3 f$ Z7 V- u0 W5 s set A_i to 11
1 \7 O6 e6 h% N3 e) s4 h: o, [# D move into Q_induct2
' R1 @, s6 y" C7 E3 h move into pickaisle.induct2* V* f$ g1 D; d; a8 W+ r F
while A_i<=30 do begin
* U. l: G0 \1 y! s4 y- m travel to pickaisle.con(A_i)$ V$ K6 o; u! \2 p, V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; o. O$ d' j# i* T. E6 V! C
else wait for 10 sec( x6 j( Z( q3 w# j: |
if A_i=A_leave then send to die1 a/ }; P- \0 U; `0 g+ d2 a
else inc A_i by 1" d/ n: h* i/ ~% A4 F
end9 ?; D. d' q6 K8 v# n# {
end8 }6 i* U5 D5 S6 w; Y" d4 f
1 D; o P6 U5 g
begin P_pick3 arriving
& x7 H0 D+ a3 e2 ^- x set A_i to 21' L: s9 J4 ?8 I! o( G( ^" ?7 d
move into Q_induct39 s/ O8 V0 Q6 W$ I+ x; m# K+ o' N
move into pickaisle.induct3" @' ^% |) E6 i+ g; k* _% r
while A_i<=30 do begin/ ~ j/ {& J. c& u0 T
travel to pickaisle.con(A_i)
2 | z D6 Q% b0 ~6 ]8 a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, @/ c4 s c5 ^5 B
else wait for 10 sec( i+ r8 M2 s8 M, |3 V- y- a% u8 z
if A_i=A_leave then send to die+ X& u7 }- X2 _3 E/ z9 G
else inc A_i by 1
0 ?3 K1 j. S {7 p+ Y8 G end
. b$ A( K6 ?( k# J# N7 W5 aend |
最佳答案
查看完整内容
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,其它按你的 ...
|