|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 y6 b8 C T& O( D, k$ q5 p
( A1 r4 y* x4 U1 h我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. x+ Y# j% t! [3 D& L* \7 Z# g( D# D
- ]0 h" d5 h* t7 [% n* X) O3 dbegin P_read arriving8 n8 u* j- B9 r: O! r( i2 [
while 1=1 do begin5 R% ^. W/ {/ V( k$ [: v$ y0 }
read A_tote from "data.txt" with delimiter "\n"! c$ G5 f* }. n* v2 S9 n
read A_time from "data.txt" with delimiter "\n"
. G$ k2 S# h, Q4 | read A_leave from "data.txt" with delimiter "\n": @$ r5 S4 r8 d; \ _) f& y( }. ?
read A_picks from "data.txt" with delimiter "\n"- f5 Y8 w: `# }# B5 _( x0 M
set load type to A_tote
& S/ I3 D( s7 n2 U* \ if A_tote="tote 1" then set A_induct to 1
8 J" h+ {% |; ]* w else if A_tote="tote 2" then set A_induct to 29 d5 F; B* A4 U- v+ c
else set A_induct to 3
1 ^. o. y/ H0 o4 @6 B set A_i to 0
: g" F( s c- X6 g7 c clone 1 load to P_induction
: Y' i2 N0 a7 @- [- t wait for A_time sec: W+ {* a5 N5 ]( U
end/ |, s! x: m3 j% K; T
end
4 [! M. F8 S2 _. w' k0 i' V, m7 h6 Z2 Z o5 s5 s
begin P_induction arriving: o/ [3 w% g/ Z
if A_induct=1 then clone 1 load to P_pick1: x4 K) O3 H6 H/ m( H5 w H
else if A_induct=2 then clone 1 load to P_pick29 w) O% ]. r+ H; @9 k( p9 u# l
else clone 1 load to P_pick3
' |* _* C4 q. G- A- b9 uend [+ K1 r9 V+ k8 y: [: r
7 r5 u9 k# \' rbegin P_pick1 arriving
1 J2 R7 y. N+ U, }, L set A_i to 10 Y( z$ n- \. e- K
move into Q_induct1
9 }0 T$ w" ~8 C6 b$ y: I; } move into pickaisle.induct1: k1 ~) E: u# g2 w4 t- u `1 M
while A_i<=30 do begin* Y4 j ?! l1 L8 y$ z
travel to pickaisle.con(A_i)
# g2 W6 ^8 K& X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, w- \: |: `- y% f1 a* t1 b else wait for 10 sec* s* G( ?3 S Z7 }. m5 G+ V% r$ Z( M
if A_i=A_leave then send to die
" ^7 e# j, Q& H1 a else inc A_i by 1$ V9 z$ }; z$ j- }
end1 I. ?0 A4 z) w! d# l1 L) t q3 \
end
# M1 r* c1 e* s; c5 k/ R5 H0 o6 }' j) b% E
begin P_pick2 arriving
; j( Q U4 L. F$ v6 q; N set A_i to 11/ _$ w, I) @( c- C% M* U
move into Q_induct26 c& S' x2 L+ _/ G' Z* a# P
move into pickaisle.induct2& N6 i7 k! r; z; D5 \, K
while A_i<=30 do begin
6 J8 ~& M5 M3 Q! G$ P& E* z travel to pickaisle.con(A_i)- ]( {0 F" M! J) J0 Y( O! [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% k+ {3 @7 e9 ]: [, S+ M' q
else wait for 10 sec, @% v% P5 U" M) J, V+ |8 D! M
if A_i=A_leave then send to die
6 `* R' @7 j, E. P. @" j else inc A_i by 1
. w1 v5 {4 m5 N7 s# f/ d0 |+ m d end
; ^3 g3 J o/ P" V# O+ Z3 Xend
4 h; w4 [% i/ T1 q5 m7 e2 w: J% U2 @6 s: P
begin P_pick3 arriving) P+ F5 N( ? D
set A_i to 21" l1 m% Y3 h4 G( |' U$ h/ |( v
move into Q_induct3* M1 m4 g; Z1 W0 E% d2 Q% d3 f
move into pickaisle.induct3- I' y9 v m d! g0 O! s
while A_i<=30 do begin* A: B5 J. Z* A/ v M
travel to pickaisle.con(A_i)
' c4 R/ j. P' {7 T, [7 W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 \& D4 d0 k5 j/ r x8 g
else wait for 10 sec
8 ?/ t' f e: }: J+ y. [ if A_i=A_leave then send to die
) @0 Q5 t5 P) G4 D) s else inc A_i by 1
) F* n! F4 J7 f9 I end
$ a' S1 j0 \9 u) | o$ g* B5 dend |
最佳答案
查看完整内容
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,其它按你的 ...
|