|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. g6 s; @( [) w0 X0 Y, x) U8 r
$ u& m# n: }2 E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( ~8 k2 n( i/ R: J; t, `9 u" o7 A; G y8 a, k1 d9 T1 Q
begin P_read arriving
0 {) C/ k7 z k/ ~ while 1=1 do begin+ O9 P1 L8 c3 c, b$ B
read A_tote from "data.txt" with delimiter "\n"
: I7 M! ~, I# e- h& v1 L read A_time from "data.txt" with delimiter "\n"
, S- C& n4 \+ ~* I$ ]2 L! B3 q0 { read A_leave from "data.txt" with delimiter "\n"
Y% w2 J' U9 f3 x& j read A_picks from "data.txt" with delimiter "\n"
r- |) ?7 I5 M set load type to A_tote/ R0 _9 G" s5 P0 m" J
if A_tote="tote 1" then set A_induct to 1+ y) v/ `' ^" F
else if A_tote="tote 2" then set A_induct to 2( b f9 j7 ~7 p( v1 y5 s
else set A_induct to 3
$ B, B; B- j$ G, w3 T$ U set A_i to 0" d9 O O h3 y0 r9 P* r$ ~
clone 1 load to P_induction
5 l- V$ ]3 u6 g6 C. Q8 B+ s wait for A_time sec
- w. _( J. ]# \/ `6 o end
3 d. L0 k( P; ~9 q3 G# {( x" Tend% S- l: C1 Z7 r d8 c, e
) T9 e- e9 ^& G% L/ L/ W7 M
begin P_induction arriving
: l7 A! l; s5 L+ d$ {/ B: ` if A_induct=1 then clone 1 load to P_pick1
+ S/ O* X! k, Q- B# O: s6 n else if A_induct=2 then clone 1 load to P_pick2/ ?* e- v# ?6 M
else clone 1 load to P_pick3+ a( L3 J6 G! W6 ~% f+ p: }
end8 I: u) G) E; `" ^5 i; |
, W9 H X; \& m+ qbegin P_pick1 arriving' O N$ T8 [/ ~! r- i6 N" ^; R
set A_i to 1
5 ^, a6 K' }. h) I( W( ^# i/ s8 Y% ^9 D move into Q_induct1
5 n7 @1 R# W5 G+ s0 R$ B8 J& x move into pickaisle.induct1( B5 o2 M, h3 q% M+ y. w
while A_i<=30 do begin
3 [6 Q; }9 i, x) C: _ travel to pickaisle.con(A_i)5 n+ I+ v& N' G$ x1 `, V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! s F$ g6 K3 T* v8 E9 |
else wait for 10 sec% X& m% ~3 q0 w" t9 Y4 A
if A_i=A_leave then send to die. `0 c- T( n% w6 u" F& f$ P4 W
else inc A_i by 1, r& h! p: Q/ n& `$ ~9 d9 i- \
end
) f1 K# `( |- l& {4 L2 D, Vend' e5 a- K& t5 T+ C6 p
& @7 C( X0 {- a; |
begin P_pick2 arriving* O+ y/ _3 G2 e" I* i
set A_i to 11; ^; o# }3 F6 X- K$ w1 h
move into Q_induct2. T' d( ?$ h3 O0 G( F9 A
move into pickaisle.induct20 M: c5 ?9 B- |& v
while A_i<=30 do begin
$ u4 D( m* u9 s r. P* t' B% S% s travel to pickaisle.con(A_i)8 M5 w2 X9 g/ L' v$ ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ B0 A/ y, B4 R5 N" M* z: D
else wait for 10 sec. T& p8 v9 q2 E. I* |; k. `# \+ H
if A_i=A_leave then send to die
% Y: s2 A2 n! E Z else inc A_i by 17 U/ r1 q: ?8 c3 F( V3 X4 B# k
end* I1 @# w% A0 R% E5 s6 E j
end
( e' K$ s: f2 h+ n( }
& A+ x* r3 {$ Y- g* Abegin P_pick3 arriving$ B1 _& ^: i3 U
set A_i to 21/ K/ N, L' J; \2 z+ O
move into Q_induct3
: b# e. \: A( j0 C, H move into pickaisle.induct3
! s5 U1 L& K. x9 M4 |+ u! B while A_i<=30 do begin
1 ^& N7 ~8 _. ?; u4 U travel to pickaisle.con(A_i) K) Q/ K9 U0 A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. S3 ]! c; W# C% T& i1 H, `) ?) R else wait for 10 sec
) u y: f$ K( w1 q# U. ^5 h; H$ C) h if A_i=A_leave then send to die
+ f6 |8 u1 A( D# {0 D, `0 L else inc A_i by 1
! m& [" p- Q/ B: j X/ s0 ? end6 R; i6 k: h: T' {9 G# A
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,其它按你的 ...
|