|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ Q5 T# A+ W3 S. C, o2 f
2 g. j( y7 S' n5 Q" E. X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 C$ E9 Q7 E7 I, M8 r
3 ?8 F+ z. l* F3 D& R8 P
begin P_read arriving
% P& e; O; G- d1 f6 F4 _6 E1 M- z: s while 1=1 do begin; v& Q3 P) \9 r- q
read A_tote from "data.txt" with delimiter "\n"
* v9 n% F: f' l/ P: r1 U9 o# P8 K read A_time from "data.txt" with delimiter "\n"- s) A- X, e: F* k0 U/ R
read A_leave from "data.txt" with delimiter "\n"
1 h. i" Z5 b. j" ]% P7 p( ] read A_picks from "data.txt" with delimiter "\n"
- M( B+ [0 A6 Z: a) s. h9 i1 p8 ` set load type to A_tote
+ M. K2 R" T/ g5 l( C4 ? if A_tote="tote 1" then set A_induct to 15 |+ w) H, c- Q* z' A
else if A_tote="tote 2" then set A_induct to 25 M1 J J# k, C- I( W
else set A_induct to 3
" u8 A* Z% f8 m" e6 O* S set A_i to 0
/ l5 X9 b0 E6 Q clone 1 load to P_induction5 S) Q: [5 I' l) k
wait for A_time sec
# o' x) e: F6 A7 C- | end& W/ l: P. y4 L
end: n" n) H. k: k
; ~: O4 ]; E* ?* R" n1 o
begin P_induction arriving
! n- I5 V4 @0 U& ]" m9 E3 \ if A_induct=1 then clone 1 load to P_pick1
2 i6 }' s1 p8 h) w: K6 u else if A_induct=2 then clone 1 load to P_pick23 W# W' T8 }! {/ f9 }+ @ g" d
else clone 1 load to P_pick3
! I0 \4 @/ F: w, x2 pend
$ x, h4 J/ E& F3 U, h+ ?8 H& S; A! s9 P; M
begin P_pick1 arriving
2 q) x$ k( t+ I& ?+ _: q9 \+ Q set A_i to 1
- ^7 W6 W# b: ]) f move into Q_induct1
% m- U6 p* t* l+ _3 B m% u move into pickaisle.induct1
3 l! F7 H# I' A while A_i<=30 do begin
1 v% V% g( n8 g1 K travel to pickaisle.con(A_i)
* U" ^. B/ e, N+ r/ [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 V- |. q" x1 k( ~, Q else wait for 10 sec
. X" L5 S9 W1 _7 S/ V if A_i=A_leave then send to die/ D- y& K' }2 y
else inc A_i by 1
9 w' u0 }$ v! q! P1 X end/ \& d2 c1 V/ f! {
end
! T/ x1 F* h2 w0 k5 K3 e5 u0 T& q* }! F6 t O: _" a: O& N
begin P_pick2 arriving
8 `9 L3 k" g* _& V' F set A_i to 11. `! w3 D! m/ |$ R8 J5 J6 n+ _' g- i: Z
move into Q_induct2+ O3 m0 Q$ |3 e9 r9 m0 C" m! E" U6 R$ G
move into pickaisle.induct2
% ]5 u: [" M' D8 L/ d' \ e0 H1 ` while A_i<=30 do begin- q1 j' p# F, }
travel to pickaisle.con(A_i)3 P7 g& E2 J' a ~" \, c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ E/ w/ a9 ~7 Q# A% h8 h$ P
else wait for 10 sec! K3 V" Z( \0 t, n
if A_i=A_leave then send to die
* w# [' u( O9 K \4 C v else inc A_i by 1
7 U$ E# ]7 b+ R! W! E0 P end
+ U \5 |8 \" B: S- t1 uend
& q# i6 s- g- z! n- h" y6 ^+ L, ^9 D _/ O
begin P_pick3 arriving0 f4 f: P! o) U0 j/ l7 h- d' r
set A_i to 217 a- N" W; O% J$ y. E5 c
move into Q_induct3
( ?! |; {3 R8 ]/ e! D8 ? move into pickaisle.induct3
( g. C& L- M! s- g9 |7 \/ r while A_i<=30 do begin1 d, B$ W3 s: M2 r1 [
travel to pickaisle.con(A_i). j2 e0 w. Z/ c* |- ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; [' J7 i: h5 b# Z% y, Y8 y9 i% H
else wait for 10 sec
( f5 `# G) V# Q8 A if A_i=A_leave then send to die* |0 U G9 ]0 E2 d: q6 f
else inc A_i by 1: k* `; J8 m5 _4 X8 W7 l
end+ C# U1 C; H" @+ }# |
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,其它按你的 ...
|