|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) j8 D1 e$ A9 Y1 H! x
) [+ p+ s2 S: b' m% `6 t我的问题是,在每个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中的数值,不知道会不会有什么不妥。% _( U; s9 t5 D- v, n$ }) l
$ l3 h- a/ ^5 J' L: h4 H1 \begin P_read arriving
2 i9 g& ^2 B; d1 L3 Q9 _# p while 1=1 do begin7 i9 g- h" g2 A) ? Z, O9 v
read A_tote from "data.txt" with delimiter "\n"
( O. ?8 {; a+ ^7 X$ ~& C [2 V9 L% i" t read A_time from "data.txt" with delimiter "\n"
' h9 _/ G0 V7 T$ w read A_leave from "data.txt" with delimiter "\n"( S: @7 v# E* P
read A_picks from "data.txt" with delimiter "\n"
. s$ M, \3 @( ]9 n6 Y3 r& t+ r6 n [ set load type to A_tote" ~+ O8 X% D+ r5 }* r. e# O8 L
if A_tote="tote 1" then set A_induct to 1$ M0 Q7 P* f/ m0 p, F
else if A_tote="tote 2" then set A_induct to 2
% c6 F6 {9 d" E d% X0 q) Y else set A_induct to 3 ; W L4 R- A5 F( E" G1 y3 K
set A_i to 0, k! x0 d x- N* g9 y) }9 l
clone 1 load to P_induction- u& Z4 I- w1 X, Q6 [+ E: u: m' _7 B
wait for A_time sec8 _" K' d, m, R3 K2 q2 s2 D* u3 W7 ]
end; b) ?: Z6 ^* V( U3 A+ h
end
5 f2 b+ m$ s+ G& }: `5 f/ W
' P: l6 `+ e0 Y L$ Vbegin P_induction arriving
) {& Z! z, d' p5 Z if A_induct=1 then clone 1 load to P_pick1
3 a+ Y# s/ }) w) G) `) p. x: n else if A_induct=2 then clone 1 load to P_pick28 m( X x5 ]/ |
else clone 1 load to P_pick30 k; s3 ^: v1 d0 u" F* q
end/ P( g2 `1 Q5 N1 y% x* }4 i
5 V! O1 L% V0 r. O8 a6 P5 H2 bbegin P_pick1 arriving; t$ Z& Y; Z3 ^/ Z/ m% n
set A_i to 1
: T+ N7 {8 g& g' [ move into Q_induct1
: w$ N) u0 Z" R! M: ?$ g move into pickaisle.induct1
$ i" F- E% n# L p& W# Z while A_i<=30 do begin$ X6 G4 n6 K ]5 e P: C
travel to pickaisle.con(A_i)& V; T$ D9 u2 `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, q2 s; ^. q; M% c8 | else wait for 10 sec
4 I' X. }7 D. u( U7 y c if A_i=A_leave then send to die
0 S+ V5 \7 n2 k( w1 B4 A: | else inc A_i by 15 {' \1 F( n! A' L9 r: v! j- ?
end
+ |$ G' s$ y1 rend
0 K4 m; X' |5 w e6 D
5 o, T; E3 \- v" q6 ^begin P_pick2 arriving, \# q- B8 ]) q7 H9 g+ l
set A_i to 11
0 n1 C$ i9 {/ @ move into Q_induct29 e; Y7 u7 t# e' ^4 f6 }& \
move into pickaisle.induct2
0 Y; D% h7 `% V, k# C( K7 c5 ?. a while A_i<=30 do begin5 N1 a* x0 @+ j, `$ ~3 P8 }
travel to pickaisle.con(A_i)
1 D4 v) a; [& N* m+ z& V8 ~4 t; L$ |8 f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 i. q- @1 u* x* w, o I else wait for 10 sec' I! ~8 s" _% q, p* [5 D
if A_i=A_leave then send to die5 U3 @6 `2 [0 b/ _: F
else inc A_i by 1
) H6 f5 l a1 |/ A end
: C' a3 ]) y7 A5 {. \2 N7 dend* A7 D7 d% g9 _1 p
4 j* B! [ \- Z5 @
begin P_pick3 arriving
' i+ v8 _. e% S) m+ g" B set A_i to 21
% G3 P; u0 T4 ~$ [ move into Q_induct3
9 H2 w5 a8 ?8 }* `7 A move into pickaisle.induct3. v9 G+ N* X$ Y3 N
while A_i<=30 do begin
! y/ d* P5 E, a% P4 ` s# z travel to pickaisle.con(A_i)! }/ ~9 W: U' L8 q. `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. k& }/ B; W5 W0 R% a4 N$ T
else wait for 10 sec
H( Y2 ] L8 S f if A_i=A_leave then send to die* n+ U0 \- n' L Q
else inc A_i by 1
`, [1 J: N! Z# ~" X( ~+ T" W end# w s# @, S, b+ {' M
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,其它按你的 ...
|