|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) j# B' Z7 U( h, w2 U
" E. J1 e+ Z7 t, 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中的数值,不知道会不会有什么不妥。$ X e8 z+ g: l6 i
: x) E7 C" y- l/ Y# P) c" C8 w+ J+ @8 w. Rbegin P_read arriving0 H: X/ E+ q) \6 d
while 1=1 do begin2 Q: d$ j: I! Y" w( }) u
read A_tote from "data.txt" with delimiter "\n"
; y1 p: G5 \' k read A_time from "data.txt" with delimiter "\n"
( P! e Q. ?, M% J read A_leave from "data.txt" with delimiter "\n"
: ~2 \; _; q9 d) G! j read A_picks from "data.txt" with delimiter "\n"( s7 ~+ W# _, h" ~ a) f
set load type to A_tote9 M* p" y1 O2 G2 Q
if A_tote="tote 1" then set A_induct to 1) `% C$ S: y7 q T
else if A_tote="tote 2" then set A_induct to 2
' p6 q# {* X7 x; M3 f else set A_induct to 3
+ W, |! v9 x* [/ a: {' h) a/ { set A_i to 0+ M/ o# a, j. h; A
clone 1 load to P_induction
' ^% f( K8 ]/ J, h wait for A_time sec( N+ R. F: b, P3 f& x
end2 g, F0 B6 r; V) S* A" f
end* L' U e' [0 V) H/ z: y+ d
( a8 X) R" ^7 z7 }+ E6 Y
begin P_induction arriving, y9 q6 y; E( N, b
if A_induct=1 then clone 1 load to P_pick1
7 t' Y) g3 ~ d7 x6 D else if A_induct=2 then clone 1 load to P_pick2
/ W ^) P% Z) \ else clone 1 load to P_pick3. f1 W3 T9 S( ?0 e b- u) F4 z% Y! f
end
# F3 K# `2 j; R
% q; K1 S" A# N+ zbegin P_pick1 arriving
* X$ Q4 u9 q, o" W- ^ set A_i to 1
; ?3 {$ H$ k* L# n9 ^) @ move into Q_induct1
- C% `7 E$ E& c; Q8 h2 B move into pickaisle.induct16 R$ L8 R) a5 N% m8 O; Y
while A_i<=30 do begin7 K* u! [1 C Y# t; L/ v& }- [2 G* k
travel to pickaisle.con(A_i)
6 I6 i% [0 \9 j2 ^5 ?9 L% J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! c' ]' X- p3 d5 _$ k2 |
else wait for 10 sec, `- A& k# W9 X
if A_i=A_leave then send to die7 ]0 o6 y0 W3 @
else inc A_i by 1
}- M* ~6 h1 _( @1 Z# i. r end& R. G5 k. L0 a6 ?. M+ ]
end8 j7 [) a. T5 E" `) a% X3 E# }3 m/ J
* @) d% `8 J$ d" \5 kbegin P_pick2 arriving8 e% c$ d6 P3 C# k9 u) Z
set A_i to 11
7 |' b7 ?9 Z9 q& ^1 Q2 B move into Q_induct2. A( S( W# I7 J2 X( @/ ]
move into pickaisle.induct2
4 X( `% `* i, _1 r while A_i<=30 do begin8 O* F( V/ ]* _6 {
travel to pickaisle.con(A_i)
- `$ W, K( N8 o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ b' J; F, o# o; h
else wait for 10 sec
3 I) z( V5 |$ j- x4 _9 q9 P5 q if A_i=A_leave then send to die
) A f) I3 e! Q/ v- ]. u4 H# S else inc A_i by 16 ?( o6 q% Q+ J1 z; g* r; S
end
) E+ ~2 S( }+ ~end
3 S# {- l. c* d1 x8 \: r2 o. \' t$ p5 q: F
begin P_pick3 arriving7 B; z: [/ Y" [1 N. f2 \7 t
set A_i to 21
, X$ t: z7 B7 }$ F" F move into Q_induct3& e/ J, z( C) U; B
move into pickaisle.induct37 X4 Q/ ^5 M1 z% e( u9 G$ o0 Y
while A_i<=30 do begin' W, e9 a: i0 H$ q/ F
travel to pickaisle.con(A_i)9 r3 a$ h* x% r: l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 r% t$ V. |: x else wait for 10 sec
- H& F8 r! M' N- q# m: G( Z if A_i=A_leave then send to die
; T3 q) U$ p+ Q/ B else inc A_i by 11 j. b0 \; G% P7 k
end# m$ W' f" E( Z6 z( U( s: Z
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,其它按你的 ...
|