|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 Y2 R x- W2 ^
F2 f4 X4 Y! d7 Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
- e9 ~" @4 S5 q; @' a, i5 h6 p* w9 K- @4 A( ?# a5 H r7 X
begin P_read arriving U8 ~ N2 _4 D) l* Q
while 1=1 do begin/ l! o6 I4 `# y" h
read A_tote from "data.txt" with delimiter "\n"
2 I o6 a# M. P, d read A_time from "data.txt" with delimiter "\n"5 ~+ `" c" P/ g1 R, ^8 P
read A_leave from "data.txt" with delimiter "\n"" G9 G: U+ h. m9 P( j8 @: g J
read A_picks from "data.txt" with delimiter "\n"; d; p; i( z& [/ |
set load type to A_tote
( `/ K8 W, g `! _4 O0 M+ Z9 l if A_tote="tote 1" then set A_induct to 1% |7 ^6 I; Z% x" N
else if A_tote="tote 2" then set A_induct to 2
2 e% P5 r0 W. _. l8 U5 | else set A_induct to 3 1 d$ y! @) c9 l2 }/ B9 G( V6 v
set A_i to 0
3 n+ k5 C @& F0 y# O- T clone 1 load to P_induction
- w0 Q- ]& t e9 w) }7 i wait for A_time sec
i: [3 `3 b% E% U- U b# Z L. T end
2 j- |1 b0 k& c0 }. x4 o4 Fend
$ q- n0 F8 H0 P7 E
: y) j0 |9 r T, j4 I% O0 f/ Zbegin P_induction arriving# I* P H$ o5 V! }
if A_induct=1 then clone 1 load to P_pick1
8 \% T T" K. N7 C% X) y else if A_induct=2 then clone 1 load to P_pick2
X' o* m! c0 [, K else clone 1 load to P_pick3
' ^' Z) B3 {6 O7 P/ B( Bend% ]) O# s P, T8 N+ w
: W. `0 ^1 X) U: m; c' V8 {begin P_pick1 arriving D& O5 N% \" q! E+ B$ V
set A_i to 1, B5 W8 E% g" p
move into Q_induct1
8 `" H; ^2 ~* h; T1 s move into pickaisle.induct1
' C- n0 I5 f, [7 T while A_i<=30 do begin
- A) y1 e+ f+ A* q( K9 ` travel to pickaisle.con(A_i)
1 O: v+ O# f' C% Y5 D% V9 d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ F$ v/ b/ n" b9 f) p else wait for 10 sec
/ T6 D- t) E4 K if A_i=A_leave then send to die
) e- V% n% q) {; } else inc A_i by 17 X& S& v( }) N
end
! p: P% V9 h$ w4 o6 F# N3 aend# d7 L; ~4 i5 D4 @% m5 U- d% F
$ o; R0 J D N+ F0 K6 G4 a+ fbegin P_pick2 arriving
* ?" H0 _; V/ B; B4 T/ D v set A_i to 11
% Z! k: b, T n* Q) i. L7 k6 V& J. d move into Q_induct2
( I b* H, Q3 v1 U. I' s move into pickaisle.induct25 b! L+ e* j3 V
while A_i<=30 do begin- X% \" C- I! r) ^1 j2 Y/ F
travel to pickaisle.con(A_i). N1 Q2 q# G# s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) |2 x3 _0 L. f* s4 Y5 ]1 f else wait for 10 sec+ w* k1 [# K; F1 h7 \1 V4 o v! B
if A_i=A_leave then send to die* A4 \6 U S$ Z2 H/ Z) ?# ~9 y4 w
else inc A_i by 1
7 s9 k/ v5 J o g end
3 ^% k& W8 c0 [! j" _1 s1 Iend
! L7 I+ p, O) X2 L- a( z, H7 C% s: h1 S5 O
begin P_pick3 arriving
" x; p5 |1 {# {! E- \) \2 ~! h set A_i to 21# N' T' A+ k- t, r/ A
move into Q_induct3) l$ D/ L1 F# J: x, N
move into pickaisle.induct3
/ u8 m* [4 M S' I. V" h while A_i<=30 do begin
8 s- T: M/ e$ Q& U travel to pickaisle.con(A_i)
) Y) e+ E% C+ h* e2 u# c% P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 N" n" X% _3 `
else wait for 10 sec
" Z9 O# J+ ]- F$ Y6 i) d" t if A_i=A_leave then send to die
( }4 q1 z- |& A# x* ? else inc A_i by 1/ K; V% z) b1 l5 Z/ n% p- H
end
- t6 c8 G, U1 @! M; W z' `2 Hend |
最佳答案
查看完整内容
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,其它按你的 ...
|