|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' v$ d8 m; f8 T0 J/ m: I1 L( }. C0 c- ~, P
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, C3 f; X5 N+ i L3 _
5 [: x O: `6 ]! mbegin P_read arriving, r0 J# z) A6 Q k& _: j5 R3 o
while 1=1 do begin
8 K7 ^/ f! `7 Y7 C K2 w( C% ] read A_tote from "data.txt" with delimiter "\n"
" S& [& n6 ^7 f! U m W read A_time from "data.txt" with delimiter "\n"4 o( i- b) N- Z6 w) p/ A
read A_leave from "data.txt" with delimiter "\n"9 }' l' F; U# p
read A_picks from "data.txt" with delimiter "\n"7 U. w2 u |4 i* p! D1 p4 L
set load type to A_tote1 L/ q" b. O1 l/ |
if A_tote="tote 1" then set A_induct to 1
. o% T# P: w% `( g3 k* U else if A_tote="tote 2" then set A_induct to 2" ~+ I: w1 l, p: A% i+ n0 W
else set A_induct to 3 3 s3 x( a. n$ X5 S1 a# }) o1 g N
set A_i to 0
4 G& @! K4 U7 ~+ u$ S clone 1 load to P_induction
5 b5 H1 t0 {/ n6 z. g+ k2 n3 `% ` wait for A_time sec. c3 e8 O+ T; e$ ~% y: K0 D
end
' c, P4 R& W, f: ^$ V2 Y- Xend
$ u! p' R" b) `% P, R
% e3 x; R; z& qbegin P_induction arriving0 T. B m5 J! A7 L5 B4 }7 r! r
if A_induct=1 then clone 1 load to P_pick1
* D2 G" J! F/ K% ^ R6 Z( u; ] else if A_induct=2 then clone 1 load to P_pick29 w3 p/ N( z F7 f
else clone 1 load to P_pick3
u7 s. B7 n W& X2 Bend+ w' k* }) `# e$ s
3 O! m7 s, ` I7 w, h+ hbegin P_pick1 arriving3 r k( _8 b0 x6 C0 @, F
set A_i to 1( m: S% F- Y/ o' j9 ^
move into Q_induct1
1 n! s+ R1 V1 e" b! B6 V5 G* O move into pickaisle.induct16 { |; k6 M8 V( g$ R
while A_i<=30 do begin
6 x- D1 D, W+ X travel to pickaisle.con(A_i)* Z7 e+ f% X- I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* N- ^5 }8 v! \& {5 i3 _+ h0 Y: A else wait for 10 sec
8 D- M: P3 q) g if A_i=A_leave then send to die+ N, P) O, i4 n7 ]
else inc A_i by 1
/ X! A- ~7 e6 F8 M( Y) D7 o2 r: j# I6 @2 b end# {" ]( V5 ~- y3 Y! D! ?# B
end
' P) H8 o/ r \, W, }2 q
3 a. ]& K3 E" @; dbegin P_pick2 arriving
9 c5 n; C6 h) D( y set A_i to 11
3 J1 n3 `5 W# l( h* B5 s move into Q_induct2
( f6 |* L9 R/ e. m: u move into pickaisle.induct2
: a; Q6 m5 c; u* x while A_i<=30 do begin
2 ^; g! K+ V7 H1 e! `" I travel to pickaisle.con(A_i)
' P! ^: ?* }4 R5 B0 Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 O- T& S9 ^6 T8 U else wait for 10 sec
& j/ T# w# ?, u4 G3 Y7 y! q, L; d# L if A_i=A_leave then send to die; }; l. h, q/ }5 Y" N5 k# q
else inc A_i by 1
6 g+ E, j* ^6 J6 { T end
3 p& O) C+ O [end7 E1 z$ y+ k# \6 r6 U9 @, b5 ^
. ^# S2 ?/ k+ s# \8 E" H: w Xbegin P_pick3 arriving
7 F0 J0 b( X( H: B1 h% `9 A set A_i to 21- F' r$ t- r6 Z+ I/ t' d
move into Q_induct3
& R6 x. X( K" L move into pickaisle.induct3
j5 u2 [+ ^, I i" U7 y% Q* H while A_i<=30 do begin
' p% L. i( _ [0 N travel to pickaisle.con(A_i)
8 Q2 B* @0 d n9 R( @6 H8 a/ _& ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 V- {% o, m0 D' Z% N4 s( d* r
else wait for 10 sec" h% H. Z) @* o: \9 X/ s* y6 u1 B
if A_i=A_leave then send to die8 ]- O, ?5 M2 f: }9 f- E @0 o
else inc A_i by 1% L% {$ {4 W8 w* q* ?6 B3 B6 {
end) i. r) M8 x; Z4 K) h
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,其它按你的 ...
|