|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 p0 i9 J9 z6 p8 L* P S6 d
" X$ E) N3 }) l) H
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& z, m; m1 u1 |' D& T, J/ ^
5 w* M* R. o0 @3 c( Y1 O9 r) h# Q4 Lbegin P_read arriving
! O& L9 W( f$ P while 1=1 do begin" u% {' A8 g: p
read A_tote from "data.txt" with delimiter "\n"8 ~, [8 Z& [: l+ x
read A_time from "data.txt" with delimiter "\n"
0 j" f" m( D' q9 a/ u8 q read A_leave from "data.txt" with delimiter "\n"; a3 I8 A; P, h& ]% m& G
read A_picks from "data.txt" with delimiter "\n"6 O' O- ?3 s( k# R
set load type to A_tote+ M( @0 |! F$ x. B+ U6 n) \8 I# N
if A_tote="tote 1" then set A_induct to 1# M& X7 }, U* S
else if A_tote="tote 2" then set A_induct to 2) H! P0 Z2 i! ^! j" `' M
else set A_induct to 3 6 x' A5 \& b3 x! o
set A_i to 0
/ M2 ?% `" X& J clone 1 load to P_induction
/ E+ y+ Z. U# c: K. {( }! L$ [ wait for A_time sec& {) f) R4 ]5 M% x
end
& n n k/ |6 C3 ?: Dend
- i4 X9 g) R& R8 J) d7 e; ]
5 O7 @2 S, s6 [9 ] `( Cbegin P_induction arriving
- v: V0 b9 e+ F* b if A_induct=1 then clone 1 load to P_pick13 m- E1 _7 f& v. ^4 k! [
else if A_induct=2 then clone 1 load to P_pick25 e" q; H5 r6 Q g
else clone 1 load to P_pick3- w/ d# u3 c8 F- o' ]
end
* ~( l% m* \* o/ W
* v8 S/ ~5 f' v% n( g3 nbegin P_pick1 arriving' ]' d% m0 R8 f
set A_i to 1
5 v) _% O# u! ^/ s, y( R move into Q_induct19 z1 d6 r9 P1 i, o& ]8 B0 {% D
move into pickaisle.induct1
1 [* a- {$ @( a3 P9 Q7 j4 { while A_i<=30 do begin
/ e V8 C; K0 ]8 i8 q2 F travel to pickaisle.con(A_i)
" t m9 \" k4 b+ w, ]( r I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( X, B0 Q- Z% h: {3 x else wait for 10 sec
4 {6 G) [0 M7 O) s, x if A_i=A_leave then send to die
4 y7 s6 E- D W else inc A_i by 1
. U6 H* f! @! q: B: c end L9 R: H$ w$ ]4 F) o
end
$ J$ O: t; }# M* i, L
# X* v% j3 o1 K7 n) C. [3 [ j3 dbegin P_pick2 arriving
# m3 l$ l3 \( L& I1 p: r set A_i to 115 @) \9 _ |, {6 [2 F
move into Q_induct2
% U2 v) d5 w: n3 R4 k move into pickaisle.induct23 @6 w/ }5 G+ r' D9 r
while A_i<=30 do begin A5 s* U! M& N9 v, {5 X$ E
travel to pickaisle.con(A_i)
. ?1 H1 {) E* S+ U8 Q7 f( B& L( P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; j% u' j: Z; x% H& {9 C
else wait for 10 sec
0 J4 [- I: h9 F* Q% q7 T if A_i=A_leave then send to die
. c3 n) l3 N# P4 W else inc A_i by 1
{; K$ S6 B' m4 S7 E8 l. [ end& I) U" M. c8 _$ q
end4 m* D! F7 K. i8 a' R
. U4 a2 u1 ~5 f0 h" K* h1 [; c
begin P_pick3 arriving
/ K8 w: ^- x7 B6 Q! M6 q set A_i to 21- a1 X5 e+ J- `4 s
move into Q_induct3
$ j( A D9 c, C- n; r7 b8 j9 i move into pickaisle.induct3 F; a; y& j8 w- C0 ~+ n
while A_i<=30 do begin- }% b4 G; k& Z1 P" I
travel to pickaisle.con(A_i)
* Z1 K |, r5 ~3 @$ z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 H$ C `$ l4 z) _( T6 |& j, H else wait for 10 sec
+ H; m1 C3 y4 G" d% }% {, o0 u if A_i=A_leave then send to die' C/ j) H( c z. g5 U
else inc A_i by 1
6 k. V e/ x; l8 R9 }8 a' n end5 M& V- O+ y5 t Q2 [4 E! p7 J0 [
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,其它按你的 ...
|