|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* U! W4 p) m9 V" m6 w6 R; C
* t. A$ n. X; \3 W5 o T我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ b! p2 Z A/ E2 @( M
# P9 G6 l- s4 j C: P1 I8 Wbegin P_read arriving
# I* h I% N" \8 c M while 1=1 do begin$ p! | }, X, b) n
read A_tote from "data.txt" with delimiter "\n" M: o, e4 P* S9 Q: Z* T# s. U
read A_time from "data.txt" with delimiter "\n"; Z; q- }3 L# u
read A_leave from "data.txt" with delimiter "\n"* A0 k. l5 ~/ ]9 Y: I$ [1 V( |
read A_picks from "data.txt" with delimiter "\n"& r" \( R- R, z D/ p2 j
set load type to A_tote
" t( e& G5 S, `. G# S+ v" ?- Q if A_tote="tote 1" then set A_induct to 1
7 m' k6 c: X$ |8 {7 X( | else if A_tote="tote 2" then set A_induct to 2; A2 J! T- _2 Q' m% N" U; y& y
else set A_induct to 3 $ D3 U/ z" f& H) x! Y2 y
set A_i to 03 m$ s1 c6 H; v2 a( g
clone 1 load to P_induction
, q; {6 _' X3 K0 H$ f3 `* x9 {/ B wait for A_time sec
# e" f$ Y# A0 e; X end/ Z2 q* @2 Q8 C3 @8 W; A8 |
end1 L1 [- F* C9 _0 W/ }/ d1 E2 O
. e9 Q# R/ ]- Q9 H0 M: y N
begin P_induction arriving
3 r, M7 X: V# B6 o) A; X if A_induct=1 then clone 1 load to P_pick1
5 w( ]# D m, B% N, }+ H else if A_induct=2 then clone 1 load to P_pick2' u+ L% d5 O& p, ?% @6 a
else clone 1 load to P_pick3
1 r4 R. W/ c3 q2 `end* e4 h* W) n$ O3 c" P" L6 I; \
; P# f1 @) H1 \( V' {" U9 Hbegin P_pick1 arriving
, D! P& Q& R$ G! c set A_i to 1" v3 r# v, A0 K0 P/ g
move into Q_induct1
4 H' y2 O1 u# Y5 J4 f8 S4 [ move into pickaisle.induct1
d8 S3 t) s. g. O' U while A_i<=30 do begin
1 v0 v, Z$ M1 { travel to pickaisle.con(A_i)
! z+ ]$ s8 S% P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" C" V1 S+ p2 i5 x/ Y
else wait for 10 sec2 a1 e% d; x( w) l
if A_i=A_leave then send to die
( v2 ]4 ~/ n- C9 \1 s9 J else inc A_i by 1
0 O" p. j: ~: j6 O/ y9 p end6 v0 Y9 Y# B/ [. n; L$ ~% e7 N
end
" K% q/ A+ f, b+ K7 r2 d. O I2 n# v& T& Z4 `4 ^% \
begin P_pick2 arriving
G$ i8 g9 h, }6 D; h set A_i to 11
- Q$ ]! t5 v( a: D1 U9 M move into Q_induct2
0 M) H+ B% W1 ?9 k% I; j move into pickaisle.induct2
* `4 M8 E2 \9 N) E while A_i<=30 do begin& C9 E* w! c4 h9 a! a7 ~
travel to pickaisle.con(A_i)
9 G% i2 [: Z. v+ c* E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* b) w2 t( u% B6 v else wait for 10 sec
! s" B8 w; H! P( z) K if A_i=A_leave then send to die# S3 K/ G2 B0 D- q
else inc A_i by 1
$ ~" E9 ^1 l/ c2 v d) D N end; d+ E* X# \2 T& O
end
5 r8 m* _1 G: i6 H9 \( a8 f( I; R; Y/ X
begin P_pick3 arriving, f5 |3 E% j+ Z! j _
set A_i to 21( i/ M1 ]% X) S, j/ d
move into Q_induct37 P4 v+ p2 O& N/ B) X8 I5 G7 S
move into pickaisle.induct31 f7 ?* T/ S! w; f, R; t
while A_i<=30 do begin
5 l, z( e) S8 {1 D: e6 v travel to pickaisle.con(A_i)- A( O3 E6 S5 m. t# | t
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! X, n5 ^3 l5 X) t else wait for 10 sec
+ q/ L7 l% P! ^% U3 \2 M5 ~8 Z# _ if A_i=A_leave then send to die4 W- [! O% }" n m5 q- @& x
else inc A_i by 19 _3 c( l1 d; l7 |( U5 X, i
end
) w% y' M T. S5 |; L- [& |3 F) W4 Y- Kend |
最佳答案
查看完整内容
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,其它按你的 ...
|