|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 _3 K/ D/ [9 w9 H4 i( d
3 @3 a" r5 b- _( _3 d9 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中的数值,不知道会不会有什么不妥。
* X! C$ L' {7 r# o5 Y5 K' f- {8 w- N
begin P_read arriving
1 H* M0 V- N( D& g1 h# | while 1=1 do begin
c" N! b/ G8 L read A_tote from "data.txt" with delimiter "\n"
' u% N. f, E& W1 H read A_time from "data.txt" with delimiter "\n"7 |( {, r0 y4 Z- l0 U: o- y
read A_leave from "data.txt" with delimiter "\n"
/ }. i" T9 ]( d4 ^ read A_picks from "data.txt" with delimiter "\n"6 V6 F3 X* @( L; |; w
set load type to A_tote( z( ?* P! {3 X' {% q& Q$ j
if A_tote="tote 1" then set A_induct to 1$ a" B8 _+ d2 H- r& c
else if A_tote="tote 2" then set A_induct to 2
8 h, f4 K: _# H else set A_induct to 3 6 k1 L; d2 R. f5 S
set A_i to 0
& E1 P! }' `9 f0 [" P7 @) v clone 1 load to P_induction
$ H9 J/ b* q# N3 C$ E wait for A_time sec
" u: P7 E) x( P& L end9 j* X0 l3 M+ s6 S8 J; d. i
end
4 K( {# o. m' ?9 w
4 B' c$ N4 y Z( N* l% c/ H( A$ b/ Vbegin P_induction arriving' L9 j0 I4 h) l4 i: y3 |
if A_induct=1 then clone 1 load to P_pick1
) _5 P6 V, j& Y* w% H5 H, o1 \! T5 q else if A_induct=2 then clone 1 load to P_pick2# a2 m; q g6 z# S9 S' @' Z( x! ]
else clone 1 load to P_pick3- ]+ n" X! F' q
end, O2 }7 ^( \/ ]+ c& K/ u
) D d- l1 {* ?+ P5 j. L4 Y/ x
begin P_pick1 arriving4 b4 F: f8 O' U X" [3 M
set A_i to 1 R' X. n3 q- a' ?' ~
move into Q_induct1& M! O# }- X& }9 j" Y- w
move into pickaisle.induct1
; l& A3 X3 F% N! k/ ^; T! j2 Q while A_i<=30 do begin
7 K p1 ?# ]5 ^9 F. ~! b0 d9 n travel to pickaisle.con(A_i)6 \& [6 ? g. t, L8 W, I2 p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 c7 q* Q5 v8 N$ o- e% K; ^ else wait for 10 sec
" y3 ?' G% Q8 ?4 H1 m1 X if A_i=A_leave then send to die
& e+ n6 O/ M; x2 E( ~* x else inc A_i by 1& r6 \+ v$ d& |4 g7 O! {; B
end) r$ [0 X" D2 q6 K2 o5 g
end) c1 _; e' A2 a: I
: p; P2 b9 O3 }$ Bbegin P_pick2 arriving
! n1 S/ @- @+ ~4 B, z set A_i to 114 U* z1 l {9 J4 {. c* _) n
move into Q_induct2
" @8 h* g) g; z! Q( i- X$ I8 a move into pickaisle.induct2; i" H' M" [; |$ L4 y
while A_i<=30 do begin; w: L0 f- T5 i( A
travel to pickaisle.con(A_i)
, ~. z9 Q' w; o3 H/ ?/ t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) o" G. i) A! j1 N8 B4 P
else wait for 10 sec
% c) S* C! F" y0 C$ I/ V$ J if A_i=A_leave then send to die7 ]0 T3 S* e; T' J4 U( k
else inc A_i by 13 L! ?0 z; a# y- \3 }3 p/ _
end
. M; U* v4 T1 L& }7 ~9 ^0 rend
7 L; A: Z% O0 M# w+ C6 d: |+ _3 `- u0 t( m/ ^
begin P_pick3 arriving+ y* P* \% N0 N: `/ R9 Q
set A_i to 21
. e. o. T; B7 U6 S+ j, S( Z1 T) _- T/ _ move into Q_induct31 }, f5 Y% w; M; h* I8 O' p
move into pickaisle.induct3$ E' G; e& W1 U
while A_i<=30 do begin! M$ G1 @2 f7 D6 W: W9 p
travel to pickaisle.con(A_i)$ u2 z/ a; L5 K* d1 L% {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: L! |# d M/ v p else wait for 10 sec
5 }9 V, g) ]6 N3 i6 L9 s m# q if A_i=A_leave then send to die6 G0 h z, Q2 }7 B) C% z: c: E
else inc A_i by 13 p2 G8 {. n6 k( {+ C8 X
end4 I' e( j% D% i* E, V$ ~$ L
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,其它按你的 ...
|