|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: ?8 Z+ n& x& L1 }0 T- v
$ F7 q: y0 w2 N- J% V y: `" E我的问题是,在每个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中的数值,不知道会不会有什么不妥。 x2 W- C. C" C4 }* V, i3 l
V0 R7 U1 P: ]' u
begin P_read arriving# V" |! b' I6 L$ G
while 1=1 do begin
5 y2 b" O: @1 G: V8 R. \ read A_tote from "data.txt" with delimiter "\n"4 t4 l2 M2 X4 r7 O' I! x3 @, @
read A_time from "data.txt" with delimiter "\n" v+ j$ K5 ]& ^
read A_leave from "data.txt" with delimiter "\n"1 C+ Y8 P' p9 ?
read A_picks from "data.txt" with delimiter "\n"
% y! v+ `% B; s' F8 h set load type to A_tote
) G4 p. T+ _& u, o0 E) y if A_tote="tote 1" then set A_induct to 1
! {% h8 `+ x0 [1 u& s else if A_tote="tote 2" then set A_induct to 27 S5 |5 E! [3 G$ u( M B
else set A_induct to 3 ; q9 s8 D9 B# H$ Q+ F3 K2 T5 w0 A: P% Z
set A_i to 05 \% j; x, i! {5 t) [5 a7 T y
clone 1 load to P_induction0 Q' p* Q% [' J# e( F( _$ {
wait for A_time sec
3 b; V( a# Q2 b3 `5 Z end
: i1 C* S/ b) o3 N) p# P ^" Eend
5 ]* M O3 S; x" P5 m( ?8 }
9 T$ u, i7 |& v# I* c) Q" u0 cbegin P_induction arriving
: g4 O9 y( `) g& R! ]3 S if A_induct=1 then clone 1 load to P_pick11 s2 l+ N# I+ X8 N" o
else if A_induct=2 then clone 1 load to P_pick2& S2 C* F2 H; a3 @; M! C' f
else clone 1 load to P_pick3
6 Y5 E* o5 c/ mend
$ N9 D O( }9 R. F+ b& w$ z+ x. [/ c, C: f" Y; I- U
begin P_pick1 arriving
. {$ L6 R4 b: F: ^. }" o set A_i to 1
3 r# ^3 o3 Y2 }% W move into Q_induct1
. H, o4 k* g+ Y0 `$ C: o" b& V n move into pickaisle.induct1
% F! B* I9 E. t' f. n* l! ]3 C while A_i<=30 do begin( Q( w; [' V0 l- M. m9 h7 j
travel to pickaisle.con(A_i)
s6 Q( W- ?% z5 s1 c# ?8 r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 q2 u2 P ]0 s7 i4 u& K/ F" X7 ?; r else wait for 10 sec6 m8 }2 S& v. V" G
if A_i=A_leave then send to die$ c" i* i" F0 F' @
else inc A_i by 1
5 V; I3 j: r4 C/ W$ R end
0 A5 U/ G+ Z) U: g, zend4 ~/ S) G# P& K, P- T
1 e% `( `' e$ H; y& \
begin P_pick2 arriving
" {8 G) Y0 M6 o7 U6 L5 E" D set A_i to 11
0 ?8 v. [( ?2 G$ c+ a9 [ move into Q_induct2
4 f* w/ {6 L1 t0 M! u move into pickaisle.induct2
& c2 P8 E( I* U9 h7 l0 P while A_i<=30 do begin- ~6 t' N% B/ S) o! B4 x8 M' R
travel to pickaisle.con(A_i)
9 @! b7 K: m4 U2 _6 v! b$ n. S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* f7 h* c; K; `4 R: O; H* M else wait for 10 sec7 [9 [' @, F5 c: z" a
if A_i=A_leave then send to die, F8 n/ A$ w) ]4 _. y
else inc A_i by 12 ~( k0 [1 w6 U( a: p# U7 Z
end6 s ] O0 Y* i2 x: C B2 f( ]
end% x; ]. t% W5 y V$ z
( e4 Y: H" d) Lbegin P_pick3 arriving, d3 C3 Q9 b) {# C- D
set A_i to 21" }5 ]7 R" f8 x5 O- Y6 f* j
move into Q_induct3
/ j2 W3 n; e% H6 d: G move into pickaisle.induct3
' {: Q6 T9 i/ o/ E while A_i<=30 do begin1 n' M0 M7 w1 p* F% o( @0 I
travel to pickaisle.con(A_i); L( L' g8 V8 h& G& t( D) d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ^, h2 U. P( w% E8 A' z: d0 O8 ?3 j9 ?
else wait for 10 sec: k# a4 ?- G* G
if A_i=A_leave then send to die
) y) ~ Z; ?) {. P, } else inc A_i by 1
/ S' C# B9 t& ^/ ^ end
- y. v+ E4 R8 C% y- Z0 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,其它按你的 ...
|