|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ e7 w# |2 S' M+ i
# }9 z' `/ X* o; z! I( L; c% @: 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中的数值,不知道会不会有什么不妥。$ G( J) [5 z0 C2 U( I0 y
: G9 \' _) L, o2 A4 M9 i( `0 x6 f/ h
begin P_read arriving
5 g, g. S: M& u0 o2 t m while 1=1 do begin
' u+ Q8 U) ~/ m9 v$ P4 G6 y read A_tote from "data.txt" with delimiter "\n"0 O- _, I6 A- J$ ?! ]
read A_time from "data.txt" with delimiter "\n"4 A. c& m: N3 i$ Q0 S5 S
read A_leave from "data.txt" with delimiter "\n"
" w" ]* [' N1 s read A_picks from "data.txt" with delimiter "\n"
5 L% x( k+ r0 p0 N9 t set load type to A_tote, s. f$ C# ^% x5 U, m
if A_tote="tote 1" then set A_induct to 1% v% S$ U0 E1 F! I) [- p
else if A_tote="tote 2" then set A_induct to 2
6 W1 `) d& w# t$ K7 I0 K+ V else set A_induct to 3 ' J( P* ~) p4 v* R+ G6 }" U4 t. ^
set A_i to 0# A' z$ ]. E. c2 [4 V V
clone 1 load to P_induction+ y- ~6 m) n! M% `+ N
wait for A_time sec/ n% {$ D; g: p' P& u
end
1 g2 Z" a" V/ W2 \" ?& ~end% f: i! s2 y0 r. D- T5 y
, [9 S7 o1 i% j: W4 I
begin P_induction arriving
/ q0 |$ O. E! K1 @ if A_induct=1 then clone 1 load to P_pick13 T0 y- K' }. j# F& S
else if A_induct=2 then clone 1 load to P_pick21 Q3 t% O; @# F3 t6 V) U
else clone 1 load to P_pick3
, }: L& @" i/ J! A, v) ^$ n5 Jend; m/ b' X( K5 [/ V8 Q1 e6 o9 M
% t/ l3 d. f& R1 pbegin P_pick1 arriving3 | Z' }% Q4 g
set A_i to 1
, ]& m) {' X( r1 i/ X) @ move into Q_induct1
, y" O5 o, x: F9 }4 y) b0 J move into pickaisle.induct1
" E' m8 [1 a8 C while A_i<=30 do begin
; v5 s; x; J% Z/ Q travel to pickaisle.con(A_i)
) O# e7 Q" g5 Q( o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' i3 _+ T" R" f! P9 \: M/ c
else wait for 10 sec
& n& _( R# V7 D9 d" ?6 F9 m if A_i=A_leave then send to die* T) s8 b' ~ F3 {0 s! f
else inc A_i by 1+ W' `2 b8 V, J" i# Z
end
3 r5 @; d1 Q$ E! ^4 v2 {% ]end
; k8 I& U$ N' E: D8 m) u
; v" a- M, ]$ Jbegin P_pick2 arriving+ u& m! Z" g* i/ h
set A_i to 11
6 {) m R- a, w, h$ t0 u move into Q_induct23 L) h# v' _% f% e2 o7 d* _ C( W
move into pickaisle.induct2
+ E/ E) ]: `8 R% \ while A_i<=30 do begin- p! j& A. w4 L7 Z6 N
travel to pickaisle.con(A_i)& x9 B" V6 ?) ?( @# V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' b$ z3 ]! O' x# J8 T else wait for 10 sec" r- a4 o7 z: q1 ~- }* x
if A_i=A_leave then send to die* d/ H1 ~9 y3 @& ^6 B* R
else inc A_i by 1
8 ?: O2 A6 ~3 l G! _! s' v: Q: [ end
/ e) N* P4 f9 _! Tend
. m6 |( [9 R2 z$ v
7 @6 p: s5 _. c0 r9 Qbegin P_pick3 arriving
3 K1 s4 E h1 |9 a+ p set A_i to 21
) D8 x m1 w5 t7 ?" ^+ l move into Q_induct30 n; b0 R3 i7 u1 M i; W c% E
move into pickaisle.induct3
) y) z6 {5 k. \4 [; ?1 r& } while A_i<=30 do begin
. _# H d& E/ \6 ~. q' G) q' H travel to pickaisle.con(A_i)
0 i9 D, ], x' i* j# ~. W4 x1 I* ?1 x3 D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 \+ n8 o2 E; c else wait for 10 sec4 U$ f8 v0 E2 H# B
if A_i=A_leave then send to die
9 W: z" u( n) n0 J U else inc A_i by 1
/ x4 S- ^ v! J* }+ K. M- u end! }$ I! r" y/ |4 t/ O! o& L
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,其它按你的 ...
|