|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! @; j" z6 ^2 {3 |) B! q0 ~' X8 n& D* j0 p: 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中的数值,不知道会不会有什么不妥。
5 _* T8 b: n( b, H5 R. f" Q- h% X/ H6 ~6 T) v3 M0 b6 Q
begin P_read arriving
2 r' n4 Z% s/ Z while 1=1 do begin$ L; e1 J- [ \! ~
read A_tote from "data.txt" with delimiter "\n"
9 n+ U g7 j) K( M2 n, B read A_time from "data.txt" with delimiter "\n"3 H6 m' _6 [5 V* Q
read A_leave from "data.txt" with delimiter "\n"" z6 Y9 ~' ]( [' N& w% l
read A_picks from "data.txt" with delimiter "\n"
4 _5 F7 b- o$ f set load type to A_tote* _$ b' b" p4 P4 G
if A_tote="tote 1" then set A_induct to 1
$ G! X+ _3 x- w, m' {7 g9 z \ else if A_tote="tote 2" then set A_induct to 27 V! o. m5 \* L) R7 l ?
else set A_induct to 3 & v8 r g3 Y8 v5 \- i% C7 o& a4 n
set A_i to 0
x9 N& {7 O+ k* c3 Q2 a clone 1 load to P_induction% M" ~6 j t2 a H5 S$ p
wait for A_time sec
6 ~' H$ P' e _; O' e/ G+ `8 } end
( ^/ V, I- O) Y, Gend( P6 q% R+ h& ?+ _
0 x' n5 I/ z* e5 q
begin P_induction arriving
6 R0 @ _3 v3 ?9 C) ]# z+ E9 Y if A_induct=1 then clone 1 load to P_pick1( U4 t5 ?, @; [' y
else if A_induct=2 then clone 1 load to P_pick21 A9 W/ a6 Z+ l y
else clone 1 load to P_pick3
- g$ s" A- O% U! V& m0 k7 Kend( |! H7 s) O# l, g. [4 _
: R& I$ h6 G# u- ~9 c/ Y
begin P_pick1 arriving* o. d a8 B8 N8 B: h4 H1 a
set A_i to 1
- Z" j& m/ p1 y' q move into Q_induct1( X! N0 N$ A( |% a
move into pickaisle.induct1
6 s$ B2 e0 p2 n% l' I6 r+ t while A_i<=30 do begin' s. l# l' M1 e9 e/ Z
travel to pickaisle.con(A_i)
3 B# l) M. F* Q2 h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" S5 m' W- P' V9 Y( _! x( ?
else wait for 10 sec, a" O0 F: g! o* b. o/ o4 ?* y% R
if A_i=A_leave then send to die1 O6 s0 |7 T3 r* b6 C2 I
else inc A_i by 18 T& L- q( H4 f: f4 g# w
end
) l0 B) j: v: F, b8 n3 k* cend/ g' U' G. h3 y
7 i% u6 a# u, M9 t [! `
begin P_pick2 arriving
8 c( W4 p5 D' x: d0 I) G( U set A_i to 117 \; P a- |( P' s/ c
move into Q_induct2; u4 ?* O4 F0 X" _% i, H
move into pickaisle.induct2 V" W: P( d9 | n$ M& j
while A_i<=30 do begin8 w' q, R& U1 G. W, R6 n
travel to pickaisle.con(A_i)+ E, ^& s! a2 Y- i4 O0 K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 t3 O9 f: {& s, Y, e7 ? else wait for 10 sec) y& q1 \- ~1 l2 {% u0 o
if A_i=A_leave then send to die
L. d) u, ]2 ]8 ]' H* k& s else inc A_i by 1
! C9 k* e, v- V) t8 i8 h1 a end
# P N: ?4 K/ o+ f9 v' d( V+ |end
( H- Y( A f9 m* W" t
7 G/ [* {" u4 I- a, tbegin P_pick3 arriving
/ `/ Y$ }+ S$ K' o. z set A_i to 210 [7 s ~0 U5 H$ x
move into Q_induct3
* U/ t. A+ P( U( b( ?( n- ~7 T move into pickaisle.induct3
) R$ i' d) z' G/ i while A_i<=30 do begin
3 m$ ^' T7 Y1 G r% u travel to pickaisle.con(A_i). j1 `7 d2 h' I; x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 U) T7 ?1 n1 u# i R' O/ t, B8 P6 ?
else wait for 10 sec( T' u, ?0 w' [/ ?/ J* s9 J' X
if A_i=A_leave then send to die( b+ D1 r) y4 C! `4 x4 [+ L5 p
else inc A_i by 1
' V# J$ ^* X& T$ E. V end6 r+ s# z) h( g, Y: \- c
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,其它按你的 ...
|