|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 X( x6 o3 F( }: K$ t
, c7 W+ ^+ P1 [ r我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ c. a; [, ~' z2 Z
2 ]6 i+ e& Y* j2 g" ^
begin P_read arriving
6 q) I! B0 j" O5 H. D6 O4 | while 1=1 do begin' n, U& W- k$ V8 d- Q, ]
read A_tote from "data.txt" with delimiter "\n"
, N9 ?0 i: G" d6 R. R read A_time from "data.txt" with delimiter "\n"5 i) @1 M O0 L1 a; @
read A_leave from "data.txt" with delimiter "\n"6 N: T! W3 ?1 L2 t3 q- |
read A_picks from "data.txt" with delimiter "\n"
: m7 T8 W$ d9 g- \: h/ K0 } set load type to A_tote
+ ?; i+ J( f$ e( O if A_tote="tote 1" then set A_induct to 1) |' ]* D& Q0 b& h
else if A_tote="tote 2" then set A_induct to 2
' @' D) v5 K- F1 s5 K# ]; B else set A_induct to 3
+ ?) C( }& o, D$ s' T4 i set A_i to 08 L* ]9 N' Q( C7 n8 W
clone 1 load to P_induction( g. C' d( q" D/ ~% @. j
wait for A_time sec. \+ z6 m' W Y8 ?
end. t+ S. W2 q# r6 ?; Y
end
3 L& s/ g% @" M& k( J5 H& i( D- m% o' T% C- R) Q# c
begin P_induction arriving: h/ H# F1 q4 c! s8 s
if A_induct=1 then clone 1 load to P_pick1$ A( E& \7 v3 x
else if A_induct=2 then clone 1 load to P_pick2 C8 ^; n4 q7 V3 Q- ]7 ]
else clone 1 load to P_pick3
3 t K1 q) {5 I+ Z% d* \end
; I0 p$ F( B. i: H. ^" h6 d4 M$ b9 T
begin P_pick1 arriving) [$ M. O2 Y& M ^4 c
set A_i to 1
2 \% D4 x& V) X2 F move into Q_induct1) D8 \7 r) h/ K
move into pickaisle.induct1- C* {" H9 q3 |6 r g: ?1 \
while A_i<=30 do begin) H# t1 K8 W: ^, S
travel to pickaisle.con(A_i)
" D, Y6 s$ _( L6 l, h3 } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec f N; h! }3 Z7 z! d8 W% ?- w
else wait for 10 sec
4 Y1 }* G7 Q/ |2 g if A_i=A_leave then send to die, |0 }/ K' x& `$ X/ A/ r4 p' T
else inc A_i by 1- |0 D2 O4 F) M* J) o7 f- O- _
end5 U- T' c: [7 n6 ^
end
" \1 m6 G# t& X( D, X& \: h; B4 \! o' i7 v: c& Y/ [( a
begin P_pick2 arriving
- ]% [* @ ?! [ set A_i to 11( b4 S. q" d) J! o' l
move into Q_induct2# B3 {# G1 d% ?: S
move into pickaisle.induct2
- X. J- ], N! v' y while A_i<=30 do begin
1 ?0 d+ J; Q% b4 q1 s c- C0 b travel to pickaisle.con(A_i)7 @( p0 J* T2 G- M' b3 I& {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# M) W* ?6 }8 Y# H" K else wait for 10 sec1 O4 f5 ^, E0 n2 ]* g
if A_i=A_leave then send to die8 D( u) G7 _6 A/ a8 ]. C4 E$ b- X
else inc A_i by 1
3 \1 l; |. ~" s1 C8 W; v end5 p7 }; g7 f% \; j
end7 H# {: U+ U* T
' X8 v$ v4 s- t/ h7 I
begin P_pick3 arriving
' E- h, ?% Z" B* e8 P set A_i to 21 @$ i/ D9 f" l p
move into Q_induct3
6 |! ?% m2 I! _7 o1 F move into pickaisle.induct3! T. L* K. {2 x( ?4 }
while A_i<=30 do begin
% y: W% ?( c% s( H' L# w$ s travel to pickaisle.con(A_i)
' W; v( @( o! V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ R* _* ~. z0 A" _ else wait for 10 sec
. D E7 l: Y0 O, B; |! U if A_i=A_leave then send to die
2 V% G7 @8 U; Y$ G& m: \/ \ else inc A_i by 1
6 o7 X$ E# l- q7 M0 o end
, j8 p# k8 C2 ~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,其它按你的 ...
|