|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! U: s) @( I* P$ A. q& Y" G& A$ h+ d% a+ ?% P
我的问题是,在每个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 I$ V+ U+ l8 ^, o: X/ }# \: m
8 q. f9 m0 H4 L0 m# K7 Bbegin P_read arriving, n; P& h% _: A% ], _. A
while 1=1 do begin
' n3 M; p3 E5 X read A_tote from "data.txt" with delimiter "\n"
- n7 |) |) U/ i0 v( L {/ R; U read A_time from "data.txt" with delimiter "\n"
% I N% `6 D9 A# d, R read A_leave from "data.txt" with delimiter "\n"
( @5 t' p; m, f* i( m& B, B4 [ read A_picks from "data.txt" with delimiter "\n" m# g6 C5 y$ p9 I# v2 O
set load type to A_tote
& r7 F5 H4 [* j; e2 w2 `7 d if A_tote="tote 1" then set A_induct to 17 X: w4 X( b: K
else if A_tote="tote 2" then set A_induct to 2, j% Z% N# V4 M% L0 c
else set A_induct to 3
$ n' ]2 B6 p5 U" Q0 t# s set A_i to 08 m3 N. e5 A: F5 c' ]( v
clone 1 load to P_induction M# W) y' ^% T
wait for A_time sec0 B9 F# s% i/ I& H
end
5 X; h6 X' C. S% k! T& R! uend6 W* g; S( \2 ]& F. A
2 ]$ |2 n) s9 h" K/ m
begin P_induction arriving" l' m2 H! Q6 s
if A_induct=1 then clone 1 load to P_pick1
7 s# d$ l/ j5 ?6 _ else if A_induct=2 then clone 1 load to P_pick2
7 N. V6 M! X2 R: O8 @6 D else clone 1 load to P_pick3
# ?1 B# }' y A" U1 |5 a3 tend* Q. {" n7 ^" a4 G- G6 s
9 a! W& g" D" U! s: L5 [
begin P_pick1 arriving/ X' Y8 y( g, l) [, i
set A_i to 19 e3 N1 N/ k' f, T: H1 d6 K- r2 R
move into Q_induct15 W: {6 N0 L: R) |. i
move into pickaisle.induct1
+ l) d' d( Q6 L while A_i<=30 do begin
, H3 {6 J, f* Z; g, s* [ travel to pickaisle.con(A_i)
% D, S* U+ W3 M$ x+ o; G3 J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 i! M# u! R& F2 z- V4 S) C else wait for 10 sec
; m1 R- E0 o1 ?# M1 b2 V* X$ p if A_i=A_leave then send to die5 Y# G1 L6 R) t/ @* W2 T
else inc A_i by 1
4 v7 Z+ ~5 d3 H% X end
' U6 W' ]- ], @3 X$ qend N, e% f% g/ R% O+ V; J
/ \: s$ x& J6 v5 s2 s. J
begin P_pick2 arriving& Q4 F& ]3 Y' T) p8 w
set A_i to 11
% L4 g: u/ h! y$ |* d" H1 q move into Q_induct2, z4 p+ I! {" u8 Y; k! D
move into pickaisle.induct28 P( e) S0 x' z
while A_i<=30 do begin
5 ?8 ~0 Z0 Z# B0 ], p5 r0 [0 o travel to pickaisle.con(A_i)
; u! S& r- Q9 q) j# t) d2 G* s2 G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% {+ J' k3 D/ c9 i
else wait for 10 sec' U! W2 | G/ a9 k. n& |8 a+ |
if A_i=A_leave then send to die
& n, `0 B4 b8 [6 Y- x0 g0 H else inc A_i by 19 y6 i% F0 E. }5 t: H8 T; h7 I1 _
end& w. E+ E! T# y' E4 E7 ~: f, C
end5 a: m. g4 l3 w+ a t- ^6 [
% z7 J% g; c( t E& C' Y
begin P_pick3 arriving, e4 b9 c' l6 n7 R& `+ Y0 g* x' ~1 F
set A_i to 21, u6 e: c/ y/ t/ ~
move into Q_induct3! ]" r& b/ `4 u# t- W5 `9 O6 V3 p O
move into pickaisle.induct3" \6 G" a( ]4 b0 y
while A_i<=30 do begin
8 _ q& z$ V( A! P: O. z travel to pickaisle.con(A_i)
G# N6 a+ y0 b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 w* N0 f0 F! g( g7 _& j else wait for 10 sec
7 |: ~5 W& A# `$ H. l% @ if A_i=A_leave then send to die2 v* r) t0 Z: R+ J
else inc A_i by 1, m) H! V: I" V: p( B' J
end9 X" m7 _2 m7 M8 U8 l8 F" t0 v% `
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,其它按你的 ...
|