|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ \0 J3 R8 A! E* b3 v
) A' ]. |5 r8 ]. 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中的数值,不知道会不会有什么不妥。
2 ^" ~7 I2 ~, |+ N
9 b' g8 J) e2 N& \) W0 s" gbegin P_read arriving
5 m" C$ \! r5 ]- l) o- J while 1=1 do begin
$ q' k9 F" K1 t) s2 `0 ?7 q read A_tote from "data.txt" with delimiter "\n"( I" e3 ~! Y# O0 I# R+ q9 I4 }
read A_time from "data.txt" with delimiter "\n"* F2 |# e+ A1 |" _
read A_leave from "data.txt" with delimiter "\n"8 f, Y1 w. N/ |" ?! B
read A_picks from "data.txt" with delimiter "\n"1 s9 Z! u2 l$ ^' b2 k
set load type to A_tote
. M5 b; Y* Q0 E if A_tote="tote 1" then set A_induct to 17 Q' E0 K" c, h7 J+ j2 L2 r
else if A_tote="tote 2" then set A_induct to 2! h" X- N, Y* E
else set A_induct to 3
, `% ]. L2 Z/ u1 [/ k2 y. q& R set A_i to 0
- h* Z2 H' R) j5 C6 m8 H clone 1 load to P_induction8 Q5 |6 k& s$ w; B8 m }8 t
wait for A_time sec
0 Q: l2 T) Z- w K; {! W5 i end9 l+ [& t0 a" x% w% l. \6 r# b
end4 q5 k% S6 W. O1 U( Q' t7 u
6 U( ?& k9 p" }3 Wbegin P_induction arriving
# Z, w, ~/ e3 ^/ m if A_induct=1 then clone 1 load to P_pick18 l# m% o( F a! X& x3 x
else if A_induct=2 then clone 1 load to P_pick2, o+ _. R* t* _5 B3 q- c
else clone 1 load to P_pick3
9 x7 g% [$ P' Aend
7 J' i8 }9 B3 H2 v" R
4 a# A- n3 c5 k/ }! L9 Y9 J4 }, Lbegin P_pick1 arriving6 b! Y$ T1 j3 l6 u1 K# j( f9 }
set A_i to 1
2 F8 m5 h( P$ s move into Q_induct1
7 N1 m. s% ]2 j X9 C# Z move into pickaisle.induct1
% Y. h9 f' S% k6 H% q. m7 g" a5 b while A_i<=30 do begin% \. r2 F. Z: t
travel to pickaisle.con(A_i)
( R9 T% k2 I, f" P" _( `4 z+ o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! g& A1 X% r" r" C+ M' I' _6 {& T else wait for 10 sec9 n& w5 k. I5 K q$ p' `" E2 W
if A_i=A_leave then send to die3 V* ] {% {! P' H! ]
else inc A_i by 1
: |$ a( f" `" N. N$ q+ `6 o end
! J3 G7 p& x5 v. Qend
' R* t6 U" z) y- A
7 f$ U# z# k% Y7 _: [. }begin P_pick2 arriving! F0 {; V& U8 u; _. u0 R# h! ?5 o
set A_i to 11
$ o2 E! g- ^- X/ m( s$ y move into Q_induct2( `5 p/ W6 o+ w' ]2 i
move into pickaisle.induct2
6 |( {( p# g7 k4 K while A_i<=30 do begin
; ~4 _+ ?. {" L- Y2 J& I travel to pickaisle.con(A_i)
& [; e( X% Z" A# f$ v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: C c2 t0 Y# \# Q6 a# \
else wait for 10 sec
6 N$ T( |1 m8 j9 O, r% N if A_i=A_leave then send to die
% }, \+ \3 g: T& I# C q; M U else inc A_i by 1" [) t1 x% p2 h, e. u
end# G, A0 X8 P; W; F8 i
end: M. w" c+ r. b; ]: i. h1 Q5 s
/ ]) `3 w! |6 E2 v1 o0 m1 Y
begin P_pick3 arriving
" o9 @3 W7 `7 U5 h) Y _, h, e% _+ J set A_i to 21
9 R8 m: \ v: E7 }* ]- i0 }7 {' } move into Q_induct33 y% D! v; P( [
move into pickaisle.induct3
: C- \! ?* Q2 m7 Y- I" C while A_i<=30 do begin
2 {9 O i* y a/ b; a( f3 h travel to pickaisle.con(A_i)
& E/ B3 Y; ~' t( u* i5 ~ Y) h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; O8 e {" @ v# H) o else wait for 10 sec& \; d* F8 s0 j/ s
if A_i=A_leave then send to die' ^1 v6 f8 F2 X' z6 [, X1 I* _
else inc A_i by 1
G0 x, [" ~; x( _) J! V! y end& m$ u7 {) H6 e- R7 k
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,其它按你的 ...
|