|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢# x2 v1 F- H. J/ V( b$ ]9 E, U
8 D* |9 F r. `/ L6 f6 T0 P我的问题是,在每个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 a6 y9 W' b1 s, w1 y7 N6 G$ J, P: s1 P% Y* X+ U+ z% p
begin P_read arriving9 s9 K% F; w7 [ Z. a) T0 c
while 1=1 do begin. c' S1 s1 @ p% @# P( y' U
read A_tote from "data.txt" with delimiter "\n"
. L9 ~" P3 A) D, | read A_time from "data.txt" with delimiter "\n"+ u* {+ `8 s: U' {
read A_leave from "data.txt" with delimiter "\n"
p# P. @6 d$ |/ i7 p# d/ P read A_picks from "data.txt" with delimiter "\n"/ b/ `4 P, _9 V; B$ ^ T" P/ g
set load type to A_tote$ C2 z% s! _, k' ~2 e7 j
if A_tote="tote 1" then set A_induct to 1
: |& g4 K+ ~% N, _. A0 ^& J else if A_tote="tote 2" then set A_induct to 2# e' B3 V7 J0 l6 S. U( T( K
else set A_induct to 3 ( I2 K! W: Y8 `& C, j; y- f1 `8 k5 Q
set A_i to 0
# m, e, W o8 p, |4 n clone 1 load to P_induction& b% O9 \, Y' H4 ~* T) }
wait for A_time sec Y' v/ y. V. Z) d# B6 e; G
end, n- q1 x8 q; ^3 |5 y2 | N
end
/ L5 ?1 ?) l7 n+ E1 d) j, l: I' N# b
begin P_induction arriving
" b- o/ N9 Y% @" U; d, a if A_induct=1 then clone 1 load to P_pick16 E9 j V5 r% L. T! y- T
else if A_induct=2 then clone 1 load to P_pick2* m4 t% ]8 F3 Z1 C) c0 t, ]4 k
else clone 1 load to P_pick32 b$ R$ `. T* E* z
end
3 `* F( K0 |: c" [. R: R/ P
( u; g9 |, F8 O Q5 n$ L% P+ W# gbegin P_pick1 arriving
9 h- I3 g. ~' \& c5 L# m set A_i to 1
& y) E! ^: ] G* V O" t5 O$ m move into Q_induct1* W2 i$ m/ ^4 Z6 l# P" }
move into pickaisle.induct1
- H2 @5 J" d8 K6 ?' @2 |) G while A_i<=30 do begin
# i5 ]. H3 o i5 P travel to pickaisle.con(A_i)' {. x; n# }& x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! V m5 z; u9 l7 M! X& } else wait for 10 sec+ J" K5 P2 N9 N- U0 g! q. ]. o$ r
if A_i=A_leave then send to die
9 K. w, {, ~2 Z( ~0 O. U( ] else inc A_i by 18 y$ Z0 Q6 t& u8 ^
end
) E! J5 f* J1 Q8 @* w: H" }end
s5 u! R% C& b# h2 n* w/ E! J8 n1 ]
begin P_pick2 arriving
9 P, I& U7 h9 _- ^ set A_i to 118 {7 N$ Z9 v, l& }& }2 }* ]3 s" f
move into Q_induct2
; s4 }) ~- z8 N9 ]! c2 m move into pickaisle.induct25 r5 u3 l4 h- B p6 q4 U
while A_i<=30 do begin
0 _2 q, f8 a! z travel to pickaisle.con(A_i)5 u1 Q! f: P8 _3 b/ C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( |+ B- f% \' Z' i2 z0 ^4 H
else wait for 10 sec3 R5 X6 Y }4 G4 t
if A_i=A_leave then send to die* i3 T4 C6 i/ D4 [1 F/ p
else inc A_i by 1" T" j; y0 k# B: f. U( X
end
+ \" |/ h3 k% ]8 W3 {# R" ]% K" Oend; H o2 ]; v1 _/ v1 F$ m( m$ O
' L5 N1 L( ~$ r" Y5 t/ C$ I8 O; b W) o
begin P_pick3 arriving& P$ w+ A( Z- g
set A_i to 21
1 {2 M( f3 X! Q% c& f/ s move into Q_induct3
4 ~8 l" C( q& G: v1 d5 z move into pickaisle.induct3; _0 j$ y* R: s1 [$ y% p, p
while A_i<=30 do begin
6 r3 Y v6 q- h2 F$ Z( x9 X, ^; \ travel to pickaisle.con(A_i)
+ L& p; h1 ?3 r8 v# o& [0 V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! M' i" b* B/ t- r else wait for 10 sec
1 U9 u, j$ I$ U& D' n6 X, N6 Z; H. D if A_i=A_leave then send to die. X/ B6 U* e4 r. n
else inc A_i by 1
6 V j* m0 ^! A end: r6 \2 w8 i3 R' Y( {- F7 P9 r7 V" |
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,其它按你的 ...
|