|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; z6 q8 w5 c- g0 m# y6 T N8 i: e7 F
, D- |! f" c) v7 Z3 F9 W
我的问题是,在每个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中的数值,不知道会不会有什么不妥。" S* ] i) x3 X, }/ ]
. L1 o& |) T N% H. |( y4 Dbegin P_read arriving: ]0 n) e$ ^! N) E: ?3 P
while 1=1 do begin# |5 N4 w; ?! B5 l" R! Q+ }. ~; w
read A_tote from "data.txt" with delimiter "\n"
3 i/ y% Q2 @' K8 K5 Q4 g read A_time from "data.txt" with delimiter "\n"
, k& C B" e" O5 R. B+ H read A_leave from "data.txt" with delimiter "\n"
6 p- j! a3 k, i. K1 H" A read A_picks from "data.txt" with delimiter "\n"
$ s! W3 P8 `& J$ h set load type to A_tote c+ S4 w" z* r$ l H
if A_tote="tote 1" then set A_induct to 13 v6 \' x/ b3 a% _
else if A_tote="tote 2" then set A_induct to 2
) v7 i( E& k1 |; W; z/ a, a% A else set A_induct to 3 $ Q ^2 U u6 V$ C. }9 U
set A_i to 0
7 T1 \: Y- J1 y2 |( P/ { clone 1 load to P_induction/ Q. Q5 p, p2 c
wait for A_time sec
, K# g0 h; k$ G G3 C$ {" P9 c end, N, k |/ v3 c6 M. S6 M
end
6 C( `8 k- u; s( G# _2 B$ d( I
% m* h. F4 S' s/ o8 O0 Kbegin P_induction arriving
# j" T0 j2 U5 t5 W; P$ d if A_induct=1 then clone 1 load to P_pick1% O6 D' W8 g& p1 u& S
else if A_induct=2 then clone 1 load to P_pick24 U: ?2 ~/ y5 y( t
else clone 1 load to P_pick3
2 ?) M+ C* t% ^$ [/ |8 [& Lend
5 P3 V: p, k8 j, t. V; p$ v0 E v9 V. O: [/ v8 M& \
begin P_pick1 arriving& |2 X7 w; |, n" Q- z
set A_i to 1 Q+ a& u& ?& a1 i
move into Q_induct1- ~4 Y Z2 W1 T5 q
move into pickaisle.induct1
5 ^. N5 M0 Q+ T5 A" U$ e; v while A_i<=30 do begin
9 A, i# }% ]) l4 f. D3 n! P travel to pickaisle.con(A_i)7 W$ n+ d5 [8 g
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 c0 ?) |* Q* M L& A J9 R else wait for 10 sec
, c. ?) r8 z' n if A_i=A_leave then send to die
2 B" F" N& ?0 f5 ~/ {/ G( [ else inc A_i by 17 X2 T4 l2 A3 ?' k8 y0 u
end
$ w9 K2 B- d4 Y$ Uend# a& i8 i. ~: t- B9 V
; d, {. C- s0 Q: kbegin P_pick2 arriving: I. g! A- a1 G% c0 Z
set A_i to 11) C: d- q% K5 |( S" W
move into Q_induct2/ v7 j' z |# w- g- c
move into pickaisle.induct25 ?, k0 a# g$ L% f4 O
while A_i<=30 do begin
. K! |) l0 u" A, R9 [ travel to pickaisle.con(A_i)
6 _* ~5 ~' L" X/ z5 n# Q) _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 A) d* m; T" V. u( G3 K else wait for 10 sec5 P [ D! `0 m/ H
if A_i=A_leave then send to die+ ~) P- p$ `3 G# Y7 _
else inc A_i by 1) W' M: s, ?& j, b" P
end/ i+ j; M3 s- S' H6 F! i! @2 ~( [
end# U3 K9 z x! g
1 V/ _- T; l$ o, _begin P_pick3 arriving3 z- j# B, w; ~/ X N, G
set A_i to 21
! l1 E5 c% _3 L4 B% }" e move into Q_induct34 z: M) M- T4 o3 ~4 Y* t, g0 w/ Q
move into pickaisle.induct3
" `/ n8 T, d0 F: \+ o while A_i<=30 do begin' R9 _ M* o& F% W' a: \, o8 S
travel to pickaisle.con(A_i)1 b5 r0 u8 Q5 Y5 ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ m- N! p) z' I! Q$ n5 I
else wait for 10 sec
* ^3 ] D! l! l5 V/ H- U+ a if A_i=A_leave then send to die% q' Q' D- F t, X7 z1 Q
else inc A_i by 1
" R6 N; Y- d8 l" l$ @ end
) T4 O1 a* b1 b% zend |
最佳答案
查看完整内容
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,其它按你的 ...
|