|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ z9 Z3 \- E/ u0 O5 P, D: r2 S: U( m+ Y! x/ K" X0 H; 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中的数值,不知道会不会有什么不妥。6 [8 [2 [$ R# s
1 p# N2 q7 Y- l! Q5 U
begin P_read arriving/ I# c7 M/ H3 G# o/ L: {& l
while 1=1 do begin' _0 F; a+ R6 p( Y* a( L
read A_tote from "data.txt" with delimiter "\n"" |2 q9 A& Q( X- c) J
read A_time from "data.txt" with delimiter "\n"
3 K6 G( S/ d: F$ F; ]; C, a read A_leave from "data.txt" with delimiter "\n"# i5 G. d; D; n3 D( R5 a
read A_picks from "data.txt" with delimiter "\n": S5 d' u& T% S }
set load type to A_tote
8 h& h- n a9 u6 [, P3 E if A_tote="tote 1" then set A_induct to 12 U. s; N. g0 p
else if A_tote="tote 2" then set A_induct to 2
6 Q4 S0 C" n$ I3 i else set A_induct to 3
1 N! A2 l- H8 ]7 M* n set A_i to 0, W, y6 Z/ w5 w# }. @: j
clone 1 load to P_induction
1 B3 a. Y3 k( a; @) c wait for A_time sec
% f. C i( _8 ~: W! s end
1 g( k8 j+ C; s7 U6 Q# iend8 k U/ a8 v& a: H* A) r
5 M6 a9 L! g7 O$ W1 n
begin P_induction arriving4 P- Z" x7 K1 `7 w3 [9 j
if A_induct=1 then clone 1 load to P_pick1
. b% A" A7 T- |" H' ^ else if A_induct=2 then clone 1 load to P_pick2
5 s4 ~7 s0 U* {) J% Y7 `- ~6 D else clone 1 load to P_pick3
* x# K w3 U, c5 ~5 C1 T4 Send
! Y/ u7 Y t& n8 e2 g( K& Y
8 r/ Q, `" S Wbegin P_pick1 arriving
& f# |, q1 {& f set A_i to 1) z- F, b, u# _/ _! d9 I& `
move into Q_induct1
% u# O# Q3 {9 o: U, j" E( N' _ move into pickaisle.induct1
/ k/ _( H1 w. A- _; u% u. n1 s, p- M while A_i<=30 do begin' J- x( Q- p+ p0 l8 ?9 Z! Q; H5 g* j
travel to pickaisle.con(A_i)
- j, o7 Y5 o2 E1 H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 }# }6 S3 F) U1 Z4 e
else wait for 10 sec r `* Q' K3 d- c5 [& a
if A_i=A_leave then send to die( E% Z, W+ `# G/ v* \! _/ H
else inc A_i by 1
! c1 {1 `6 ^( H4 r+ z3 Q end1 Z; P& T E5 P$ K+ T% d4 P. P
end! ?$ Z# c4 e5 ~) @2 G
x6 r8 @& i) F" i! a6 N# X' w) n
begin P_pick2 arriving+ C( y5 m4 O9 P! y( l; `
set A_i to 114 ?; L: }2 J% e) y
move into Q_induct2, o9 P& |: z; Q2 h5 v
move into pickaisle.induct2
2 I/ J8 u( f7 M5 x1 {2 N ? while A_i<=30 do begin
4 l9 q% |: ~9 g6 c1 y- d travel to pickaisle.con(A_i)
! |( G$ C0 R1 u- a7 V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. X7 C" B9 W/ ]; M
else wait for 10 sec# E {" R) v" r2 d% {& o2 r, O
if A_i=A_leave then send to die
* Y# _$ g8 p* o1 K. E0 i4 O else inc A_i by 1, K# I+ g, S) `4 \. W" h
end
) ]) c. D) z2 {% l7 H& oend7 t+ X4 v* ~ ~3 ?7 N2 K
" L7 J9 U1 d, ^ C: B/ pbegin P_pick3 arriving
! N6 l2 u3 l3 v9 T% n/ c set A_i to 214 ^3 ^5 a# g5 G& O& ?
move into Q_induct3
0 C7 E. P! D4 F% d) @- r5 q& } move into pickaisle.induct3
" G5 ]7 q& R6 t1 G, t$ U( v2 s while A_i<=30 do begin ^+ T( u1 N. `1 K; m1 K
travel to pickaisle.con(A_i)5 a) m0 ?) V y$ D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* i% E# J0 p# ~: \ else wait for 10 sec$ V5 _8 Y6 d9 s0 T' q1 U% V
if A_i=A_leave then send to die
& s G4 I, D; q" B* }+ M5 Q4 W! f else inc A_i by 1) E- Q7 |$ V) `" p J8 I
end
$ |3 r% m- V8 j2 pend |
最佳答案
查看完整内容
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,其它按你的 ...
|