|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* z3 M4 c! D; ?
2 Q# S/ H+ O) j我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' r* G1 c- P; t/ q9 D) }& ^, n! S, v3 K4 K
begin P_read arriving
* K5 x! P1 E# c while 1=1 do begin
/ u, d4 q$ G* i0 x read A_tote from "data.txt" with delimiter "\n"
% O% x( }; W2 o5 @( | read A_time from "data.txt" with delimiter "\n"+ a: O) ~. C# X- A
read A_leave from "data.txt" with delimiter "\n"# t, c& e) r, m" @
read A_picks from "data.txt" with delimiter "\n"
! _' b6 ~2 H3 B set load type to A_tote
/ q6 {' N0 q% ~6 I if A_tote="tote 1" then set A_induct to 1
- T# O8 ?# ^2 t* [. h J: S; H else if A_tote="tote 2" then set A_induct to 2
: n2 U( B$ q5 D( I$ A$ {$ C else set A_induct to 3 2 o& e( o- U/ A% z3 X4 B+ c- c
set A_i to 0% l4 \( L/ P: f$ F( k/ A
clone 1 load to P_induction
- J7 j" O# ^: H8 K wait for A_time sec
) ?% \& M7 C: v: n: K end7 f& l- s. g$ j
end9 c4 {% P7 |1 E5 ?+ a
3 p* `9 ^: r# P* u0 G/ |begin P_induction arriving
t5 j8 O9 L+ t if A_induct=1 then clone 1 load to P_pick1
+ a0 D" j: p/ V4 a& j+ L! u8 [# I else if A_induct=2 then clone 1 load to P_pick2+ ^% b1 G$ d% c
else clone 1 load to P_pick3
. t$ I- v# q6 Fend5 q9 H5 l8 j5 Z/ Y; q2 P" k- _
& T5 M/ Q/ x8 U% _5 ^) ~: j. }! U
begin P_pick1 arriving
2 K. c$ m% h3 Q set A_i to 1
: R5 A% }8 v4 P: p5 u, J% U7 n move into Q_induct1
9 n# K/ z0 Z* f, R move into pickaisle.induct1
! L9 Y9 d& |0 s1 x# b+ B2 W) q while A_i<=30 do begin
: l! @. Y0 p. d" h2 x travel to pickaisle.con(A_i)
, I& s6 c6 T+ M, y% f( d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 H$ p( A! X( s0 z1 [
else wait for 10 sec4 Y. x! v. R% f2 L
if A_i=A_leave then send to die
, W5 Q3 W: Q" D* H V else inc A_i by 1
8 r) S3 `- C4 P$ [3 A) `8 O5 z end
, _& ?4 Z8 ]) lend( ]4 Q5 V4 I, t5 s5 O# I
% u% T# `" M9 o' h2 G; Z! sbegin P_pick2 arriving Q. j5 k" w! \0 E) B ]
set A_i to 11
s# U# k* a+ H8 ?- T9 z- V. h move into Q_induct2
: U3 f7 c& k, h7 a. v0 S4 X move into pickaisle.induct2
# |/ a' d- D: L# Q# J! p while A_i<=30 do begin0 U3 D7 U% W0 l/ C5 b& a" K2 W
travel to pickaisle.con(A_i)
/ g; j, ?- ]( t, r8 `4 x( P5 Z/ S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ `6 } ~) g, n. y' w
else wait for 10 sec
2 D& ^" D+ g. b- Z if A_i=A_leave then send to die! n* v! \, _7 `( ~
else inc A_i by 1
- [; q8 @1 A" J end" H- K' O @. _8 D) r; y
end
9 Z+ I. S* e" n; W6 r- C/ u8 [) u' ]. U
begin P_pick3 arriving
, X: C% C- D) F- f- \4 _+ [ set A_i to 21
: Z5 t3 o" z8 Q. ?: R; v& S move into Q_induct3: |" s" s1 L3 W9 }" \' w
move into pickaisle.induct3! G% B$ N( k+ n( O% z" o
while A_i<=30 do begin0 x2 S* Y1 S1 T5 w* Z- i& V; X
travel to pickaisle.con(A_i)
/ t' f+ S4 G/ m% `/ u# b/ Y0 H$ ?% A1 S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" M- b. q. b$ {% i7 @' k else wait for 10 sec
2 v+ G, [9 l% _9 T2 X6 K6 m if A_i=A_leave then send to die
" e& q/ H, S! O. q else inc A_i by 1
3 x( N$ ?3 P$ ]: G. U i$ Y1 K+ U; p end
% k" H2 S' I% A" B! s5 [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,其它按你的 ...
|