|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 Q8 V; s: w, h' G5 J3 E8 ~
, O& |' o4 e; @( c) G/ P
我的问题是,在每个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中的数值,不知道会不会有什么不妥。8 @4 A- G7 w" u) c ~! u; y1 _
0 ~2 z! V x, C. X* ^begin P_read arriving
( C$ l( _+ n! j: x& w7 C* v; K3 U while 1=1 do begin
- i1 Z0 p$ y4 ]# ]7 [ read A_tote from "data.txt" with delimiter "\n". {* M- N; A" B+ @3 F+ c: N2 D# {
read A_time from "data.txt" with delimiter "\n"0 }0 d, r) @& a8 i( f; Z' k
read A_leave from "data.txt" with delimiter "\n"
1 A2 D w7 d7 y6 k( w read A_picks from "data.txt" with delimiter "\n"
; \2 d1 f4 ?( U2 {9 X8 j set load type to A_tote2 E# H' l2 m4 z3 u4 |( Y5 |6 k
if A_tote="tote 1" then set A_induct to 1
& l8 r& o- y. b/ O else if A_tote="tote 2" then set A_induct to 28 e. J q6 O( [
else set A_induct to 3 9 j0 _- M) Q4 J0 \: K
set A_i to 0* g( h; M$ d* H- T. y' O( o/ X2 u$ C
clone 1 load to P_induction3 z: _( Y% M% E
wait for A_time sec
8 v4 q. B# k- e8 J5 | end1 M$ j/ j0 Z/ d' }0 r% c
end" P# i: D/ K z; }/ `7 M
, i) I" a7 C6 ]9 K: ?) Ebegin P_induction arriving
2 f1 `& l$ A1 Q if A_induct=1 then clone 1 load to P_pick1
9 F0 ]! o( t% t( C: f else if A_induct=2 then clone 1 load to P_pick2
0 |. |% ^! D4 q: _0 |" ^ else clone 1 load to P_pick3
/ F- p5 h$ `) E- Y9 rend
' h& V' ~. b) u; a8 c7 D
0 i# _" O# ]1 o# q! Abegin P_pick1 arriving3 L- F# Y; S5 l& c. |
set A_i to 1" q7 O* h! W8 Z1 @: _6 g3 n
move into Q_induct19 d. ~) {" }$ O/ X$ D' T [- Y
move into pickaisle.induct1% N' S& O# ?6 T2 L! S) o
while A_i<=30 do begin
7 ~) ?4 G x3 S# h( v travel to pickaisle.con(A_i) S# Y6 p, w. J* q9 s% x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ E) P N$ i% ?9 P1 F" o else wait for 10 sec
" Q( P8 l: u9 j% j$ U if A_i=A_leave then send to die
- N% h( K/ y& g0 `; D else inc A_i by 1) _- }, @1 F5 x" J" \
end
6 b3 s0 w ?) G; \. G/ R8 ^ v1 ?: ^; Gend
' T, K. B* }; s: k+ t: O" H1 w$ n
begin P_pick2 arriving
) y! X2 R( p: |1 E* I7 Y6 Y9 E set A_i to 11 t% D! j1 B/ t x
move into Q_induct2
- P6 K: Y. H. ^+ E move into pickaisle.induct2
+ K/ k9 i/ V9 ]0 d+ b, W while A_i<=30 do begin- \) p% X! U2 p
travel to pickaisle.con(A_i)* ^& [8 Y% P; K- I' h7 l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# P; f# y ]$ \" j
else wait for 10 sec
2 g8 ]$ R- n& W1 C if A_i=A_leave then send to die9 [* d) K( f/ i! E( q! s
else inc A_i by 1& e2 l) u# [: F- q7 Y9 V
end
# k& R$ \% i4 F8 E X2 t- uend
" f" F0 G) y6 p$ B4 t' K7 r ]5 V, C; ]0 T9 {& O0 a
begin P_pick3 arriving, i4 K' Q% Z7 x; c( N Y- C
set A_i to 21
3 j! Z6 W! a+ X0 b7 @% _) J move into Q_induct3
6 H/ v. j, z2 Q; j& j move into pickaisle.induct3- m' d! W8 ^" i& w9 n2 q
while A_i<=30 do begin
( ~7 X3 f3 Q a# i& E travel to pickaisle.con(A_i)8 c' ~6 c& A9 T" @3 z) S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 V, u( h6 N, H9 x: i
else wait for 10 sec R, ]" \6 q- M% u8 X
if A_i=A_leave then send to die
' |2 h) V7 H; ~& J+ V! L$ h. S+ Z else inc A_i by 1% T& o( o6 H( R' }5 v0 e- ^
end
+ B$ U$ `& O: Z( b% t5 lend |
最佳答案
查看完整内容
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,其它按你的 ...
|