|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
z! X8 A- q2 {" @
/ W: m1 g$ G2 _* ^' D3 S/ A我的问题是,在每个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中的数值,不知道会不会有什么不妥。
- g$ p/ u7 e( l/ Q1 |% A7 S2 C
- h" c* g0 }! {begin P_read arriving
9 E. O# y- K: a! K4 Z5 a/ s while 1=1 do begin
], J5 c' q( A4 Y* s read A_tote from "data.txt" with delimiter "\n". A2 G3 A4 h2 }! D' ?. ~
read A_time from "data.txt" with delimiter "\n"0 t9 ^; @- z2 [+ a0 N* \' [- q
read A_leave from "data.txt" with delimiter "\n"5 r2 g8 M$ j# S! Y8 [% W' y
read A_picks from "data.txt" with delimiter "\n"# v( e/ B! j8 |4 N9 Y [
set load type to A_tote s& E+ z3 \3 m4 R+ V5 f$ M
if A_tote="tote 1" then set A_induct to 1( {. ~8 S! c' t) @. d2 ^9 j
else if A_tote="tote 2" then set A_induct to 2
$ d/ r$ Z% Y* T+ Q5 n7 m: n else set A_induct to 3
6 L2 |/ a8 b4 m$ a set A_i to 03 L4 E& {6 l! |, U/ @' Y
clone 1 load to P_induction
/ d3 A3 `7 Z' V* V wait for A_time sec4 ]( \" M5 X0 ]# ]+ r8 J8 n) ^
end! ~ N0 e! n9 x; d& \
end
/ P, I, ^% }$ `/ C' m% g! C
4 ^$ t9 m) A4 H' W8 L( nbegin P_induction arriving3 M# Z; k: e0 `& z
if A_induct=1 then clone 1 load to P_pick1% R. c3 |% z) V
else if A_induct=2 then clone 1 load to P_pick2 D0 |1 O- d+ q5 E
else clone 1 load to P_pick3
5 f, M# i+ I, I5 {. o, Oend; R1 h9 y. v& @& }) r% A
+ ]6 h$ l6 U. g) d
begin P_pick1 arriving5 Z4 X, h0 H- Q2 K
set A_i to 1$ F* `3 B! |6 Z1 C6 Q; |+ c: {
move into Q_induct1
# _- V% Z) ]! ~ j0 ^0 q move into pickaisle.induct1
5 Z3 o$ T; J. p# p0 K7 h+ T9 ?* B9 ] while A_i<=30 do begin0 B7 s E6 K# G4 O8 h5 v
travel to pickaisle.con(A_i)1 m9 J( R3 E# @/ T3 F
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 v" s( } H: l( d, j) Y/ C; M6 g else wait for 10 sec# E% F- |% ] ]2 F9 R- O! c
if A_i=A_leave then send to die' I$ a o+ I3 H& L
else inc A_i by 16 N- _8 S, F; ]9 L
end
' H$ T R# ^1 [) B$ U- p* ~* oend
' y6 h0 j8 a R7 }$ i
, U& T0 T. t1 H# rbegin P_pick2 arriving
- @ [& {* o$ S4 C set A_i to 11
& _0 K7 ?1 \/ G move into Q_induct2
: c! g5 I$ m& q6 `- w; h) f( M move into pickaisle.induct2
! C# ^& D6 N& U1 f* o, r while A_i<=30 do begin
: K. ]) m; O6 s- ] travel to pickaisle.con(A_i)+ v3 V! x. h3 ^# {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ B7 |5 d) J5 Q( \ else wait for 10 sec
% b* R" M0 w- r+ | if A_i=A_leave then send to die# c& I+ n* C5 y) b) _
else inc A_i by 1
5 e. i- x: G$ y: [ \8 m7 p, G/ M end& D1 w6 T! _; M" }" s' q
end5 j. y3 i' G& @8 S9 q3 a; w& c" H
# K1 ^* ?" k& s2 p, }* x: }# G
begin P_pick3 arriving/ m8 k/ \ F6 r0 V2 o
set A_i to 21
) \, Q P6 X* J5 _; {, \) a" w2 J move into Q_induct3
0 S; D' h! R5 c1 u8 a A move into pickaisle.induct3& ?# ]7 r- P, q2 l$ U8 c
while A_i<=30 do begin7 q( y6 W Z; n6 r2 ^6 s
travel to pickaisle.con(A_i)) ?/ e' ]; _% }4 r1 W( a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; h* K6 p3 _3 F2 q" j5 j else wait for 10 sec$ g8 ?& X0 c* |
if A_i=A_leave then send to die. j' Q% t9 c* ~, u% N) e
else inc A_i by 10 G& s/ Z5 a3 K& s, U# f
end5 p v. N* [1 p4 l; J. w! H
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,其它按你的 ...
|