|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! e8 F7 j, Q7 ]2 h) x: ]* W
3 H6 }) w( P; O' A, y7 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中的数值,不知道会不会有什么不妥。' A5 [6 }6 W- _, G0 d
& M5 G, j+ {) P$ S
begin P_read arriving0 M' y A9 k% I3 z2 }% p: U! W$ o
while 1=1 do begin- p1 Q0 }$ K" p2 Y
read A_tote from "data.txt" with delimiter "\n"/ p' k* s7 S6 ^, H% d
read A_time from "data.txt" with delimiter "\n"
0 s% S: L! y& W8 B/ C read A_leave from "data.txt" with delimiter "\n"
) E- ~. ^- ?. n+ \4 W read A_picks from "data.txt" with delimiter "\n"
4 M9 W( f' B" x* F) V! I: g set load type to A_tote
# Z" n: B4 ? u5 E1 s! { if A_tote="tote 1" then set A_induct to 14 t4 ]6 W. G! }1 X) \1 o# Z
else if A_tote="tote 2" then set A_induct to 2
1 A; J% Y2 z R6 t0 e* k+ V/ l b2 q else set A_induct to 3
9 F# }2 R6 C3 k3 _) j4 X- u set A_i to 0
, |5 {* S+ ]4 v. C+ c clone 1 load to P_induction
8 w, }6 f6 o+ m: P4 x( P) R: A ] wait for A_time sec3 P* e5 D+ d7 ]% B: s6 ]1 @
end1 e! U9 h4 Q$ l6 ~
end N! r# m9 r( \4 B1 a
# N: t. E) g7 P+ V2 V
begin P_induction arriving
; U9 ~ H! N. t& M9 a, x if A_induct=1 then clone 1 load to P_pick1
0 t; @5 s Z( Z6 Q- I else if A_induct=2 then clone 1 load to P_pick2
3 K+ s- E$ `' _* X8 i" ^8 F& |7 T else clone 1 load to P_pick3. v0 ?8 }0 |# T% }" |+ I( ?5 Z- ?
end
/ l3 k( z' M4 p
. f' v, b4 n0 c9 Y- _begin P_pick1 arriving* F9 r0 f K, u$ w% x8 c7 g0 ?6 y8 F, ~
set A_i to 1: z2 x! I& w2 _) E4 }/ }
move into Q_induct1+ v0 k7 J" W3 z7 x/ ?2 t
move into pickaisle.induct1
5 Z/ }! g& R3 _2 p$ V while A_i<=30 do begin
" v! E( Q( R9 x% Q6 F, f travel to pickaisle.con(A_i)
+ c3 r" I* U+ U8 q( Y% _# x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( \1 L! Z- B2 A! z2 v. Y7 D& |
else wait for 10 sec* r( Y1 V/ `# T7 L/ J' s
if A_i=A_leave then send to die
2 M8 l( w# a7 {. X" [( h# D else inc A_i by 1
5 k- B) n1 A/ u. n6 j end
3 a7 t3 Y; G3 C7 B9 z& b$ cend
- z6 n' y% G5 \
: t" v' ]: n7 |3 ~0 F' n' hbegin P_pick2 arriving2 i% A `. e) V9 F4 E! t) I
set A_i to 11
1 y4 P4 K9 q: M move into Q_induct2
* n3 H! k) @% M9 V move into pickaisle.induct2
/ r! e s- X v while A_i<=30 do begin
3 M4 R7 \1 J# r o1 _ travel to pickaisle.con(A_i)$ \5 [. i, a* J t3 d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 b! g; O0 h9 b; F! V s
else wait for 10 sec" _" f6 Q7 t6 t+ W. y: Z
if A_i=A_leave then send to die, H/ Z( o- \! y9 D+ v# h5 e
else inc A_i by 1
4 F) P/ }* @' g2 U2 s end) b1 q$ L0 q, W
end% s, ~* L7 o2 ?" [6 _4 v
% I3 G. A o, H$ [4 P
begin P_pick3 arriving
9 h; [( C! u. Z* H k5 R( v set A_i to 21
# j; ~ u1 r4 V& O0 e* z9 I move into Q_induct3
' F: h# \9 l! P" c* r9 k- R move into pickaisle.induct3; ^0 A+ \! F) Z; @6 T- R
while A_i<=30 do begin4 I) x; u! m1 i$ q
travel to pickaisle.con(A_i)
# I% C; d# o, ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; R# i2 ^ v. H3 k$ V- x4 x else wait for 10 sec
7 I N; Z' b# o$ C4 q if A_i=A_leave then send to die
! l0 H# w5 `! F/ H, G else inc A_i by 1
3 G: T4 T, a; @& S V" V q) v end+ G8 w0 X5 n9 l2 d1 _ F7 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,其它按你的 ...
|