|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 u# Z9 V1 u3 x* c
0 S; h6 f2 n5 n3 @. o; f! w我的问题是,在每个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中的数值,不知道会不会有什么不妥。( _- Q( \+ ~. ]# A. y# y
0 u- K6 K1 t0 s
begin P_read arriving5 _7 m; W6 r. Q5 n( J9 a( v
while 1=1 do begin
& v: R, [# X p4 ] read A_tote from "data.txt" with delimiter "\n"* K. T# h- C; G, F2 R+ }# M
read A_time from "data.txt" with delimiter "\n"6 m& @$ O9 l0 W# Z3 Z' P
read A_leave from "data.txt" with delimiter "\n"7 b% x- h& y. L; w
read A_picks from "data.txt" with delimiter "\n"9 [) @) }" @' u& l& r1 w# Y
set load type to A_tote
; g. l0 ~' U9 H8 D5 F if A_tote="tote 1" then set A_induct to 1
! m1 m, z) Y- Q else if A_tote="tote 2" then set A_induct to 2
( a( }9 E" O9 B2 d1 x9 j- x+ g. x) X, m( x else set A_induct to 3 3 c$ b! }- O4 w: {$ F$ y6 b* ^
set A_i to 0' [) t3 d) l4 O0 X- A' M1 {# ?
clone 1 load to P_induction4 g' t$ C, ~ t( ~+ D& G
wait for A_time sec
7 s* p- ?- h3 O" f# u end: g0 ]; s9 X4 ~8 a c# B; E1 \
end
& L" D' E+ G# T7 L: N; X8 F( h' R) _+ }. |
begin P_induction arriving
7 o3 n, m5 x) Y4 ~ if A_induct=1 then clone 1 load to P_pick1% g8 H$ [& s B
else if A_induct=2 then clone 1 load to P_pick2
. r7 D2 q' ^- A* e, H/ {, e5 ? else clone 1 load to P_pick34 y! W3 I0 \2 ]$ D8 o' f( ?' c+ Z
end4 z- _% Z. \+ N9 m
' U' l4 [# W& |begin P_pick1 arriving' d9 H; A: I& X3 r
set A_i to 1: q9 @7 D) g) q4 [$ i
move into Q_induct16 T: |; L; G+ l
move into pickaisle.induct1
6 K- \2 J- D6 W6 n while A_i<=30 do begin
. u- Q: B9 U7 m: Q8 n0 F, {% |7 B9 p travel to pickaisle.con(A_i)1 j ~+ p2 L7 L0 e) J/ |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! a( M/ h9 x4 R
else wait for 10 sec$ f; D" |+ w+ D& Z: X
if A_i=A_leave then send to die, k$ a9 n G, O5 T
else inc A_i by 1( ~/ E) ~2 L, \) w! N) \4 R# G2 d
end
9 Y2 M; g0 j$ k/ o) G. rend
6 ~$ n: a+ { p7 i, z6 x
" j5 z7 A; v" W, O% I& P% Fbegin P_pick2 arriving8 z* F# Z2 X9 _; Y; }' P2 I8 C6 X
set A_i to 11
. Y+ a6 Q5 k) H6 N1 U+ ^ move into Q_induct2
7 ?8 n. g2 R6 g0 K6 D move into pickaisle.induct2' K" j( R. ~ F4 z' _* r' e
while A_i<=30 do begin% J1 c w: v E% H
travel to pickaisle.con(A_i)
$ z- @* a. E1 O O9 [8 b) o& M9 F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 z' m% p# P+ E' J* [& V else wait for 10 sec
3 Q% F* ^( V, n1 d3 Z7 v8 G if A_i=A_leave then send to die M6 z t5 y u2 M
else inc A_i by 1
' N% V9 ]" B7 u6 O/ W* h( p end
& Z# e2 n1 M# L7 Kend
; i: ~! L+ p1 x v% [' C8 ^, G$ N% s, Q K" c( s
begin P_pick3 arriving
/ l+ L! H- \3 r# q/ } set A_i to 21
. }6 B2 [$ I. i1 Y, G8 @ move into Q_induct39 d+ E4 f: _& ]" _+ a! y" O
move into pickaisle.induct34 J5 k/ G9 X |4 P! \) H
while A_i<=30 do begin/ o% k9 f( v' Y
travel to pickaisle.con(A_i)
, a- w U8 @5 j2 } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 g' _8 s3 x. y/ r% V" N
else wait for 10 sec
6 p% E" e) B" Q if A_i=A_leave then send to die' [1 A8 z0 D# P& F
else inc A_i by 1
4 f" A% X8 d" V+ Y end) ^8 g: K6 d9 _; ~
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,其它按你的 ...
|