|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 r5 F: S2 r/ T$ f" [5 v
0 o- _! y5 t3 D$ u+ S我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ ~8 p/ o+ x, B9 J+ l4 D- S: ?
, f6 D+ H; U. K- h C& M3 o7 U- mbegin P_read arriving* I. P& X/ T0 |, c6 m0 _# Y+ O& d; h
while 1=1 do begin/ H) i2 y) k1 ]
read A_tote from "data.txt" with delimiter "\n"! a& r# y9 c: |' B6 [6 l# L% @0 L
read A_time from "data.txt" with delimiter "\n"
+ f3 K$ t' E, s2 G e. D. O read A_leave from "data.txt" with delimiter "\n"
# I; h% ^5 } m9 C. R" ]- C T read A_picks from "data.txt" with delimiter "\n"
9 z. S x5 T0 R& o set load type to A_tote; v' v+ S5 P, [/ y
if A_tote="tote 1" then set A_induct to 1" X6 r! r/ B5 M5 r' f9 x# v. Z
else if A_tote="tote 2" then set A_induct to 2: W5 w; z2 R5 u. O, h- D; N+ c
else set A_induct to 3
& N/ z3 u# F3 j. H! y ~ set A_i to 0
" X% h0 ~: y' B J7 Z, K clone 1 load to P_induction, I+ {8 K- J/ _ [# F5 m
wait for A_time sec$ r1 E! Y2 x$ z( W/ Y1 F) O H
end
& {1 Q0 ]* j+ [1 aend
# L) Q) u- P4 u
) a/ M8 L9 X9 |begin P_induction arriving' E9 q$ E: I8 p+ t; Y$ |
if A_induct=1 then clone 1 load to P_pick1- `2 S( O1 _- ]: E' C0 \* o
else if A_induct=2 then clone 1 load to P_pick2( L. J0 a0 s U$ q2 {. C$ l
else clone 1 load to P_pick3
7 ^* N- b8 S; p8 J: Hend5 v3 X* b2 p3 M, ?# T7 U/ N1 c9 h
1 T( _6 r0 p3 ~% jbegin P_pick1 arriving
. [# `# ]. `( \2 T1 o/ Z set A_i to 1
, M1 r; g* {4 M0 o3 b2 g+ y move into Q_induct1
! w! [5 p0 z. _+ j1 O) _" }9 k4 } move into pickaisle.induct1
% r4 ~5 t5 z; n, K) x while A_i<=30 do begin" S# T6 e$ _- L5 ?' t
travel to pickaisle.con(A_i)2 V7 { a1 }" r. B4 J* V2 H L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 h3 |$ y' X% {, y {' @9 ~! }
else wait for 10 sec4 z* _, L, D% l6 n* i
if A_i=A_leave then send to die- |/ K$ R! P/ ]
else inc A_i by 1- e9 _* b* t) ]
end
7 s% i8 u5 H+ q. Nend2 ` H: Z/ w) c9 z
0 B8 Y8 P! I0 n L9 j1 G0 R) bbegin P_pick2 arriving, C$ |0 R: _5 [+ ]4 }8 L
set A_i to 11; T' g3 b: U) h: g+ ]8 F
move into Q_induct2
4 e/ T3 c* j4 m/ e5 N* [5 b& G move into pickaisle.induct2
- P+ E0 w! R [6 @: p while A_i<=30 do begin& W; M5 W5 f6 f' s
travel to pickaisle.con(A_i)
; b& q5 C5 X# U) \* |" g if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, z f- L# f% H9 E; \ else wait for 10 sec
- z/ [8 a# n# t6 _! ]* P4 Q# u if A_i=A_leave then send to die& B9 v+ L% V& n% R9 o$ ?
else inc A_i by 14 t. o9 B( U$ i) W
end
1 ?6 g: s( v a1 E- hend
6 ~! I+ }) d7 q1 _- d: v6 }. m- K" d: x
begin P_pick3 arriving, V: M# Y) E$ ]- _3 o6 v, w0 ^5 p
set A_i to 21
; Q. C; O0 L1 Z8 ^ move into Q_induct3
, o r8 ^. v0 m! L5 p move into pickaisle.induct39 ~' R; h4 p- g/ y! _4 i0 N
while A_i<=30 do begin
( Z, X0 ^* h; y5 t1 |' ~ travel to pickaisle.con(A_i)
# X: m4 Y' F( e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- _4 s5 v, a' E2 ?% r else wait for 10 sec! }/ K1 k- i# {. }
if A_i=A_leave then send to die3 d) _% O& g0 [* z s
else inc A_i by 1- N5 Q G" F6 g* Y2 u
end
" K; G5 \' C2 o* e6 o4 Y9 O5 Hend |
最佳答案
查看完整内容
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,其它按你的 ...
|