|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 N& V+ g( O: n$ v/ C! ]
# c: L. Y7 i) K- K" A我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" H. e) L" \/ L5 X
: @7 E5 k$ h/ Zbegin P_read arriving
* H9 ~4 R; Y6 k3 z; E while 1=1 do begin$ K0 |8 f! F2 _ q
read A_tote from "data.txt" with delimiter "\n"
; s! l/ x8 M( }8 }2 D! R read A_time from "data.txt" with delimiter "\n"
; L5 j- ?/ {& J" p' Z2 E0 Q read A_leave from "data.txt" with delimiter "\n"
; o' L" O7 L: P5 C1 x& G# ` read A_picks from "data.txt" with delimiter "\n"
% \& e$ X" h- d) s; Y: M set load type to A_tote, x1 k2 H t# y7 {. F+ `3 E, z5 k4 R
if A_tote="tote 1" then set A_induct to 1
0 D/ `4 p# K7 T$ L else if A_tote="tote 2" then set A_induct to 2* o) |$ [' K- Q3 E6 i
else set A_induct to 3
# f: p* w# G! L( }& j set A_i to 0
R0 x; H& C! u$ k clone 1 load to P_induction/ f6 b3 E- p* v+ e2 K; U
wait for A_time sec1 w" D; m5 P$ v3 C( |
end
' j* b/ t) l' I! dend
# _ ~1 p* R# s8 w, M9 n0 @. h2 |- F2 K
begin P_induction arriving- |9 n1 F- u5 x' V/ ^
if A_induct=1 then clone 1 load to P_pick1
3 z1 r4 L& Z4 \1 g( U/ A$ F else if A_induct=2 then clone 1 load to P_pick2
2 P. Y) `( _1 z+ y5 I else clone 1 load to P_pick3
. }3 }) z* p: S4 Aend# g9 I; j/ S" q5 D- A# v3 ?) W
+ q9 Z& D" N$ |, H/ F& d
begin P_pick1 arriving
6 m& ^" M) `$ _6 W; W set A_i to 1
* Z& P( a8 @- z4 Z: @+ c; w/ z0 L move into Q_induct1
& ^) Q" O$ w8 S2 @1 U/ ` move into pickaisle.induct1
, T3 O* z6 X6 ~/ Q4 T3 k, Z while A_i<=30 do begin) w9 l) Q' m- B d/ s
travel to pickaisle.con(A_i)
1 t1 V8 J, K; z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( ?- j5 F9 B8 U; p4 `
else wait for 10 sec
- Z# r" b+ f1 a$ ` if A_i=A_leave then send to die
# q- \7 \& L- y1 [; h) o else inc A_i by 1
* C5 ~. |9 _- E& w$ `& Z4 i end# f1 U/ z2 |& Y+ A U3 ^1 i% }
end
% m! t4 s9 A) m* t( ^% |. a0 ^3 p- f! K3 C9 G/ ~) m
begin P_pick2 arriving
+ g( h! t8 v2 x/ r6 n set A_i to 116 }1 `0 [* T+ y/ P
move into Q_induct2
1 [1 ^# l0 L3 C: K$ j( B" c move into pickaisle.induct2+ e/ g( V' A" W# x! U
while A_i<=30 do begin
! s$ `5 c+ c0 e( A7 D5 ] travel to pickaisle.con(A_i)
, p5 i5 F% l9 g$ K2 b* |9 y3 S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 Z1 h# ~2 ^& |& H6 ^/ s3 R
else wait for 10 sec
. {0 E, A. G& O. E if A_i=A_leave then send to die: H6 J+ N$ U8 m
else inc A_i by 1
4 ~2 ~4 C6 V: N% d! o+ |& N end
" Q, p+ R) }5 ^/ i; dend6 V5 V8 Z! x1 a& c9 S) ]7 v- r c
+ ~( x4 h; D! M' }1 Lbegin P_pick3 arriving
2 `) u3 ?0 R: l; n; d, n set A_i to 21$ r8 F1 l! w/ e1 p
move into Q_induct3# J6 e' |8 J: w+ U
move into pickaisle.induct38 G1 _6 V5 ~. |4 @! J8 K5 f4 j
while A_i<=30 do begin! Y4 P, b* x4 |* a+ \$ w
travel to pickaisle.con(A_i)+ A7 q' A7 ? s6 `+ `! b5 f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& O9 x: q3 S% p3 x2 s( R6 g0 u7 n
else wait for 10 sec4 D3 \* X* j+ L" {! I H# @
if A_i=A_leave then send to die! m. E" I. B- E' P
else inc A_i by 1
3 L' _1 {- X# S: W3 x end' Q1 a" P8 B8 g9 r' 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,其它按你的 ...
|