|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 ~+ f7 B0 f: S" T2 n8 A5 q# q4 X% `6 i
, S- H y/ w4 m2 g& Z& v我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! G0 Y, P8 e# K
2 y# n- j1 b! c8 @; Ubegin P_read arriving
, q& F$ M, X! Y' R while 1=1 do begin
0 }3 Z( ~: T p4 O# {6 |( D read A_tote from "data.txt" with delimiter "\n"
& |6 @5 W6 E; J0 B- x# j read A_time from "data.txt" with delimiter "\n"
, K0 [: A' j! a# z9 c6 H# G6 s read A_leave from "data.txt" with delimiter "\n"
Z5 w7 I9 `8 \ read A_picks from "data.txt" with delimiter "\n"; }$ e F( g# D7 n' \' P t7 ?
set load type to A_tote( O+ b/ R a }$ s: | Z
if A_tote="tote 1" then set A_induct to 14 D8 P3 C8 u7 |2 M
else if A_tote="tote 2" then set A_induct to 2
/ }6 N$ q6 ?: N: F5 N else set A_induct to 3
" R5 ^5 u. i3 e# ^ set A_i to 0
3 P0 O- U& p6 z5 K: f clone 1 load to P_induction
4 |( B: I* I1 [" k. m wait for A_time sec, u4 ?8 R: E/ H* N3 ~
end6 d& x; l* P! o$ X
end Q! l+ @1 L7 l4 [* C
/ `2 C2 A8 h) k; M4 D+ |! i' x
begin P_induction arriving: T9 n; R8 F+ Q1 p6 l: k% J- n1 h
if A_induct=1 then clone 1 load to P_pick1
2 I5 G' Z- ~% w else if A_induct=2 then clone 1 load to P_pick29 c% r- N$ g( f3 E$ A% ~# r2 H
else clone 1 load to P_pick30 ]* p, a9 X8 F
end7 x1 q- R& M3 a2 }/ k J
+ c [$ a' Y2 r! N9 m
begin P_pick1 arriving
9 |, o, V( Q2 {8 G% V( `, I/ ~1 i set A_i to 13 ~" m% p A* \1 z
move into Q_induct1
5 I) P7 u4 X. F9 [# ` move into pickaisle.induct1$ C& }, m; z8 I; L
while A_i<=30 do begin
5 G! b( N% a1 l7 }+ j ~ travel to pickaisle.con(A_i)
6 e# ?- a1 G! a8 _! W# s! _" G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 X- v- N% P; v1 C- n else wait for 10 sec
7 q0 t2 N c7 J) }" h) _ if A_i=A_leave then send to die. B9 v0 j5 d% r
else inc A_i by 1
I% n, ]* y9 @+ T7 K. c. X% H* @% } end( {6 Q: ~2 Q7 P+ @' T- z; \- t
end
8 \5 U' {" X9 Y* c. Q2 a! J' l0 [% i+ a5 w
begin P_pick2 arriving& e' C+ ^4 F" q1 a
set A_i to 11
! K: S' `# L/ f( ^0 ]; a move into Q_induct2
$ p# ?# p, n# {2 U' O) ?1 V move into pickaisle.induct2' _* S* s5 { P: d
while A_i<=30 do begin/ I' Z# [; d3 o8 f/ t. c
travel to pickaisle.con(A_i)5 F* b0 ~) Z5 _9 y& g3 Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) F! Y; V: R' i" `0 v else wait for 10 sec& a) S; z/ |. w! d$ G
if A_i=A_leave then send to die
. m$ S$ u0 V3 e( k else inc A_i by 1
2 y6 L5 v7 b9 ~7 f end
. C" J8 G! H0 }) }% gend
( |% i3 x* H' J* W. P$ H( [, ^% k' d% @* d+ ]3 [
begin P_pick3 arriving
8 l( h' l& u j5 [: \4 p+ S set A_i to 21! u3 f& E8 q& Y9 H( s) i
move into Q_induct3+ m) A$ ]0 `3 q6 Y" x2 Y4 r% L
move into pickaisle.induct3! L4 i$ X8 w: A$ n4 {7 k
while A_i<=30 do begin
1 f [; {3 x0 y4 r8 N; ^7 u. z travel to pickaisle.con(A_i)' M0 _+ u8 E! @; y, z% a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& F4 ?* C/ s. G# z: M+ E
else wait for 10 sec
. r1 T: }* l+ h$ K! p0 {( m if A_i=A_leave then send to die: {9 T" ]: B3 c8 S L7 k& G
else inc A_i by 1# o! s( @1 F* y5 k4 V
end- I. K/ q; S( y' S
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,其它按你的 ...
|