|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; ~% p. |" L6 A8 ^3 {! m
4 ?5 P4 f8 N3 p i我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" |% z5 A. f2 K2 Y4 |7 s# m0 Y) E, |5 D/ {2 S+ N) i
begin P_read arriving
0 g$ T6 E" z0 D5 `# e8 V l while 1=1 do begin
2 N1 n& I6 q0 Z$ z! o. y read A_tote from "data.txt" with delimiter "\n"4 H# C+ T! `. p0 h) o- r* B& ]
read A_time from "data.txt" with delimiter "\n"! L4 W8 N0 \" D) ^4 y
read A_leave from "data.txt" with delimiter "\n"
& N6 G0 v3 V/ _9 }' q read A_picks from "data.txt" with delimiter "\n"4 s1 x! T# g# `4 ^/ Z/ s
set load type to A_tote
0 s8 k! Q. x; k3 Y if A_tote="tote 1" then set A_induct to 1
8 b8 ?& S) o$ I" j* i5 R9 B else if A_tote="tote 2" then set A_induct to 2
* c, k8 K D. O7 v else set A_induct to 3
, q7 e) B. k4 y7 l, D1 `" X5 X% E2 z0 y set A_i to 0
- S1 X+ o) D; |; F0 w R clone 1 load to P_induction3 C% g% w) b( n, O/ i: N
wait for A_time sec
8 g+ Y# p. | T& e end
# P9 b A. ]4 N0 ?end
% k/ {% t5 F& Z0 m/ B( }1 U, ]6 t1 J1 J9 g) N0 |6 J3 K
begin P_induction arriving
) T, Y3 t4 v4 o$ w* A: ~ if A_induct=1 then clone 1 load to P_pick1
9 O& M R7 d0 A" k X1 J% i else if A_induct=2 then clone 1 load to P_pick2
' D. _ B# Y3 t" Q# m* V else clone 1 load to P_pick3- z* ~7 g: g+ X
end' t) k* d# t: Z8 j3 n, K" Y
$ D$ A- k) n& s! s
begin P_pick1 arriving8 V4 x1 k/ V8 y$ w
set A_i to 1
% z3 c( Q( R4 T" @ move into Q_induct1
3 m# I: t/ M' i# e/ q+ X5 O" |; X move into pickaisle.induct1
% N5 ?) K. D9 V6 N Q% V& x while A_i<=30 do begin
: n# k# r/ @. I9 f& Y travel to pickaisle.con(A_i)( O" t+ Z6 e! @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 u: t6 g& Z' J9 Z( ?, A! e else wait for 10 sec( R8 W2 O' V# r @
if A_i=A_leave then send to die+ B! }7 X1 `0 G Q' j9 n/ V
else inc A_i by 18 q( g6 @& y0 T9 B$ X: H2 i# A
end
* ]8 x0 b/ M/ a$ y) Mend
! b- d1 b# {' A, H! ?8 e! \% D7 G" b, I/ v& P; N& m/ m
begin P_pick2 arriving
, ^1 \- Y* U- }0 y+ ^4 y' H set A_i to 11& w7 S# m ~7 L9 E' p
move into Q_induct2
+ v0 D! Q. i5 g. W$ ]& D M& d move into pickaisle.induct27 v; ?. W6 r: t# S
while A_i<=30 do begin
( D$ [3 p3 s6 o travel to pickaisle.con(A_i)6 f4 O% J1 j9 Y5 b& e8 Z6 f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ [1 P! O `9 ~( c0 g
else wait for 10 sec7 f3 e2 P. |! o7 }1 g0 y
if A_i=A_leave then send to die
1 G$ C( l2 I+ J1 X" V8 j else inc A_i by 1. |: m) C# P, h! H
end
9 X! m: K# ?0 Y7 u/ W/ O$ g( hend# k5 c6 m f" U2 m2 p4 i' q
. m0 p. a5 W# A( c' k. \- O d8 \0 q* t
begin P_pick3 arriving
4 Y S* D |7 J8 h( a, H set A_i to 216 x) O' [4 c0 O) y- h/ M! R
move into Q_induct3
0 u: H% ]* B5 l: {3 Y move into pickaisle.induct3
4 @$ Y- }4 O$ ^, ?3 S while A_i<=30 do begin
3 _) S( O: l u% h3 A1 P4 N5 _ travel to pickaisle.con(A_i)
]' L3 ^+ |1 p; o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! H1 O4 u( n" K! M else wait for 10 sec4 M5 j5 I+ K5 p4 X3 z2 M* W
if A_i=A_leave then send to die; i& e2 M! X3 m6 f8 D) |6 d
else inc A_i by 1
% ^2 @9 D! ]4 ]0 [; j/ R end
/ M0 a1 p2 ^& |: U0 Jend |
最佳答案
查看完整内容
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,其它按你的 ...
|