|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 g1 W) i1 H3 V4 c
% `, J2 N/ x x; J, f4 j我的问题是,在每个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 Z; q [: ~6 Y: H b* W& Z1 w
5 X1 H. d. y; lbegin P_read arriving/ j* Y7 m p& X" o1 B
while 1=1 do begin* `; i# [3 C3 W
read A_tote from "data.txt" with delimiter "\n"
- {& x f0 |/ F5 a9 @2 @ read A_time from "data.txt" with delimiter "\n"
' A$ C9 i9 @, s: q) _' z: c5 K read A_leave from "data.txt" with delimiter "\n"
8 J$ _) E0 R+ O. d* m. ]3 R read A_picks from "data.txt" with delimiter "\n"
8 J1 H; M. ^' E [6 W, t7 E set load type to A_tote
' ]* q& c% ]8 o: X' I) B if A_tote="tote 1" then set A_induct to 1
/ H( X; j6 b( A& f# k else if A_tote="tote 2" then set A_induct to 27 f7 V) }; l. y9 O& W) K5 ^$ P
else set A_induct to 3
+ \3 l4 P; \7 H! d# P. a; a. `) E8 H3 ^ set A_i to 0! j$ g; i2 M4 y/ G& [& n/ }
clone 1 load to P_induction( u5 y) `) P! B7 o7 }5 r
wait for A_time sec
; n" E3 o8 P6 [* N$ d( v( \ end) i7 v7 M: w0 B# |
end
`7 g+ _1 S$ F, ~3 \" \5 Y8 ]7 H4 s" `0 g3 v
begin P_induction arriving
. u# z/ n; b; D if A_induct=1 then clone 1 load to P_pick17 A% J" i0 C. j: i
else if A_induct=2 then clone 1 load to P_pick21 Y; j3 p* b! `
else clone 1 load to P_pick31 ^1 U8 I7 m: D/ t! ^& D( [6 W
end3 s1 U! a$ J* `0 e3 f
- @4 d ?! O* {, g3 e4 C. m
begin P_pick1 arriving
$ s! R$ |( B c/ O( E% K" ]& h set A_i to 15 q5 Y J* q8 W( S! w S/ M
move into Q_induct19 A! P! W5 _, K7 a) h6 I8 s9 B
move into pickaisle.induct1
' j0 s, ]9 B0 G* G: R0 |9 F while A_i<=30 do begin. w ~/ U9 l. E% D6 R
travel to pickaisle.con(A_i)
6 Z3 Q8 o3 _: m6 c7 c" d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 p* G5 ?' i, F% f$ L else wait for 10 sec; p4 k8 w; U# r U9 k
if A_i=A_leave then send to die. }# `! T5 N. l' x
else inc A_i by 1* }, s8 A7 t7 K R) a
end
5 a+ F) Y2 A: q5 _. pend$ Z7 H- Y; r; {3 l$ h+ Q# ]
% a; e; w" `! i
begin P_pick2 arriving
0 d; i0 t X6 v+ j1 I; K) ^ set A_i to 11& q7 K9 p7 `+ T2 q F
move into Q_induct2* i3 x2 d6 \0 k0 F7 ]1 ~9 y. b
move into pickaisle.induct2: U( {" t1 k* F& y2 e' {/ `+ }+ B; P
while A_i<=30 do begin
$ A' e1 {. L9 S; B# [$ d travel to pickaisle.con(A_i)
4 L v6 y( h9 r* @. w if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" e6 T0 ]% ]; O2 l
else wait for 10 sec% p: D. ^ {8 g( `, h$ a3 y
if A_i=A_leave then send to die: F- {/ ~( [4 \* h) n
else inc A_i by 1
* Y/ _& H, L; w3 x end
# U2 h! W$ |/ ]0 J) Pend
1 g1 G1 o3 F* W9 z; M1 }$ }: F( h. K; W2 o. Z, d
begin P_pick3 arriving
% b+ ^# k' }8 H8 n* y D set A_i to 214 D. a7 a. V: S p
move into Q_induct3
! ~5 W% {5 ~2 y move into pickaisle.induct37 x, A6 Z% V/ [! L
while A_i<=30 do begin5 N$ V2 p8 I) M2 O+ d
travel to pickaisle.con(A_i)
% { i6 |6 v& U5 R4 F3 v+ W7 v7 ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 a. c$ ?3 R" Y$ K! x! W else wait for 10 sec9 E/ z" d1 x. L5 [+ I
if A_i=A_leave then send to die4 e7 }* F/ u4 Q* _5 ]
else inc A_i by 1
& a0 @2 |* q- c+ d3 K end
6 y1 b3 K" ?$ X8 ^( q3 W8 ?4 Kend |
最佳答案
查看完整内容
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,其它按你的 ...
|