|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 x" l$ t6 {, c% x3 m) h1 W& w, s) S1 C$ ?1 ~8 ^# w- L
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; @. i# z3 m- V, P9 g5 I; W+ K* m7 a$ }7 B* g1 S5 k! ^3 m: [5 Y
begin P_read arriving! O B: t* O- Z' L( `
while 1=1 do begin
1 h0 L% W. p" a0 J( E* H read A_tote from "data.txt" with delimiter "\n"
: c# y2 c8 e' }/ G/ [( L; D6 m) M) ` read A_time from "data.txt" with delimiter "\n"
1 J, y" t! S* j& i @; w# x read A_leave from "data.txt" with delimiter "\n"; B% ~- u: U. m9 B
read A_picks from "data.txt" with delimiter "\n"4 @% F7 G+ M7 Q( T+ D2 |
set load type to A_tote
1 B' Y+ j; j$ i3 @. h: | if A_tote="tote 1" then set A_induct to 1
( p9 \6 S- W* I, N else if A_tote="tote 2" then set A_induct to 2* v& ~- T9 }6 y. f% Q
else set A_induct to 3
! U1 ]7 i" ? V9 M" W+ j set A_i to 0
: P6 i% t2 e9 w5 C6 O clone 1 load to P_induction( H3 ^/ T" c1 B1 ?) K) c( {
wait for A_time sec
% F; ?6 h4 O, L! c end
8 n$ k `7 E2 C) iend
3 r h( V+ O2 U. v8 y; I/ O! F1 w6 Z$ k, d
begin P_induction arriving1 @5 W" J, p2 r) c$ {" s
if A_induct=1 then clone 1 load to P_pick1) g' Y5 u. s; g, U
else if A_induct=2 then clone 1 load to P_pick2
- i* E1 Q* w6 K4 n( i2 v else clone 1 load to P_pick3& O; ]. R& i2 x3 V& b# z
end
# g/ Q$ I1 s1 D K2 D1 `# ]1 N: U* a9 s2 o% ?! D' c& v
begin P_pick1 arriving2 w1 e# X, D/ L# L
set A_i to 1! p1 z: {$ W" G% t! i8 ]0 G( {; G
move into Q_induct1
! Y' j' d/ P5 q; M1 U2 S+ e! Y move into pickaisle.induct1" O3 n, x2 v; C" p* V8 u" e9 t
while A_i<=30 do begin: Z' M1 N; X# y* e. q/ ]3 Y
travel to pickaisle.con(A_i)3 w8 X* P: w" M. g) y7 z* h
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec {. v! W9 J# t7 E) Q
else wait for 10 sec
% T- L9 U/ ~$ ~/ X. m3 Z. H if A_i=A_leave then send to die- @3 @: j- s+ _
else inc A_i by 1
) {" ?- @$ H& n) ^. _& _" g end: t2 G5 l5 `" E
end, B5 ?- X* W' z6 s1 H- G# f4 f+ F
0 |; g4 G2 L+ u% h K8 `begin P_pick2 arriving
9 ^- g( t+ g3 ^5 M( D1 }7 t set A_i to 11, W# ~, r' [& Z5 o3 U7 e
move into Q_induct2
: Q" y b5 T; l& \5 E6 {( L9 |$ Y move into pickaisle.induct2
& Z9 ?& o$ {5 S) e+ h* Q while A_i<=30 do begin
6 y" {2 C2 I! m travel to pickaisle.con(A_i)8 }2 E7 X e) c" U) ^# T+ b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: R$ s5 q7 j+ H2 l5 S) ^, K& c
else wait for 10 sec
% K/ a! L F' I) s if A_i=A_leave then send to die
) G! C" |9 I4 ~ else inc A_i by 1& V( w. Y8 T. r4 v* Q
end" z7 T& |) W( H0 l
end- s7 f/ [2 Y* t4 A% l# K' \
" d( U, U/ y. C3 N+ k% Z( Zbegin P_pick3 arriving
" E* Y0 d8 u2 t; R/ \; C4 b set A_i to 21
( r/ h, P+ s$ _+ ^- B# z( } move into Q_induct3
) x% a9 ~/ S* w* m0 z l6 N move into pickaisle.induct3
! R$ x0 w( h2 P9 e: j- ?/ P while A_i<=30 do begin" o4 g' l) ^' @2 `
travel to pickaisle.con(A_i)
; {, B2 t/ j5 S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' ~( [7 C$ a4 j0 O* U' {5 \ x else wait for 10 sec
: Z# \9 Z( B2 M, J if A_i=A_leave then send to die$ o3 L3 }0 I$ R8 a, A$ i
else inc A_i by 1
. W5 [# T. l8 t6 Y! v$ Y1 Y end3 t3 r( @) |/ k
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,其它按你的 ...
|