|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: S+ T* _4 o' T8 ?+ @
, t+ R" o9 @8 c8 ]: v% D我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ p0 i$ G7 J7 y
3 b3 E# h, m6 p9 {
begin P_read arriving
* w2 N9 a" Y7 B# `( u while 1=1 do begin$ a" ~% _0 u \5 w
read A_tote from "data.txt" with delimiter "\n"
( Z. p6 [' j2 j. ]! i* N0 { read A_time from "data.txt" with delimiter "\n"
, x& a: Y" j; v! D( G% w$ O6 I read A_leave from "data.txt" with delimiter "\n"! w* L( W1 z( ~) v+ T5 x2 j7 U g5 `
read A_picks from "data.txt" with delimiter "\n"
& Z: L, |( F5 X set load type to A_tote
9 s2 s3 h# f8 D# |' S if A_tote="tote 1" then set A_induct to 1
7 H3 Z e( f6 U3 s$ s else if A_tote="tote 2" then set A_induct to 2+ N" n1 z6 W/ T E
else set A_induct to 3 4 [" j3 b \! h: a
set A_i to 0( Q; J" P( A0 |7 y5 M4 H
clone 1 load to P_induction. b% Z2 ]8 \3 P, {' c. K
wait for A_time sec' w: u3 ]( k8 }1 k8 {. Q
end4 Y, k; q# }+ T: M7 D
end
0 b: T9 d0 K1 K4 o5 C% _0 n u _* b8 W3 Q( \
begin P_induction arriving
/ r5 L% R2 Y: k5 A) G1 r if A_induct=1 then clone 1 load to P_pick1
7 T. ^. i% _4 f! a, Z3 j% k: Z else if A_induct=2 then clone 1 load to P_pick2
: ?, [& c% g2 J8 z, ] else clone 1 load to P_pick3
/ W3 i* C Q% ?8 [& m% _8 F, xend
& ]8 f7 S+ g- n% {2 q
" Q2 F% b; L( P6 R M3 ~begin P_pick1 arriving) @/ H: }2 B7 V& M0 h
set A_i to 1
- }4 e; ~3 I/ t" Z move into Q_induct1% H8 `' g+ }, i$ N
move into pickaisle.induct1
7 L3 b1 I+ `, |! x! z while A_i<=30 do begin
& T5 G! P8 i g8 ]9 g; S5 M3 I travel to pickaisle.con(A_i)
- W$ {1 |: ~# x: K' B% o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( `, e* Z. W' ]5 ?' e' G else wait for 10 sec9 G k3 B$ g1 w. W
if A_i=A_leave then send to die
, P, c1 ?2 Z# J) G' V+ P else inc A_i by 1. B! H" p v4 @
end
2 M$ `; Y% K" f4 w6 D' s' n2 ~- {end
h% Y$ d6 D, N; N. {6 ]" y
& j6 e/ ]8 y7 A3 ]begin P_pick2 arriving
$ L$ j% C9 u+ D' q: W) J$ j$ [ set A_i to 116 x6 |3 e' T0 N. q$ y$ y
move into Q_induct2 p* u1 a7 `& a
move into pickaisle.induct2# s. Z! N4 Q# m! _- }" k% j
while A_i<=30 do begin0 R4 k/ p0 K$ C2 w9 d
travel to pickaisle.con(A_i)$ J& b" M6 E) i, E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 v9 ^: @! Y: ~5 g. X8 b5 w else wait for 10 sec
0 e' N; g+ T; p5 A l if A_i=A_leave then send to die
" l0 \4 W% @2 x! U, e6 m else inc A_i by 1
% W; w; M# i7 G7 c- a2 o end! U) G& L5 u5 Z
end. x! R1 H0 V3 A% V( Q6 b0 D6 _$ M, N
& s& ?2 g7 F; ]! r7 d* ?4 Gbegin P_pick3 arriving! i* [% H5 j3 ~1 B! V3 ]
set A_i to 21" A. b6 q4 X! s$ a8 g4 s5 Y
move into Q_induct3
, {+ ~! y; M: t: l5 r* d move into pickaisle.induct3
. ?( `/ ^) |& N6 a; N3 Z while A_i<=30 do begin0 M* e3 R; K: _" ^/ q
travel to pickaisle.con(A_i)- e/ G) ~: `0 Q! _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: M# q& X5 _! L0 U# d/ _
else wait for 10 sec
7 D, ]1 O, C' O7 j. \. q; K d2 h if A_i=A_leave then send to die
0 P1 s- G4 t( R( _/ P else inc A_i by 1
$ f# f C& _- n# u6 T, _$ p+ z- ] end6 \2 T& o4 L! U9 N# L
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,其它按你的 ...
|