|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 a2 ]9 a Q. K: u- {' u
! q9 S! D" i. Y1 a- c我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 T: ?* V3 a" L" Z0 G/ m+ @* z9 A
A; H( [ s/ l# p7 S6 f6 Rbegin P_read arriving
( T" G, N6 E: I: {/ ^ while 1=1 do begin; {6 F H6 W G9 O/ G4 K% n
read A_tote from "data.txt" with delimiter "\n"
7 o# S' Q& T3 T0 W6 S/ X6 p read A_time from "data.txt" with delimiter "\n"
: ^" e7 P; l5 Y1 I# q read A_leave from "data.txt" with delimiter "\n"0 O3 a" ]0 w. b( Y; V
read A_picks from "data.txt" with delimiter "\n") t2 ^4 y& V4 F1 E' A8 H! e
set load type to A_tote' p$ x: S X" h! q% A4 z
if A_tote="tote 1" then set A_induct to 19 S$ A' m6 |: v8 R$ G6 m
else if A_tote="tote 2" then set A_induct to 2& E: V9 z2 I L, m! ~: k( X
else set A_induct to 3
% C; k y6 ?1 w set A_i to 0
- O+ l4 c) G$ b" i8 z& w# V clone 1 load to P_induction( v9 c$ Z" o6 t# V4 k5 a
wait for A_time sec( P9 s# O( N/ ?2 B0 ]" u: ^
end! J' a8 U5 b) g! k0 o+ M
end; q, L0 B3 }0 Z' v
! n# L }) B& R& I7 m- {1 p+ ~3 [
begin P_induction arriving
_. x& F; q5 t& x' h& a o0 t if A_induct=1 then clone 1 load to P_pick1- j$ l6 |, l; E9 `
else if A_induct=2 then clone 1 load to P_pick2$ O) [+ A ]( k1 @, P" C
else clone 1 load to P_pick3& I7 S+ z6 ]8 k( f
end9 {# y. _ F s# j( n
. W, j* K/ @5 V" S) T$ a3 Abegin P_pick1 arriving: i# ^8 n0 I$ a( ^
set A_i to 1# }( s z6 \& j) ^
move into Q_induct1
8 Z; T7 S% d9 ]7 o move into pickaisle.induct1
6 q }4 o0 A7 Q2 Q- { while A_i<=30 do begin- \& [4 {; l/ p! j! g
travel to pickaisle.con(A_i)
1 _+ r# t6 p$ u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ b3 q5 Z% |/ Q, v2 y( s5 u7 f
else wait for 10 sec9 I/ m4 ]7 H8 F$ M! j6 W
if A_i=A_leave then send to die
+ z$ v0 \4 q) V, X else inc A_i by 1
0 ^& g& W, k' b' k end q5 h m8 x B! i: [; n @4 O
end
$ {) H8 v2 L8 L# H2 c f
; f/ @/ P: n+ A" c: zbegin P_pick2 arriving: p0 c$ |0 m, }
set A_i to 11
" m! B5 P5 Y" r move into Q_induct2
1 |, g. h9 z* K M; K6 ^6 L5 ^0 F0 ? move into pickaisle.induct2
2 Y2 Q3 k* T4 _+ Q7 @4 p) L0 l; Q while A_i<=30 do begin/ ?$ ]7 v8 J) [- C
travel to pickaisle.con(A_i)9 @, r) Z+ J6 S( [, C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 q( p% _8 O5 a! q3 K else wait for 10 sec
. f2 P1 V9 c0 w% a" i if A_i=A_leave then send to die
8 z* X' u( u0 s% z6 K8 ~" [3 i1 [ else inc A_i by 1& [& ^& D) H" i8 s( J' \& Q
end$ K$ w, L& R% k' K* H4 e% _- |
end# w" g3 S3 n( S$ [* f
1 U4 P2 g" M) q9 O0 r6 j3 }% s
begin P_pick3 arriving
; ~7 ~7 y3 G. y: T% s8 X set A_i to 21
) N% l4 K. S9 J5 Z6 D2 z" z move into Q_induct3, P8 F( w0 t7 S6 ^! m# L# \
move into pickaisle.induct3
x8 D6 G6 x* V! G8 V* S while A_i<=30 do begin0 T, E" E$ H4 A& J5 t2 ?- Z j, }
travel to pickaisle.con(A_i)
& H2 \( f. \4 v) z; P2 d" H) [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 K4 c0 E3 f1 v: e' g5 n else wait for 10 sec6 C+ a* g" e. K( k, A' g
if A_i=A_leave then send to die
- e* x) j! K( f# t else inc A_i by 1! l; g' @# X2 A) d: E2 }
end
% p3 M) Z* Q) y; L. B4 Bend |
最佳答案
查看完整内容
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,其它按你的 ...
|