|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 ~4 Y9 o3 U$ k% o* V6 ~; W6 a
+ n/ c1 q6 k3 r, u2 ^' C& W我的问题是,在每个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中的数值,不知道会不会有什么不妥。% j" s4 |& M3 y% m
" _( K+ k9 U; ^. T4 i# b- Abegin P_read arriving' V5 }1 I ?0 u6 m% v. n
while 1=1 do begin
# l* Z8 n% G$ O' h' t: h6 u read A_tote from "data.txt" with delimiter "\n"; ~1 k. D" y0 u, w
read A_time from "data.txt" with delimiter "\n"
5 P. Y" n. O! { O5 c4 e P% s read A_leave from "data.txt" with delimiter "\n"" r# P3 N2 g9 H. \. r; j
read A_picks from "data.txt" with delimiter "\n"! T+ r6 ^. S& t# p3 N) c& I
set load type to A_tote
; a1 K% c6 x( w! p I& J; B* m if A_tote="tote 1" then set A_induct to 10 i# b! s" E4 @& U$ f1 M* J
else if A_tote="tote 2" then set A_induct to 2
6 R- u: @, X+ U0 D else set A_induct to 3
7 [2 h8 f$ L% ]7 ?: d set A_i to 0
0 k. J) Z3 O: r1 E9 s, _% K# t clone 1 load to P_induction, f4 f& a) o! B! g$ I# ~
wait for A_time sec8 e; B# Q# G/ Q6 ?! ^
end
' g! a5 X: @8 w- n. y" qend
7 ^- d& t! `! l" f; g7 U# Q' b# k8 Y
begin P_induction arriving# K, w/ p6 g0 I9 q7 h+ a h$ v
if A_induct=1 then clone 1 load to P_pick1
7 f0 o: Q) ^: J- X else if A_induct=2 then clone 1 load to P_pick2
" |; a; |, p# A+ G" Y- w else clone 1 load to P_pick38 _# L8 q5 P2 n9 R
end
( ?' y" z+ z0 w: Q1 j1 u1 {6 f$ X Y* w, _1 Q2 g6 ?: x: R0 s) f
begin P_pick1 arriving
5 H+ V+ g2 U/ n# Z& { set A_i to 1' a" N4 P- Y% Z+ j- P# Q4 q
move into Q_induct14 b2 U# C% D7 o, i) k( S, t
move into pickaisle.induct1
9 M P: D( O- \/ ?# f$ G8 W while A_i<=30 do begin, S3 C/ H, j' t" u/ k/ Q
travel to pickaisle.con(A_i)$ e z7 \- J0 i) m- Q( B: @- Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 a/ e( F' m6 ]9 _/ R else wait for 10 sec7 U1 s- j7 k& N S
if A_i=A_leave then send to die
% f: c. t2 b ~/ B6 p else inc A_i by 1
! T# M9 y4 M4 B end
/ {) ~% T/ e% U/ ]; X+ }end; I( L1 R# |4 d: y" ?. p4 S w
. |. I; C" Y/ R4 S; xbegin P_pick2 arriving
. h& m, f3 q p5 p5 G& H7 h set A_i to 11
9 p6 H* i3 K1 f7 {7 J+ K% \ move into Q_induct2! b6 o# n M; _8 H
move into pickaisle.induct2
0 X# U; e2 h! o) q* W# n9 W; j' _- Z3 r while A_i<=30 do begin
4 O0 X- W V1 o0 l5 h travel to pickaisle.con(A_i)! y0 e" }2 N3 O2 y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 e# Z3 N# l( \, g! a else wait for 10 sec5 \/ X3 l! \* z) h9 }3 Z( A
if A_i=A_leave then send to die
: q' X/ O4 i3 d" e+ C+ Y else inc A_i by 1
: {2 \$ E& L! G3 {; G. M end& u. X! k2 H: x$ Q
end1 l) d u! W" d& |" ?9 j
( T7 k K, X" _begin P_pick3 arriving
2 f% e- U% X+ r, U8 A set A_i to 21% f( c: J9 |; f
move into Q_induct3
2 Y: Q( L) U: [: C1 L$ u# ^ move into pickaisle.induct3! K9 |" _% q, Y' v8 J+ ?
while A_i<=30 do begin
+ b2 G, o }* v- P2 q travel to pickaisle.con(A_i) g- ?" t: C _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, l e8 B! n2 e0 Q8 m H/ h
else wait for 10 sec; I; t$ m- f" m+ U+ @0 v3 E, M
if A_i=A_leave then send to die7 q* y) {9 ~9 a1 U6 m! D
else inc A_i by 1
( b) @0 p7 S% F6 ]( @. o0 S end
" z3 t, M$ ?+ g) e+ pend |
最佳答案
查看完整内容
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,其它按你的 ...
|