|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( u2 U6 f& n4 a2 F
$ ?/ t' _& W3 [* \5 j+ h* a3 ~我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 A! M P! l/ v R; A7 q$ }$ n$ m9 N" V9 d2 n" I4 y; [% d/ C
begin P_read arriving
" ^8 z9 j. R6 R i! U# n while 1=1 do begin5 k+ O9 @& C! y* [
read A_tote from "data.txt" with delimiter "\n"
' x3 p: h6 z/ h9 d read A_time from "data.txt" with delimiter "\n"
/ _) H4 w, V( E/ L% x8 y5 A0 Q read A_leave from "data.txt" with delimiter "\n"
: {" O5 c5 A2 u read A_picks from "data.txt" with delimiter "\n"8 S5 n( O X' N6 u
set load type to A_tote K2 V- U5 r, n3 A) ]: N) R
if A_tote="tote 1" then set A_induct to 18 g/ w* W" Q8 m1 r( |! r7 P
else if A_tote="tote 2" then set A_induct to 2# ~. u& M5 I; b" a; i- R, o5 l
else set A_induct to 3
: M, R6 F$ }' R set A_i to 0
/ W3 Y' d, q6 F, [0 |/ S$ K clone 1 load to P_induction. ^% D& u+ }+ F" r* F+ G/ P; R4 i
wait for A_time sec
+ \" [* n) Q2 c- v end0 [; o; t! m8 A6 B
end
. l4 m C( B$ k4 J5 J' W/ \0 L! o7 g' {1 b" B
begin P_induction arriving
* h6 u! T, k; Y9 s: x if A_induct=1 then clone 1 load to P_pick1
1 N/ r8 z/ P: @+ _3 [% C* K else if A_induct=2 then clone 1 load to P_pick2
& A/ E H- i" P' | else clone 1 load to P_pick3
# N9 g7 P+ F0 t: Aend
% U% z2 n! y" j" Y: o
% \5 E' a& `! [/ |( t( xbegin P_pick1 arriving1 j5 ^* W& T7 c
set A_i to 1
3 ~3 Q$ R( Q, A8 G7 H9 ~( y5 ~. ` move into Q_induct1( S( G9 g- G& i# y; ]4 m% @
move into pickaisle.induct1
6 V1 }0 {5 @0 ~9 d while A_i<=30 do begin
& m+ T( {$ [9 w travel to pickaisle.con(A_i)
2 D" s/ @+ u+ q: `, ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ J6 H6 |* D" m8 r else wait for 10 sec
- h) e+ x8 z% p& y7 s2 k; J, ?- R R# k4 g if A_i=A_leave then send to die2 N! }' j2 D: i9 ?2 a! f0 c6 I
else inc A_i by 18 o! @' ?9 W5 ^+ T" a2 a
end: w( O, A# Y' T, T% }7 I: X1 N1 x
end
' Q9 |! i# ?1 }9 U3 X. ?/ k0 R g3 |9 z0 _) U8 r
begin P_pick2 arriving4 R2 d- f8 Z* y& l
set A_i to 11* ~ n! [4 {6 l/ d1 f3 Y
move into Q_induct2+ w: v. J( V1 r2 L
move into pickaisle.induct2
3 i0 c- y& k# a while A_i<=30 do begin' R$ L. \+ \+ \9 c ~* N0 k
travel to pickaisle.con(A_i)$ h$ Q) _# F" z/ R5 m. Y( g
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 K7 ^ l9 Q7 ~7 @6 k
else wait for 10 sec
2 m ]# |# C% E% T: E1 u# f if A_i=A_leave then send to die. r: m3 \ s- R) ~
else inc A_i by 14 L: U, ]1 b/ i$ S; H- P
end
, t, |3 K% o6 l# y: }1 h2 W0 Rend' }7 ^6 Z: E( P3 {
" A, m) x4 f& j3 L; l) |begin P_pick3 arriving
% S5 r+ b2 V& J5 F( @) n2 F$ ]7 x set A_i to 21
3 w: u$ {1 V$ X3 o V move into Q_induct3
Z% m8 ?9 z* O, o' \ move into pickaisle.induct39 o" n5 t4 N8 ?9 {( ~6 O
while A_i<=30 do begin2 Z/ x5 h; _ x- N& z) L
travel to pickaisle.con(A_i)2 E. s( s0 ^3 A+ u) c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) w5 _! }! l1 ]5 y3 \* Q8 G
else wait for 10 sec) f; n* J3 A5 U0 D7 x$ K, f+ K
if A_i=A_leave then send to die. g9 b( X9 @' T
else inc A_i by 1
8 p, @+ y1 i2 ^ |$ Q8 ^- S9 M+ L! t end( J" T( w5 |; x* k$ r6 f
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,其它按你的 ...
|