|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 B Q0 Y" x( q! H, P, L: u7 Z# t3 _7 |, }/ A6 q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。" N4 a6 k. l) ~
3 D9 V/ e( \! T( Z0 Zbegin P_read arriving
% O. a+ _; S& F) o. G while 1=1 do begin
# |" M7 d6 }2 e6 [& v7 m( g read A_tote from "data.txt" with delimiter "\n"
5 @; h/ \% f/ M! D5 N2 d& j n$ I read A_time from "data.txt" with delimiter "\n"
) ^! K* I/ R% s/ \ read A_leave from "data.txt" with delimiter "\n"
) |' S. z4 s+ ]; a; R read A_picks from "data.txt" with delimiter "\n"
/ Y3 h2 x* s7 a0 p- ~ set load type to A_tote- w$ W W8 _; q9 E& h8 {
if A_tote="tote 1" then set A_induct to 1
' o$ o# _; K: Q- ? else if A_tote="tote 2" then set A_induct to 2
; ]6 R' l/ w- K: Z7 |- O% W else set A_induct to 3 9 v- U6 y/ h2 W$ B5 h
set A_i to 0
% p9 w0 c% g& r# x( {+ b* ^ clone 1 load to P_induction2 ^; o4 e! A6 g$ ?
wait for A_time sec
. H. k. F2 W# ]7 n/ F8 d end
0 y. I; \5 s7 p9 A/ S: ?end' d; y( X+ Y) S
4 I7 ]9 S7 o8 u& @, k( e* rbegin P_induction arriving7 Y* h: ]7 D8 P1 I
if A_induct=1 then clone 1 load to P_pick1
% V( U0 l! @8 _& T, l U/ ^3 s else if A_induct=2 then clone 1 load to P_pick2 N( M# Q' Z2 V$ o' |
else clone 1 load to P_pick3
+ i9 l. r. Y. P% D5 } p& `end
, U) m1 b" t: P8 U# i" i! b! s
0 D% T4 E" `% X# Abegin P_pick1 arriving' w" w0 |4 U7 F% y9 D3 q, \
set A_i to 1& R* X/ A: M9 z: L+ c: n
move into Q_induct1
2 S4 f3 Y, P* P- j+ Q/ A" n4 B move into pickaisle.induct19 E! W8 |7 V" {) N# a
while A_i<=30 do begin
1 F0 ~1 e* } X& [: ^; _0 b travel to pickaisle.con(A_i)5 {- x2 m6 C+ I j% h
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) I1 r! w% K j) M& V, I
else wait for 10 sec( i+ a# L( K K( ]4 W
if A_i=A_leave then send to die
; P- \8 c8 `4 K' X else inc A_i by 1
5 J T" F$ n! e7 S( ? end+ A$ i2 e( Y% j
end
8 D: Y( t H/ q( Z0 K) B" L
6 Y4 Z1 J% r) K8 k8 d- mbegin P_pick2 arriving
, k9 C0 X/ R8 G, e set A_i to 11
: K) z& f. e! u! P* C move into Q_induct28 R X! V! o- `! w t( \: ^
move into pickaisle.induct2
/ P" F! ]9 @' k+ \6 o while A_i<=30 do begin$ x& ^. }- ^& ], E7 `
travel to pickaisle.con(A_i)
2 I9 b/ H, k# z6 a0 F% W) A1 | y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* P R# C0 y3 K' y% r else wait for 10 sec
9 V n, E2 `5 ^# q) h; P if A_i=A_leave then send to die
; H6 T7 Z: N) F& {' j7 d else inc A_i by 1
- q$ L2 l+ t) C- y6 m- j end6 j# Q! q; K6 V& ~+ W; I: j
end u% r. U8 ?- _) s1 [
& k X h1 x! \7 {( O6 m! W) B! pbegin P_pick3 arriving( v3 A1 m0 z9 G, v
set A_i to 21
* U* Z( i( ]$ \# o! Y6 o move into Q_induct3
( T' a9 y0 S8 z0 [" O$ o9 G s' q7 b move into pickaisle.induct3/ ]) i5 W E/ F1 {' `; t) C
while A_i<=30 do begin
: g. G O, f3 G/ N" |0 K# P travel to pickaisle.con(A_i)/ Y0 A3 y* } p3 r7 D& t
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- `; r- L, \$ \7 p& V0 P9 O- x else wait for 10 sec: ^6 g/ q+ S+ e, x6 B$ ]& b. V4 h
if A_i=A_leave then send to die
' N5 a# H% ]& K3 o6 W else inc A_i by 1
. j& }3 f; g: q; Y2 {* i8 C/ g end7 r4 w: P) D! z m, s$ B w
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,其它按你的 ...
|