|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
a6 u/ j5 F# {8 @" H
8 {1 [) S) j. u H6 u- {; [" f我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 y9 X$ @' e. {
- H! f$ Y9 m" s1 ^9 [5 |' A
begin P_read arriving
% ^& P2 C G! P3 n' d S while 1=1 do begin& {+ s0 w* v% I! s5 g/ I
read A_tote from "data.txt" with delimiter "\n"
8 t: w9 f; r& w# b8 D5 H read A_time from "data.txt" with delimiter "\n"+ r! B# Q0 E% K* r" b
read A_leave from "data.txt" with delimiter "\n"
6 y9 b, ]. n6 g read A_picks from "data.txt" with delimiter "\n"
/ _* ^: t4 `& [ P set load type to A_tote
& p5 \, U2 B* m3 \# ?( S) [& p if A_tote="tote 1" then set A_induct to 1
, X' b% h0 U) C/ X else if A_tote="tote 2" then set A_induct to 2
; o. B) r9 w+ M' O5 P$ B9 C else set A_induct to 3
0 `! \1 p4 x3 P2 W( }1 }' E. V$ x set A_i to 0
/ d1 k7 I4 Q. B clone 1 load to P_induction8 ?& [. X4 X" U* ?8 W0 {6 @
wait for A_time sec- q: f+ f1 K: _
end
0 v8 n1 ~; {: z3 i2 fend; x3 o# T7 [9 d/ k( L
0 A* q: ~, Y+ U$ u7 ~1 l
begin P_induction arriving
& V1 p" x$ I6 z. ]# a; y" | if A_induct=1 then clone 1 load to P_pick1; W9 B! }/ p3 }3 g7 a
else if A_induct=2 then clone 1 load to P_pick2- a3 ^$ E& l7 e r
else clone 1 load to P_pick3
5 ]( u* X0 t/ T' Send
& G: P6 B) }2 P3 p3 F, y1 M$ B
* {$ y+ C+ I+ F4 y0 O% ebegin P_pick1 arriving( `' c; J: R7 J: f0 [! i5 @
set A_i to 1; ~7 B( F8 t# f% Q3 B$ _
move into Q_induct1% {7 ?# G3 o0 J/ H! f# I# Z
move into pickaisle.induct1
9 P2 z1 L( K% `4 E3 K while A_i<=30 do begin
6 c5 _5 V' Q7 O- N1 v5 @6 i travel to pickaisle.con(A_i)1 k+ K& r) s& K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 m" i6 j; \0 Z9 f" M else wait for 10 sec
_- O5 R# V1 ` if A_i=A_leave then send to die
4 f: ], T' ^7 q else inc A_i by 1 M. B& i$ |$ | X* g, I
end
" G* f7 \8 j% K/ L6 d# G! {end, s9 z3 W' G9 }6 J3 m' V2 r
$ O4 y+ l8 q( s! i# s
begin P_pick2 arriving# u4 n+ U0 T+ C: _- ~
set A_i to 11
1 V# i& V5 |* E2 `7 O move into Q_induct2
2 Z3 c2 h6 x! g& r0 \ u" n- Y move into pickaisle.induct2
6 b" {+ I1 F. B" ]. L* f" g while A_i<=30 do begin K! Z3 E- r) q7 x) d1 j+ I
travel to pickaisle.con(A_i)
: f. q/ T6 k& B1 S* w+ ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 A1 m) c- v E5 `! ^
else wait for 10 sec, \" f, m. {+ K; b
if A_i=A_leave then send to die2 j, b; X# ^3 W
else inc A_i by 1
Q7 I$ N+ Z c# f( }" P" u end; a; r9 e/ e; o% |
end
: S: d1 I, \+ F4 B5 J/ N" M" \) v
begin P_pick3 arriving3 `' v9 V. |* w' L: m) s- ?! S' I
set A_i to 21
: T6 t8 K6 b- h0 D d8 b0 c% @* k7 ^ move into Q_induct3# Y. K% Z" U3 s3 D' w% o, M
move into pickaisle.induct3- v9 ~: o# R. `/ F
while A_i<=30 do begin; F; x/ t3 K- ~0 o
travel to pickaisle.con(A_i)
+ O p- C1 y" Z! \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ Y' _% q" \3 N) M( w8 | else wait for 10 sec
" t# L4 t1 T, w if A_i=A_leave then send to die
/ I( ?, L' m7 h else inc A_i by 12 H& v# e% F7 Q( e; ~
end2 Z$ e. T/ k* \ v6 b! e) G- g
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,其它按你的 ...
|