|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 ]& o0 s# T& x- F$ a) b
: b0 ~8 V E v5 o: h% Y; Y$ M我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 D, D! J8 Y8 D7 m7 }1 U) \0 R5 Q
; I. E- G: L* }# g3 n+ M2 w; ?" Bbegin P_read arriving# ^, K9 z0 p8 X) a
while 1=1 do begin
8 k3 y) g$ K7 u H read A_tote from "data.txt" with delimiter "\n"
3 p+ w$ x5 w+ }' O& b read A_time from "data.txt" with delimiter "\n"8 T4 [* A2 j- W5 ]' h0 U
read A_leave from "data.txt" with delimiter "\n"& T( r; s3 x0 g7 E$ Y U- f( N
read A_picks from "data.txt" with delimiter "\n"
# Z) S+ L2 h2 Q set load type to A_tote
9 n/ b# f; k* s/ ^5 X, s: Y if A_tote="tote 1" then set A_induct to 14 L4 D; ~; H/ J. s3 S5 m
else if A_tote="tote 2" then set A_induct to 20 U) l0 b9 s, Y1 X9 G
else set A_induct to 3
' [2 V8 R( p; q1 w+ ~ set A_i to 0) A6 J4 F/ n0 }- g) A! g
clone 1 load to P_induction+ Y8 x. R0 Y( |( ?) E
wait for A_time sec7 p3 g: E6 |$ O3 u
end
& ~# H7 i+ [5 l7 n5 kend
9 B! S) r$ ?$ \! m0 f
+ ]- r- t6 V& v0 ?# i! e! x5 t. i8 V5 ebegin P_induction arriving1 p: C. } _' U
if A_induct=1 then clone 1 load to P_pick1
) z% q- }0 o0 M else if A_induct=2 then clone 1 load to P_pick2
: k8 b; }9 H+ J0 {! o' T else clone 1 load to P_pick3
4 C( b+ `$ w# t9 oend2 x. `: }7 y: a+ K
9 F9 P9 i C8 I% H5 i. P
begin P_pick1 arriving# p) {% d$ T! K7 q% [* }# p
set A_i to 1
8 B$ I6 p1 q: W( `+ y$ u move into Q_induct1$ N( W, i) ^7 _
move into pickaisle.induct1
- u8 B E, f' y- u, r while A_i<=30 do begin7 k+ o" p( h8 k" x! e
travel to pickaisle.con(A_i)% \4 b r3 I! j! {" }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 p6 E/ T( _' G; f. Y t else wait for 10 sec! ]3 E7 I/ F$ N Y% o/ d
if A_i=A_leave then send to die2 S0 T, R8 T+ z" U) g+ l
else inc A_i by 1
6 r, Z4 n. a, }' S( b" N. t. R end
6 j$ R; i: [) l- E0 ~. |end! Y, c p8 J! |& b' x/ x) g
& \8 J7 n$ I8 O
begin P_pick2 arriving
+ x [# p" X* v/ s( R set A_i to 11
7 y1 m7 c1 V# ^- O1 _7 B1 Z; Y move into Q_induct2
/ I/ _3 ] r- P0 @ move into pickaisle.induct23 N+ y m# m3 x0 i, o
while A_i<=30 do begin
- D& r# p; s$ ?# Q& | travel to pickaisle.con(A_i)
+ \! z% r0 P& J* i% h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 T9 \! |, E, O7 C, e K) J8 ^ else wait for 10 sec4 X7 i$ E& L) b, b
if A_i=A_leave then send to die
: G5 l. Q; K7 r; g3 P) u else inc A_i by 1, u2 q3 b; r: k* Q0 x% q4 [" H: A c
end
1 i7 G2 V- o1 V+ w aend
8 H; B0 O6 ]8 v* T# R6 e/ {1 I1 z6 c1 B5 f
begin P_pick3 arriving
; ~7 \% d- g) X set A_i to 21
' K1 w; ~3 t# ~, `; W3 a move into Q_induct3, F# v+ V' b' P3 U) b$ ^. G
move into pickaisle.induct3
+ Z: }4 d$ g4 Q8 J: U while A_i<=30 do begin* L. B3 V8 S( P% ^) F
travel to pickaisle.con(A_i)6 J1 y0 }/ s1 r7 k' b* R m H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& e+ f4 I% r( \- E else wait for 10 sec
. _% w" G9 u& b( i3 C7 k if A_i=A_leave then send to die5 r8 f' l3 V" `! D* e- Q
else inc A_i by 1
; Y- B: [& b. V7 _* S; L end
" k; E3 P3 L2 r$ D3 Yend |
最佳答案
查看完整内容
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,其它按你的 ...
|