|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ D2 A- X" W! f
# ?: u6 n/ Z% M0 Z* N3 E. ?( \我的问题是,在每个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 ~, b _* { ]1 H9 B2 t1 N4 s7 Y5 E, E
begin P_read arriving
* p3 m) V. [* h3 D! l0 l$ D3 O while 1=1 do begin
( d% t: { M. s# y! e. s, `' Y; W read A_tote from "data.txt" with delimiter "\n"
7 x% k8 z) O1 _" J, F' E4 E read A_time from "data.txt" with delimiter "\n"( |6 h, t! Y* l0 }
read A_leave from "data.txt" with delimiter "\n"* [& X/ m# h) I: r& ~
read A_picks from "data.txt" with delimiter "\n"
2 N S* a" ^2 j" O% `1 `$ N set load type to A_tote
2 t+ b' d2 M1 r6 ]/ ] if A_tote="tote 1" then set A_induct to 1
# Q: t/ [0 B" @ else if A_tote="tote 2" then set A_induct to 2
! }& f/ R7 h: B. O else set A_induct to 3
% O" B2 g% a/ C3 U0 L% T! ? set A_i to 0
% ]. M' P1 g1 S3 k% N# R clone 1 load to P_induction
7 K* p! G; a1 F3 U1 _9 A7 x% A. I wait for A_time sec! I' S" \" @ U4 l$ E
end6 A) _+ I5 A! f& e6 X1 J
end" D; g( I8 F. b) F
+ t: @5 ?7 F I* X' _# d
begin P_induction arriving
/ P* ]( P0 Z" T0 d, H" K if A_induct=1 then clone 1 load to P_pick1 O( ]* Q0 E U- h) I: |$ H8 O
else if A_induct=2 then clone 1 load to P_pick21 d% E1 D; R- Z1 x2 q9 \; U
else clone 1 load to P_pick3
4 A% z) B& W0 y% k6 v/ }: V( Fend
3 u. Z# r& G- B9 I; O4 H( A# h' T# K
begin P_pick1 arriving
9 W$ X! \9 q4 T. k# ? set A_i to 15 R4 ]* O* Y+ V j6 n% i% }
move into Q_induct1
; H; V( T% X6 n P% U( u- A5 ]3 @1 l move into pickaisle.induct15 u. L5 @3 j+ B6 V- a' U. j
while A_i<=30 do begin
- L, y0 B/ B$ X0 g" d" U3 t. N travel to pickaisle.con(A_i)
: p/ Q0 w# ~1 n& T1 ^. J* f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( @ v, {: h4 M; a
else wait for 10 sec) |6 f3 q! ]* ^! c% a% `, k1 O
if A_i=A_leave then send to die( L$ H+ ]$ N( `( x/ i y
else inc A_i by 10 O }" `2 O; [5 k7 ^% l6 _. [% U
end- u, A4 Z9 {0 J! |+ T7 D# c& A
end+ Q, G4 J5 i$ k- i
4 c$ j1 _) s( v2 ]8 h& P; ~begin P_pick2 arriving
0 V& s( } ^ n, C8 e set A_i to 11
8 E1 O3 \3 c. {4 N1 ]1 ^ move into Q_induct28 R9 e/ M2 c# j3 ], `" P, h7 M
move into pickaisle.induct2
$ ^( \. W0 V* l; |" x6 x while A_i<=30 do begin
' X6 P: u( K1 K travel to pickaisle.con(A_i)
! ~ e! R3 x) A- `- b; I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, P k n+ I8 {7 F. T; H else wait for 10 sec
4 t8 t6 ~( C- a; Z9 X/ u) @ if A_i=A_leave then send to die
+ \# S d3 [7 a9 \# I5 b else inc A_i by 1
0 V$ F( O+ |- d5 v) I% D end: {/ y% w. l/ Z
end% i/ s: R7 I4 A( A0 _( p1 g
- A B$ q2 f' e( ?2 r' e/ [* i
begin P_pick3 arriving
3 @ t I" R5 y: l1 q4 F* e" I set A_i to 21
6 W; m- p1 Z5 f, K1 Q move into Q_induct3
- q. ]3 c1 p J5 `& }+ V8 p move into pickaisle.induct3
4 n* k: ]) p) P- o! t while A_i<=30 do begin! ~; e! n& w9 F" o+ z( }7 b* T
travel to pickaisle.con(A_i)/ h- X d& v, E+ w& |; M# r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! V; ?) n s; r else wait for 10 sec0 O9 f6 O9 n; O7 @
if A_i=A_leave then send to die
+ g) ?" D+ _) {6 v3 S! h" k else inc A_i by 1) n! a# K) C4 W0 B
end0 v7 y) {4 B; t p$ R1 j
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,其它按你的 ...
|