|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, d% `! ~( E" k; B5 \9 k
; V1 n" k6 X& Q. R w9 g' l我的问题是,在每个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中的数值,不知道会不会有什么不妥。 H3 H0 _3 D/ t4 \0 ?. x; J$ f
* x1 l; V. q, I! ^
begin P_read arriving
7 f/ B l' O3 c while 1=1 do begin8 [2 ]$ g: \% ^- k* r+ p$ _
read A_tote from "data.txt" with delimiter "\n"/ q) h1 d7 o; i8 v" h
read A_time from "data.txt" with delimiter "\n"
& U2 P$ A; n: r read A_leave from "data.txt" with delimiter "\n"& _. {% t* k1 B9 s B
read A_picks from "data.txt" with delimiter "\n"# V! \8 l9 a5 s
set load type to A_tote
0 h, M7 R6 N0 {* l& M if A_tote="tote 1" then set A_induct to 12 q# l- j7 x. t' l
else if A_tote="tote 2" then set A_induct to 2
, u& O; I2 O4 S0 T( J5 l7 | else set A_induct to 3 , ~7 l! f0 T1 L) V
set A_i to 0
5 F; A- L" @# |, U) h m clone 1 load to P_induction% D e; y3 I1 k9 j" C1 D0 }
wait for A_time sec
! y+ V4 E! M( m! u& s end* @1 z* @7 f6 d2 `+ W
end# A& y- F% x8 ~5 n' z4 Y
1 f* H- V J2 h- w5 O! `9 Z6 k. Ibegin P_induction arriving
& d P+ V. S5 m7 y) `" R if A_induct=1 then clone 1 load to P_pick1, c' E: A6 K) K4 t6 W
else if A_induct=2 then clone 1 load to P_pick23 Y5 ^& k" j- K/ b7 j( I
else clone 1 load to P_pick3; L- c5 i4 u' F' W! `" @& m
end
5 C+ U3 M3 j3 J8 v& ]1 m
6 I+ @) w" H% rbegin P_pick1 arriving
4 i1 ~5 T( O% ^, [8 M set A_i to 1
- A- Z1 ]) M& A% N- Q move into Q_induct1" ?9 n" @( w* j% d! B1 k9 r* |
move into pickaisle.induct13 }. v3 o1 u# m, H5 u$ q
while A_i<=30 do begin! @5 R+ R0 y$ F( o( l
travel to pickaisle.con(A_i)
8 @+ W. h' Y" v( N0 }; Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! S+ ^5 s$ \4 W8 q6 X8 L else wait for 10 sec& ~; W0 P; e* X; j7 f" b; C+ e
if A_i=A_leave then send to die
& j( @: c6 C( `- t" ` else inc A_i by 1
( `0 L& O' z. `! J end
# S2 c5 k( `6 J6 U: A- ^" ?# Y3 \end2 m' c. P8 t T* z, w2 p
9 |' ~+ Q8 z( o3 ]0 P
begin P_pick2 arriving
' L! `8 h+ }8 @ set A_i to 11* _! W ~ \3 X n" Y7 J4 V
move into Q_induct2
9 L* R* ~, |4 F move into pickaisle.induct2% l+ w) i3 W6 S0 [* C3 e6 m. }
while A_i<=30 do begin
( ~6 K% E; {- o3 q5 B3 x* e6 @6 Y travel to pickaisle.con(A_i) w, ~+ \7 @. o1 g, u& g- b1 A2 s# Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' m0 D/ h. {: T) a' w! u+ _ else wait for 10 sec# }$ {6 b# B; V1 `6 W, A
if A_i=A_leave then send to die
0 V/ B; F1 M8 S1 n3 X% t5 S else inc A_i by 1
4 f$ i/ u% `: T9 ?8 n end
! z! z( \. i1 Y7 eend# A! v& X5 U! l, D+ D
) ?7 Z. W" ^5 F/ y7 S. P5 [9 M9 z
begin P_pick3 arriving/ u6 h2 b3 I J0 y
set A_i to 21! L4 U8 `" h& ]
move into Q_induct37 U2 R) E6 Z5 H" t# Z
move into pickaisle.induct3# `; \0 }) R" N6 y& \
while A_i<=30 do begin4 |. l0 U; A4 s) G
travel to pickaisle.con(A_i)9 s* G% C+ [( E) p9 H5 D2 u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" P/ ~$ }! e& Y
else wait for 10 sec$ O6 B, g m( K X5 u, X: h
if A_i=A_leave then send to die5 L/ h# q7 b4 ^% I' r! e3 {! P( c5 M4 n3 ~
else inc A_i by 1 y9 S$ Q+ ~- J
end+ ^. s& K, y8 J& u
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,其它按你的 ...
|