|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 j) f3 p* n* g, P/ Q3 x" ?6 ~! C" i% A0 T
我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 \6 c! j( \4 A! V
& c, o7 ~$ Q, w2 o) c: gbegin P_read arriving
: m- N! A2 \$ d3 f& j' P1 | while 1=1 do begin9 l6 k& o$ S5 t4 q: a& w$ `% p
read A_tote from "data.txt" with delimiter "\n"
0 X, \/ h) C% @" A read A_time from "data.txt" with delimiter "\n"
2 E) G" x& ^* ~2 q) t( ~& Q read A_leave from "data.txt" with delimiter "\n"& ?5 H* _$ }( c5 D2 x
read A_picks from "data.txt" with delimiter "\n"
: X3 b) L [( w/ J set load type to A_tote
i }) }4 l: b if A_tote="tote 1" then set A_induct to 1
5 Y/ n7 x& G0 X) T else if A_tote="tote 2" then set A_induct to 2
5 H F2 d& ^: ?. ]8 K- D: I9 j else set A_induct to 3
9 F$ [) H- J) w. M1 b5 { set A_i to 0
7 @" c- k3 B+ Y! M+ {2 F: T8 z clone 1 load to P_induction, g* o9 R1 [* g8 ^+ C+ X7 K
wait for A_time sec
# u; U; }. G& k, N4 N end
9 R8 L( g+ I' Z0 Z! q$ v0 bend
5 r% M+ m& \7 [0 a9 r' y
+ A/ V* `/ d$ [# \ L& n# z, W! Nbegin P_induction arriving! N# i7 |# \* ~+ e: A+ B. |
if A_induct=1 then clone 1 load to P_pick1
6 S- R; t2 M% M: W" v3 R else if A_induct=2 then clone 1 load to P_pick2
" y0 @ H) V6 N1 P else clone 1 load to P_pick3; p. h- E: w, t6 ]# @
end
' z8 R+ m( f8 }8 t1 R' e0 J0 t) x6 @" q& m ?1 t; B$ f L1 J
begin P_pick1 arriving
1 |1 z! C1 o% `, o7 K9 f; V3 l set A_i to 10 O' Z0 O) G( b2 n6 {# t# G l' m
move into Q_induct1* h& h$ Z) k7 h( m! O0 a. }
move into pickaisle.induct1
, n$ ~: r5 l/ _9 c6 ~, e while A_i<=30 do begin& K& D8 T% h3 N* S! L0 D& x+ E3 A5 Z/ x
travel to pickaisle.con(A_i)
& q1 {! b7 x: x8 f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ y' g8 i) `1 v9 B# y* o% W+ K else wait for 10 sec* Q, n7 Q& Z3 a' v5 X7 C
if A_i=A_leave then send to die( U1 b' l c* ~% s$ L
else inc A_i by 1' ?! ]+ [4 [% u; L2 H0 T0 {
end$ H+ w0 v; ] @- A* S# W
end
: L, H" p/ C) w
. f: a& g# x: c/ i5 H; dbegin P_pick2 arriving1 ^2 z& K1 u$ V F2 S
set A_i to 111 {3 ~ G% x6 ?1 W' n7 H
move into Q_induct28 J* K$ I( e# \9 f8 c/ ?6 c
move into pickaisle.induct2
! n$ I$ U3 o2 U2 ?" V e while A_i<=30 do begin0 p5 i% o: P4 ]; }% C
travel to pickaisle.con(A_i)0 v' K4 A% x: b& E% K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% J0 f; N" w: r4 d# n2 ] else wait for 10 sec
9 b) @1 `" C$ \" P U( o7 {$ @ if A_i=A_leave then send to die
' v7 [4 `$ ^- n4 e$ s else inc A_i by 1$ Z' F. \1 L# k! H$ _
end
/ s$ m; T/ p/ l8 h& A' kend( S* U8 W; }6 _. p
& `' ]' O1 Q2 w) K6 P
begin P_pick3 arriving; k# a' Y U' g' I
set A_i to 21
* M) ^2 v% O' k8 D/ } ` move into Q_induct3
- o6 M1 D- S5 X: f% Q0 ?, L3 N$ L move into pickaisle.induct3
4 T' M. P; b: b# P7 Z while A_i<=30 do begin7 h. o9 g, H& h4 K. g7 _
travel to pickaisle.con(A_i)
- p( U* R( J+ m7 I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- c2 T8 t9 s3 H
else wait for 10 sec; q( b' Q/ _' ~- _4 U/ i3 a
if A_i=A_leave then send to die' Z6 A& ?8 Q. K, C
else inc A_i by 1
' ^: F$ s% a' {+ ] end
! E a8 [) j8 Q5 M2 ?- C( N# a7 Mend |
最佳答案
查看完整内容
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,其它按你的 ...
|