|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 \8 k6 V o! f
& h4 _. t( a& X' |5 |/ z4 g" g( [
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. x1 J: W+ c* o. ]$ [ s* n
5 S" M& c% H, Q
begin P_read arriving
- f& h4 I) t6 S3 a while 1=1 do begin" X( v, r! C+ Z9 m5 S8 W
read A_tote from "data.txt" with delimiter "\n"
* k4 F9 E t h5 ]" j1 r read A_time from "data.txt" with delimiter "\n"
0 i% H$ t6 u9 G7 ] read A_leave from "data.txt" with delimiter "\n"1 F! d7 g/ \ c
read A_picks from "data.txt" with delimiter "\n"
# y! |6 ^) A3 a' _& M- [ set load type to A_tote
. J9 R: i2 ?1 O5 F3 y if A_tote="tote 1" then set A_induct to 1
3 z9 M# M5 u7 Y! R `3 p else if A_tote="tote 2" then set A_induct to 2
1 R+ ^* ~* B6 I2 F2 w4 }7 f( A else set A_induct to 3 * T$ f/ [# d+ J: Y6 ~1 K7 Z
set A_i to 0
! [' `' x; M9 p clone 1 load to P_induction
. h! V8 g* Z0 `" { wait for A_time sec8 O$ R2 [. _8 O) }# M
end
0 {$ x" g" y0 T: W9 G: c: ^end! M0 r9 \3 r& t% ] ~4 D B8 a9 y
7 F: _6 {$ h! c- E+ _1 zbegin P_induction arriving1 K5 V; Z! I/ w T- w$ ^. S
if A_induct=1 then clone 1 load to P_pick1
1 Z3 r- r9 x# V2 D: L0 E+ r5 S5 V else if A_induct=2 then clone 1 load to P_pick22 Y+ Z a, Q) N( C/ k( u
else clone 1 load to P_pick3: L; W6 Z0 N+ \. S6 ?: A/ _! g
end
# ]. m2 T2 s' W. d1 y
( m6 I9 {1 C6 p2 j4 B* A: X% x3 _% f. {begin P_pick1 arriving# b( `/ w" |8 T- S$ x/ e3 O1 X
set A_i to 17 B) S7 r; W* k3 E
move into Q_induct1
* C% S& D7 }$ w L1 r move into pickaisle.induct19 V9 M6 M$ O6 b9 J
while A_i<=30 do begin2 f" G3 |0 @' H6 _
travel to pickaisle.con(A_i)" d2 p7 M7 U7 R5 r* d1 A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 k* W7 |6 T8 M5 {
else wait for 10 sec1 c5 n4 ?' X5 M# j/ ]/ g
if A_i=A_leave then send to die) \# Z+ _5 @6 \/ e- ^" l
else inc A_i by 1
; Y5 ]7 B1 V$ |, @( c" c end
9 Q& Z3 I7 Z# U! @( Q2 kend. y+ e/ J+ x2 |& r$ e0 r" D
! c$ e* r+ A" N
begin P_pick2 arriving) h% H5 x2 l* F. u& R- i4 |' N
set A_i to 11( R u0 L G- ?/ |
move into Q_induct2* Q9 x* q) Y$ W& I
move into pickaisle.induct2
1 ?3 h; Q% j+ \+ r5 ^ while A_i<=30 do begin# _* g2 L$ j% d, W R
travel to pickaisle.con(A_i)
7 k H. t( [, T& }4 @ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ r$ E! K$ i3 h( w/ @* A3 J
else wait for 10 sec
9 `' X' ^' F: R. Q( ?9 N. B" J if A_i=A_leave then send to die
; Q! ?" O% t7 Y else inc A_i by 1
5 x7 [; e% V2 l' R end( l" p3 U& p4 v4 m% X
end$ L; d1 M- ?# s6 d
3 P8 Q- H/ p' ~begin P_pick3 arriving& O# ?% x) c; y3 z, L% c: v
set A_i to 218 G2 V W2 _, W# n' j" J6 f+ V0 V
move into Q_induct3+ R4 _( V5 c3 v0 A! `5 e4 S
move into pickaisle.induct3
2 A9 u0 s0 g8 d; ?2 R" t- Q& o3 H6 V5 r while A_i<=30 do begin+ a8 g& P9 d# ?: p7 O
travel to pickaisle.con(A_i)
- }8 x$ W+ Z7 t+ ?$ N* ^1 ~1 L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 }- L1 _7 i* X/ t$ E2 A" c" M" n else wait for 10 sec
) L3 V* f( Q. m- f& Q; B if A_i=A_leave then send to die
6 h# x& ~6 w& R& d else inc A_i by 1 t5 O" [! k. r0 [ G3 A/ T0 n
end
$ k3 N U. O6 w1 d% B( s- uend |
最佳答案
查看完整内容
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,其它按你的 ...
|