|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ p) x' ~( B3 W. A! ^$ _4 E$ D$ E
) J1 @6 J" ~# 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中的数值,不知道会不会有什么不妥。
2 k% ^1 p6 q! r/ S% \. K2 J% i' s, z# Q! K1 n, f. S3 T* ?2 x
begin P_read arriving0 z7 P* C! O/ u( N& @9 N7 T- T
while 1=1 do begin
7 \6 G. e2 ]1 S" t) r4 S( N6 f5 m read A_tote from "data.txt" with delimiter "\n"; e* g' n8 g' ?; K
read A_time from "data.txt" with delimiter "\n"4 M& n. Z) ]3 E# W6 ^
read A_leave from "data.txt" with delimiter "\n": c( @# }' \% A o
read A_picks from "data.txt" with delimiter "\n"# s6 U0 ?1 @1 T: F* f! W% h; X& e
set load type to A_tote, y9 S) k% g7 |) w
if A_tote="tote 1" then set A_induct to 1. h7 M+ Q3 H7 h0 \5 v" V. z9 _
else if A_tote="tote 2" then set A_induct to 2 Z7 _1 F& k- T7 K( w
else set A_induct to 3
1 r5 q4 M6 O [ q set A_i to 0
9 ~5 H9 H. A( O8 b clone 1 load to P_induction3 A: F$ ?3 Z' }; r& a+ d' u5 S
wait for A_time sec2 d7 U4 u9 Z! m8 c: G
end
. r6 X. U; J# a' N8 Lend
: ^4 B+ ~: e! ]# R8 Z# n. d K4 w7 V6 D* G
begin P_induction arriving' \# Z N$ {" f6 f7 {5 j2 w& i% Q
if A_induct=1 then clone 1 load to P_pick1) m" E0 i7 P* A, @3 n" b( b
else if A_induct=2 then clone 1 load to P_pick29 o% b& k1 x' w7 T) Y3 g
else clone 1 load to P_pick3
! v4 K; [( N( w! Iend$ N- v7 D( `; V6 E
, Q/ I8 V6 \3 V! p5 z: D2 [' f1 Qbegin P_pick1 arriving
9 P0 n. d3 m3 ^7 L v' ^ set A_i to 1
+ t" B. l, T" ^3 g' F move into Q_induct1
$ P4 F6 l+ f" O, E2 X move into pickaisle.induct11 i8 W$ c5 K3 E0 S J7 c
while A_i<=30 do begin2 A5 R4 X: r, y c2 \% m, d* a+ I
travel to pickaisle.con(A_i)3 T v! x+ ?% i1 ~* T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 J7 P) M" }- Y% i6 ]
else wait for 10 sec
! q. m* p8 J9 O if A_i=A_leave then send to die2 j% ?3 e" Z/ V9 _2 }0 J
else inc A_i by 1
5 Z& u- T' E6 _6 S6 ~4 J. Q end
+ l1 Q1 c& S$ E2 Hend
0 a2 R. n9 @. l" ]( f+ E* [) F
2 } L6 L$ f0 X5 \! {begin P_pick2 arriving( h7 a2 ]$ N( _2 b& \; O
set A_i to 11
& y+ I) a, r2 l v move into Q_induct2* a( M$ m; [8 A( j0 K* }* N+ T& O
move into pickaisle.induct2* N; [% a! @+ v: E
while A_i<=30 do begin
0 a# W2 d$ f! [. p travel to pickaisle.con(A_i)1 D* @8 L" F# B0 E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec E' |- [" F2 n; X
else wait for 10 sec
7 C! d4 v& Z+ K, P/ U w if A_i=A_leave then send to die* U5 ]" v, v2 Y! t# A6 j% D
else inc A_i by 1
5 ]( m, `0 [/ b% T8 L; i end6 U8 N# M' {6 ^! s8 @# E+ G
end6 u5 F% t4 `9 K( ]6 A @, N
4 v* I6 p" B' t8 Ubegin P_pick3 arriving) T; {" s2 W0 u/ C
set A_i to 219 h; }: s0 g, [) }
move into Q_induct3
3 g4 V9 G: W N" l' ^' i! b! g move into pickaisle.induct3* F! d! U) h Z: K: Q$ B, B% H4 H9 }
while A_i<=30 do begin: O4 @7 `8 g/ l p
travel to pickaisle.con(A_i)
& Q3 y+ V" O0 M) r& y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, X0 F8 g* ^& Z- i+ V T else wait for 10 sec9 y; w: S2 C& ?
if A_i=A_leave then send to die
7 {' {! Y) U+ A5 @* R6 J else inc A_i by 1
. p" i9 A8 v% ^8 J; C2 ` end; u3 u2 K; P3 F, ~% Z
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,其它按你的 ...
|