|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) N+ v* V% Y9 a6 v8 S W) x; E" ~
" h! U/ l! _! |) t
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ v0 M2 v; t, v3 G( b
0 D- e) G. l1 w/ P0 q/ R, m% Y# g
begin P_read arriving' ^$ L. Y& \* t! C- _7 {$ j7 B: v
while 1=1 do begin
5 M# N5 ~* Q1 U0 I( Q- T! | read A_tote from "data.txt" with delimiter "\n"' y- s3 Y" B$ n0 h
read A_time from "data.txt" with delimiter "\n"4 h$ a9 K3 A1 P; N
read A_leave from "data.txt" with delimiter "\n": t+ S! ^/ {. f& L$ o
read A_picks from "data.txt" with delimiter "\n": H) p; f3 }( f4 l+ Y+ F0 s- K
set load type to A_tote' [1 D0 A2 G7 T* j$ E' t5 K
if A_tote="tote 1" then set A_induct to 16 w, R. S# q) _+ h' W
else if A_tote="tote 2" then set A_induct to 2
2 Z) Q+ g. }3 X7 _4 h9 S* i M3 F else set A_induct to 3
. `: ^1 [% v8 @& h% y set A_i to 0
8 Q* W" Z8 p {* _" T clone 1 load to P_induction
) x. y# g8 A( L. K3 b. O q0 i wait for A_time sec
& G7 I) r2 G8 T1 \/ N D0 H end
# Y g) X5 f& ^- W" [" }, Uend
" X" A* V6 q" \# c# M& E! U1 ]7 F. S4 h R8 n4 w! r% A3 x2 l
begin P_induction arriving- o6 P- C' K1 C: \: \3 H; P
if A_induct=1 then clone 1 load to P_pick1
, G0 O/ s: q( K: q else if A_induct=2 then clone 1 load to P_pick2$ @% A4 Z- ~( p' t! q! _! b
else clone 1 load to P_pick39 T; ~! o3 T0 `/ h" o
end
5 h8 u2 f d7 H/ o2 }( t3 k$ {
% q; p' ?% S, u7 \9 s) Dbegin P_pick1 arriving
; p* j( u: k5 ~ T) x' a. D set A_i to 1/ {3 y$ j" y) n9 B$ k h7 v
move into Q_induct1# ^/ O2 w4 x% g4 D8 p+ o
move into pickaisle.induct1* Z/ w e# a( K: I1 e, h
while A_i<=30 do begin
% H- q4 V' ~* }& u; M travel to pickaisle.con(A_i)
f* u _8 i0 Y) u1 k/ a. V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" q7 m1 {0 k0 c5 x1 j else wait for 10 sec1 z, h' l. o, A& N
if A_i=A_leave then send to die
( L+ ?. e; `; \* |$ q( ? S; _' I' D, m/ c else inc A_i by 1' K3 s" {$ ^" c% S; x
end1 J! Y5 X' o$ ]2 a8 v
end! Y4 t+ J6 S9 j+ |
6 Z" K1 T. x) J( [- f% g+ v* nbegin P_pick2 arriving
$ d3 u8 Q3 |( M set A_i to 11* C4 `8 U7 F7 B F* y" n
move into Q_induct25 u1 [( C& A' I; H/ f
move into pickaisle.induct2 ^1 e5 P) {( o% J0 L
while A_i<=30 do begin
7 E% m% {4 o' z2 O% T, c* l- r travel to pickaisle.con(A_i)
. r4 a# a2 c9 O7 i6 r3 K& T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# X0 S9 X5 q2 X1 c3 z$ h* {; e
else wait for 10 sec. J- @4 [8 _. c
if A_i=A_leave then send to die
( E# Z: }0 f$ R0 C7 _7 _5 J else inc A_i by 1
* x& _; }$ V# U! y7 M end
$ O$ Z' `7 U; b* kend
7 Q' `% [4 E+ W
, l5 f B5 q. p) b8 Z" V- A; Nbegin P_pick3 arriving; a0 |! o2 D0 P) ]" I. H& Y
set A_i to 21, t; T( n2 e: o1 D3 q( @; \6 i
move into Q_induct3
/ ]2 w8 D+ m8 \) H move into pickaisle.induct3
- b2 a* ]8 n- [" @" m1 ^2 [ while A_i<=30 do begin
# Z" |- v0 z& F1 A travel to pickaisle.con(A_i)
1 y% F" U7 r; X. v: T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, T: w' d) |8 h& q
else wait for 10 sec
! u, s- K, H& U, q if A_i=A_leave then send to die
; k B2 r; b$ M U else inc A_i by 1$ ~8 t" i" x$ M( Q5 ~5 ?2 x
end/ H! X) t3 W# i8 [: Q6 m
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,其它按你的 ...
|