|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 ?& ~$ H: @- d) B% w6 Y8 e. z% @! l- N
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. ]! |5 a0 d4 G0 W Q+ k+ N* h/ [6 s t* P7 k' X
begin P_read arriving
& K: @ C, z/ e% L- h, U1 }5 C while 1=1 do begin' _: A# Z0 w5 j; Z
read A_tote from "data.txt" with delimiter "\n"- E( c9 d; [! @9 a4 l* n
read A_time from "data.txt" with delimiter "\n"* `% u- a3 T8 u- r# w
read A_leave from "data.txt" with delimiter "\n"
: V( T. w+ N/ M: r0 C, L- [ read A_picks from "data.txt" with delimiter "\n"7 {/ N& c1 B9 m6 F) o, L* d
set load type to A_tote/ S/ `& F2 d5 c9 p2 \! y _ J6 Y
if A_tote="tote 1" then set A_induct to 1
5 f$ K" p6 k% D8 i3 z; K: Q else if A_tote="tote 2" then set A_induct to 2( e" ~* ^6 C. F- c) v( Q
else set A_induct to 3
9 p# N2 c+ K# i: }3 z' Z* H set A_i to 0. w+ J% ]0 Y: j- S( |0 @: i1 {
clone 1 load to P_induction4 }+ ~. E# [" w5 {' D3 L+ j
wait for A_time sec
, V4 V& k7 A: n3 B2 ? end
# ~+ h$ z1 s0 v+ r( @2 h2 u* yend
/ g, c1 b( W7 G4 R' ~7 i+ S$ A! s( S' I
begin P_induction arriving* G4 {# ]% H1 D% M& V! B
if A_induct=1 then clone 1 load to P_pick1
5 V3 l2 N6 w# p: H# Q$ B; p else if A_induct=2 then clone 1 load to P_pick2
4 v- c4 _ k6 S' z1 R4 n# q9 |" @. l) @ else clone 1 load to P_pick3
1 x+ x" S+ W5 d7 yend* r* P+ U+ @# O" Y
& f( ?( F' L* M
begin P_pick1 arriving
, ]2 n" y1 q! `* }; `& B( X set A_i to 1
; `) B- U1 j% ` move into Q_induct1
$ ` U3 S" U# b move into pickaisle.induct11 P/ U3 K1 F! s' [9 R/ @
while A_i<=30 do begin" Z. t, I6 i J8 c6 A
travel to pickaisle.con(A_i)- a$ I, V1 E1 P) H2 a, X" O) L% N/ B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 h7 V/ P0 E) b1 q% E. X else wait for 10 sec9 x! @% k2 b) Q1 F
if A_i=A_leave then send to die
; l4 v3 ~; i4 a/ M* d! z else inc A_i by 16 f: p" ?4 a& w6 Q* u* t' J9 i
end- G; [6 s- g+ `' j+ X# V
end
& H8 m A+ u- `) R& ?' S
) m$ L' n( K# S* v0 Xbegin P_pick2 arriving6 l, }: X R2 q M p. |5 _
set A_i to 11
! V" Z) H# e! L8 B; r8 j1 @ move into Q_induct2
- y- G: Y! [) c" X move into pickaisle.induct27 {; C3 l G' P T( m8 |$ Q
while A_i<=30 do begin" n2 W1 }, ]5 f8 ^$ P$ }; D! u& r
travel to pickaisle.con(A_i)* {: k& B/ g9 n; x/ G
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
Q+ a2 s& o, @. X else wait for 10 sec
; y+ A' R& ~& X, Y; g% B. p if A_i=A_leave then send to die
: c! H0 E) W! b3 U4 |7 n8 B, n3 l3 l% U else inc A_i by 14 L* _& }4 u- Q0 ?1 W/ F) K: t8 p z
end/ M) F6 g2 w( \9 t( ^& `* Y* U
end
$ {$ m5 C. q" T$ K9 J% [
5 \4 J; _6 V6 M- }: P; Zbegin P_pick3 arriving
: V' D! l. M1 d9 a set A_i to 21' C( I d" N" o0 q4 o
move into Q_induct3
6 d; t5 D& d: s" F8 C+ y move into pickaisle.induct3; h- W4 Z. x2 v. R q, Y) f
while A_i<=30 do begin4 U1 @3 k: ~7 ~. G" ~
travel to pickaisle.con(A_i)
9 c; e+ ~! w. i% P. e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 ]+ V2 f$ |- w% e
else wait for 10 sec/ d8 D$ r8 f# I- p
if A_i=A_leave then send to die
- D7 Y9 V6 t _8 Y$ x else inc A_i by 1. a7 p) ~. u6 L5 r" K
end6 m! Q6 a- D6 w+ J# u- k! v" y: v
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,其它按你的 ...
|