|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 y1 a/ \, |* L! m" R( |9 I& g. g! c5 R+ V4 v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) s1 `. a" I# r' u i5 b. k5 u( `9 `0 N5 D8 P: D7 x
begin P_read arriving
/ ~. i/ i1 j! M9 s' G while 1=1 do begin
& l/ k1 w0 [' K) n' J' ^2 k! B$ N" G read A_tote from "data.txt" with delimiter "\n"
! e! m) M" H8 m, I/ @& P4 C0 s read A_time from "data.txt" with delimiter "\n"
, M4 I: S" S9 c8 F U; L read A_leave from "data.txt" with delimiter "\n"- u. G% X3 D8 w: f5 ?! p8 z
read A_picks from "data.txt" with delimiter "\n"
3 @+ Y# L% S, m8 p* N1 o set load type to A_tote# K8 p6 {5 p4 A o5 ?2 a, z v1 e2 i4 r
if A_tote="tote 1" then set A_induct to 15 {7 T; y6 ]" ~5 y( o: J
else if A_tote="tote 2" then set A_induct to 2: [8 T; L; q& V7 `. m
else set A_induct to 3
) u+ [6 b; q: T* M0 ]" m2 _4 g1 e set A_i to 0
~3 l4 x. k# c( Z" Y" D _: B clone 1 load to P_induction
* L9 Z+ y9 \" [ wait for A_time sec
) H- ?$ F) s$ o end# G. \ f1 J% J( _& q' e# j" E: L
end" W2 W$ s: W2 m7 L: c3 Y/ Z
6 i/ k. \5 T+ ~% e3 O
begin P_induction arriving
) {0 t+ |$ g/ V% [2 N" T3 E5 D+ \. g if A_induct=1 then clone 1 load to P_pick1" b& q! |. X2 a! _
else if A_induct=2 then clone 1 load to P_pick20 h5 l+ G3 J0 ?
else clone 1 load to P_pick3
: o! c% M5 B5 |1 K C# ^end! I0 o0 B* k* z k5 H& M: S; B
4 _. U4 T- v9 V( m: zbegin P_pick1 arriving- b" y% B' c. k: ]% y
set A_i to 1
1 ~ d7 R, I9 j# s move into Q_induct1
+ o4 t8 N- ]. H/ t9 n% J0 h+ h& c move into pickaisle.induct1
5 E. p/ p7 C% b& w4 ] while A_i<=30 do begin: A% ?0 m, l, ?1 f
travel to pickaisle.con(A_i)/ \/ _4 e9 a, {2 X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' h( v8 v, }# O) R else wait for 10 sec
* j! N- g9 [& u- x# Y' ]8 \6 F if A_i=A_leave then send to die* H9 N0 T* J f% n; |8 q
else inc A_i by 14 s+ R7 r9 C; j' y; t7 O
end
4 t. _# \7 y* k( K$ _2 l+ ?end8 n2 d' e; L0 l
/ t$ q9 K1 y+ D3 S0 v( J6 ^+ G" cbegin P_pick2 arriving$ y1 u6 J8 V0 x8 ?2 I9 u; o
set A_i to 11$ C4 x9 @6 y# u6 n% R8 j" m4 T. P
move into Q_induct2' \" C5 a4 R5 r4 h w0 q$ ]2 Y) V
move into pickaisle.induct2# v# n; S3 ]2 Z! G7 l: q* J* f" ^
while A_i<=30 do begin/ g" Q- ]3 Q3 Z; p+ R
travel to pickaisle.con(A_i) E) K' x! T% K# E! [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 K- z4 \+ x3 Z! j5 [
else wait for 10 sec( D6 l# W s8 u
if A_i=A_leave then send to die3 e! W, ^ z a' J- ?
else inc A_i by 1* D1 b# H- R% ^2 S \7 ]
end a, A$ s4 v* x4 _; o9 i q
end$ |5 v# r% v+ M& O. b
& R3 |* Y. p) x2 F( Gbegin P_pick3 arriving
# |/ ?$ r! i% @% } set A_i to 21
' } Q7 k1 Q& n- Q move into Q_induct3/ v; I6 i- I( [7 d4 ~* o
move into pickaisle.induct3% @) o g% P# O L, c
while A_i<=30 do begin
0 \" @# v) [4 v0 H/ v ^ travel to pickaisle.con(A_i)
' H$ c0 `( O! L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! |2 p. p9 o- Z8 r% o: S* C
else wait for 10 sec: h+ X# ]0 D# U" H- ] T' P
if A_i=A_leave then send to die
8 ~; w4 d3 j, n3 ? else inc A_i by 1. ^ r- ^- z6 m& j! I
end
+ o2 ~- o: @1 d% I: 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,其它按你的 ...
|