|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 ?* S9 ]( X$ I, C
( x& r& C' ]) J0 q我的问题是,在每个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中的数值,不知道会不会有什么不妥。. ]8 o( F, `- @" M2 l
. A/ T* A( o; _0 X0 v' \8 \begin P_read arriving
- b( l6 i0 O i( O% b! l. ]- W while 1=1 do begin* J8 H6 P6 K5 ~: i* Y( i
read A_tote from "data.txt" with delimiter "\n"7 g" @+ V- l. C [* b6 P- X' ^) i
read A_time from "data.txt" with delimiter "\n"
) a' c+ u2 G1 V) J1 W read A_leave from "data.txt" with delimiter "\n"
/ J: {) X$ `! S4 \- f read A_picks from "data.txt" with delimiter "\n"# {. t: d% ~$ D& b+ r# |
set load type to A_tote; d/ V" T& q/ _* y3 F5 l$ r
if A_tote="tote 1" then set A_induct to 1
# y2 p6 k9 H% v2 z3 V- N+ Q! S else if A_tote="tote 2" then set A_induct to 2
( S) ?6 G' p/ i7 V. G# f else set A_induct to 3 5 i$ t1 b: J, |3 A `/ I
set A_i to 0
( F/ [9 n3 y# x5 @9 i+ O7 \ clone 1 load to P_induction0 Y9 O/ t& a5 S1 g1 I' T5 C( J7 B
wait for A_time sec
; @- m- l2 Q! Z" b" { end% a* m" x5 O' b: U. {$ L7 G8 _0 c2 A
end# c9 k: S9 X. x }/ D
) J7 ?6 C$ |& v( o1 {( |: a
begin P_induction arriving& U9 X+ Q1 ~' w; N( m! a
if A_induct=1 then clone 1 load to P_pick1
4 i y. @7 y' c$ @' G else if A_induct=2 then clone 1 load to P_pick2
9 ]5 F+ }4 s+ R _1 ^: m+ C0 j3 t else clone 1 load to P_pick3: v# Y/ B' b4 h0 Z
end
# S0 Q1 ~- A7 o8 p
' X. @4 F! U- a+ E4 w, y3 X, Z. a( q9 M8 mbegin P_pick1 arriving3 \4 ~: h" l, a- [4 u5 j# [( l( ^
set A_i to 1
3 M% p# v" x b3 ~8 ^ move into Q_induct11 {7 {( B F1 d$ T7 [9 O
move into pickaisle.induct1
1 T' } z2 A7 f, M while A_i<=30 do begin
6 L5 }* E- \9 u travel to pickaisle.con(A_i)
: c- ]# }" G- P( J7 `9 z* a1 t' I2 I4 { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! ~. Q+ D2 V, k: t+ Q2 R$ @" {3 B8 @, [ else wait for 10 sec
7 u: y; v5 ^7 j) N Q7 T3 `; k _ if A_i=A_leave then send to die* ]; |$ W" y+ s; B8 C. ^: r+ ^
else inc A_i by 1; H( ~$ V7 O& |2 n( {6 I5 N; R8 |
end; C$ _# F* }( n
end
7 z' t9 i* z3 o+ H4 c8 G, ]! l7 t+ ]& O# S6 x
begin P_pick2 arriving' i7 O3 A: o$ n+ S
set A_i to 11' _' b7 f( b; I6 T
move into Q_induct2# T' t$ Y+ e8 e* t
move into pickaisle.induct2
! r6 O1 b1 F- V. p4 ^' h3 s* i while A_i<=30 do begin1 g( { }, n5 h2 r- _! A
travel to pickaisle.con(A_i)
4 k H; K- x/ `. y1 }5 n# w if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; N9 V, O( \2 L' e
else wait for 10 sec- d: A' C7 f Q& a" M
if A_i=A_leave then send to die
7 q% H$ U' H, m* d6 J/ V! M: k; f else inc A_i by 1* C$ r$ i- g, w& T" N3 C5 s& U
end
! r! W; l1 E; K! d& k& z5 |end, W8 }4 q' A, \3 {
$ L8 Q' @- i6 R& G! ~begin P_pick3 arriving- k+ ?. H# i3 @
set A_i to 21; }7 Q3 [9 A6 Z4 [% U8 v- y+ y* X v
move into Q_induct3
! W, y* Y* w# _/ E, ]: A move into pickaisle.induct3* z; D7 z* G- {& A8 ~: V
while A_i<=30 do begin
d1 t- m2 t+ A g travel to pickaisle.con(A_i)
* g" }7 k& B4 ~$ u) M. S6 }( V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 |% Q& ^; H# S T+ S
else wait for 10 sec% P! D- t# ?4 Q- F
if A_i=A_leave then send to die, P! o' p" l4 f$ u( z' f% d
else inc A_i by 18 s: ?3 H. p! O* d6 ^! J% I
end, e* G& Q/ k0 F& B/ D
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,其它按你的 ...
|