|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* X: k6 i; W6 b% @8 G5 w2 x8 w, _& x b+ h
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' u2 ]! N' {, o, n& j# l
. m$ a: Z3 {8 } ~/ g9 F$ _7 n
begin P_read arriving7 P/ p$ v* \* m6 m* h3 r
while 1=1 do begin3 \$ y3 ~% I9 e% E1 O4 [1 N/ Q1 I
read A_tote from "data.txt" with delimiter "\n") S& x$ w \3 J7 U- [" Z, n
read A_time from "data.txt" with delimiter "\n"/ J; s6 s* I: S, [1 k
read A_leave from "data.txt" with delimiter "\n"3 s( J* ?! {# q s- M
read A_picks from "data.txt" with delimiter "\n". z0 g# U2 ~9 [0 O$ y
set load type to A_tote
" x0 ?* s6 Y/ L8 O) y. I$ @6 | if A_tote="tote 1" then set A_induct to 11 D0 r+ [' h1 \8 ^+ U
else if A_tote="tote 2" then set A_induct to 2
/ T/ B* F4 I4 ^4 x' s0 y) R else set A_induct to 3 0 p7 b E1 T( F# [
set A_i to 01 T9 Q! `- N2 x S
clone 1 load to P_induction
/ m/ A7 O/ D: _1 |9 Z* c wait for A_time sec
/ c& r& _( e6 m6 K. `- T end
1 A8 J3 {; x# q$ r; Mend9 R: \: l3 t# S, ?1 z7 k
, E$ f' L: B4 F. s7 x( s
begin P_induction arriving
' Y+ X; Z9 [ P) N7 u( u) I if A_induct=1 then clone 1 load to P_pick1! f+ d$ r. Y; l& f3 e7 l
else if A_induct=2 then clone 1 load to P_pick2
' }* g. x2 a( q1 O else clone 1 load to P_pick3+ I( j/ Z. f |6 b
end
, h( F1 D- ~. \# A, k8 q$ s8 G1 z3 w) _; T5 `. A5 C: u
begin P_pick1 arriving
6 o k0 Z/ P% d1 V) k- ` set A_i to 1
+ q# ~/ w$ u3 N4 p7 F move into Q_induct1
9 i4 h9 W9 j5 v" O j move into pickaisle.induct1 o! S5 F! Z) z$ A
while A_i<=30 do begin
# `' ^9 [/ i n: M3 F) h; ^ travel to pickaisle.con(A_i)
1 q2 H6 s' N K( b1 n. w$ d9 ~# I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 T. p3 @6 U/ _1 y' C else wait for 10 sec3 x9 e0 @% W+ f c/ n' h
if A_i=A_leave then send to die
6 z* R5 J P" B# \- c& A. Q else inc A_i by 1" g. }0 D6 h6 U( k4 M8 s3 F
end
/ j( C+ c9 u8 J( ^6 W/ i) \end( U; H$ Z3 }' t
& j. x3 o( u# g4 o. h" ~& xbegin P_pick2 arriving
* o2 p: a: W# n9 x( u set A_i to 111 A2 G- K7 M7 t$ [
move into Q_induct2: m- L/ R; j7 w' |# R
move into pickaisle.induct2
( S- S/ P6 C6 a! W* e4 D) q% I while A_i<=30 do begin' O6 [' Q- \" M& I9 G7 d# A0 z
travel to pickaisle.con(A_i). @4 K6 A' Y% ]5 R4 x' }0 ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# c+ @7 K, \1 X% p) R; F
else wait for 10 sec
* w3 ?" j- i& D, l9 n! I8 `3 g if A_i=A_leave then send to die
/ R& B" \+ P+ z4 e else inc A_i by 12 [! L5 d: R* x) y2 K. U2 Z9 m2 r
end
( O9 t7 h1 r+ m) S2 B' M+ P2 y+ Q, qend; v3 h) o( { q7 K( Q
2 i. m1 f& a4 M& n' A3 j
begin P_pick3 arriving$ W& M3 U- c: ~
set A_i to 21
# x( Q1 D. D; }, |7 x: O9 H move into Q_induct3( Q& ?2 [, O* N8 m/ n0 J2 ?9 x
move into pickaisle.induct3
8 j- U: p. R# [' K+ m J while A_i<=30 do begin
4 i+ n; J8 J& v& @* D) l' n travel to pickaisle.con(A_i)
# E) G: Y# P( s+ D3 b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 K2 { B+ B$ `* ~+ F$ K0 e else wait for 10 sec
) Z. J2 ^! e2 j- K* u- Y if A_i=A_leave then send to die' O @# o$ N1 [& R
else inc A_i by 1
" t4 C2 W3 P7 }+ m2 T/ U' t' l. E( } y end6 n6 n. [# P1 J. n/ k8 x* h0 K3 t
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,其它按你的 ...
|