|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 E& Q0 r. p, A# A0 S
, l) I/ i! W& ]6 I7 [我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 ~) {4 ~3 r7 J4 G+ r: w! G: ?: o2 y6 k
begin P_read arriving( R" y% a u2 ^; E
while 1=1 do begin- }- R+ [% ]) n1 t
read A_tote from "data.txt" with delimiter "\n"
0 K2 O9 j/ H& W/ ?/ J read A_time from "data.txt" with delimiter "\n"
Y9 j6 b& y- |2 [ read A_leave from "data.txt" with delimiter "\n"
, q7 l# E( c% q read A_picks from "data.txt" with delimiter "\n"
) @# u7 U' u2 }" n. ^, Z" |% | set load type to A_tote
* b M1 Y+ |1 ~8 B8 c2 ]2 p if A_tote="tote 1" then set A_induct to 10 K# z1 H. y$ B8 a
else if A_tote="tote 2" then set A_induct to 2" o( L$ g1 J$ D* o( \6 c/ B
else set A_induct to 3 2 r6 _; Q- ?! G3 k/ H: |6 |+ H
set A_i to 0$ ]% s9 `( [+ ~* _' [
clone 1 load to P_induction
" U( Y: G8 D2 W& S wait for A_time sec$ L6 G0 C9 O# Z( m
end
& G" J" I& a+ E6 vend
- _9 i- s" F; @& S8 x% h4 m6 k
& b W* Q/ F, w* l( m/ c+ fbegin P_induction arriving A1 t. Q0 G7 s- J0 `5 Q
if A_induct=1 then clone 1 load to P_pick1" S9 \% V* m% o* @
else if A_induct=2 then clone 1 load to P_pick2$ i* W& I: e1 f/ ?4 B1 A
else clone 1 load to P_pick3- z1 g2 Y. m7 U6 q0 B
end- I: j. k! t. k. @+ i1 O
) V# |1 h+ R. xbegin P_pick1 arriving
4 c! s; G. Z! k5 t2 ]" P2 A0 m set A_i to 1! V# K2 Y9 Q) F* v
move into Q_induct1! L6 f/ W" x$ z5 h
move into pickaisle.induct10 \6 Q$ w2 [+ t" r
while A_i<=30 do begin
; e- b6 i% {; {, L travel to pickaisle.con(A_i)+ R) b s" s: f% \1 }5 b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 c7 ~, B" g2 c8 Q% C. ~" j
else wait for 10 sec
( h) N0 N% X1 o; T4 H if A_i=A_leave then send to die5 O8 s8 E" a V0 s5 t
else inc A_i by 1
8 J; Z( V2 w5 d* [ end
' a d j8 t8 `9 u* m/ nend3 b1 X5 S6 Y4 J# P! z- u; R
+ Y% q7 A& ?2 r C; p" ^
begin P_pick2 arriving
% X% |& d+ j8 Y3 X set A_i to 116 |1 X7 G9 h* L+ j" Q/ \
move into Q_induct20 R* q. E6 F; p1 i7 Q( V- j
move into pickaisle.induct2
' y$ \6 t$ { C' D while A_i<=30 do begin
4 t+ d- H0 x0 ] travel to pickaisle.con(A_i)* i6 `3 a6 B; P1 F" O1 x0 @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 s; m: ^& h Z
else wait for 10 sec! w* N2 \# |: d* x2 w
if A_i=A_leave then send to die" r! ]0 W+ R- C: M: C2 b9 [
else inc A_i by 1
/ O( e5 K* l# p- s; v' k end& l- Q/ r" t& W
end3 l, b) [ j; j( y
3 }' |; A3 B# P7 \$ D. xbegin P_pick3 arriving
! [: G7 Z+ @) v3 }1 Y9 A1 z set A_i to 21- E9 [' t" J0 @0 ]
move into Q_induct35 n. W; R' ]# g% q3 }5 o9 ^
move into pickaisle.induct3
3 n& Q/ Q- n9 w! \6 l( S7 G while A_i<=30 do begin+ Z6 I) w3 I( R1 T$ }9 o# G3 F
travel to pickaisle.con(A_i)" c% i! I" y1 P' H, M% C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 d9 b7 W) L* K8 A$ H" {2 s. ?
else wait for 10 sec; h* I4 n5 ~+ A6 i
if A_i=A_leave then send to die
2 i; Z! G& s9 B" b1 w# E5 x else inc A_i by 1
- {) W8 ] ~4 K0 Q! J( V) { end8 p9 l% a1 K4 M) Z$ t2 j
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,其它按你的 ...
|