|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, E, C6 J4 ^. N! t N/ z$ e5 }3 @3 Z2 X7 u, t+ @4 ]) q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' F& F/ X0 a5 f. |' ?( E L5 R
# K& W9 }8 x lbegin P_read arriving
: n9 Q- w5 o+ n$ S& L( I while 1=1 do begin
- R/ W# x, [) x+ ?4 S3 t9 d/ } read A_tote from "data.txt" with delimiter "\n"( f% H ]) E( ^0 n) \) `
read A_time from "data.txt" with delimiter "\n"- Q- I! U. ?& v/ z, X8 b- b$ a
read A_leave from "data.txt" with delimiter "\n". z# N8 |+ C( T# c# g
read A_picks from "data.txt" with delimiter "\n"- N. H6 z) @$ e
set load type to A_tote. X ^3 B- b4 s
if A_tote="tote 1" then set A_induct to 1; C4 ?$ M: T6 {% e" K) x
else if A_tote="tote 2" then set A_induct to 2
8 K. u' J- R# v0 r else set A_induct to 3
3 `4 L% ~0 `5 T8 Z3 D set A_i to 0
+ y7 R+ c3 F9 l- @8 a clone 1 load to P_induction
3 o4 `1 h6 K+ D9 ?1 I2 ` wait for A_time sec
+ k& ?5 h2 C. C- C5 G/ {6 h end
. B' g0 ]+ P9 ]end
& B& x7 f% Z1 G0 Z* y; `3 h, }
: |& S5 T! A. H1 D( ?begin P_induction arriving% t# ?1 K: W7 S
if A_induct=1 then clone 1 load to P_pick1
7 a! K# r1 I) M5 P' _* b* } else if A_induct=2 then clone 1 load to P_pick25 B' \) h& z' T; H/ Z3 w
else clone 1 load to P_pick3
+ T9 h% \, ~2 v8 q% Qend: J: Z8 s/ N1 Z" u
( e0 i! `" M" ^8 o9 ?
begin P_pick1 arriving
& Z; g! N8 }! z- } set A_i to 1
* {. q8 R1 @0 K, R2 v- b move into Q_induct1
1 R( R0 T( @9 j) h move into pickaisle.induct1+ g6 A$ s8 y7 ?8 ^. Q- y
while A_i<=30 do begin
. R& f% K- u; v6 o travel to pickaisle.con(A_i)* r- g0 v p0 l+ f3 X# l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 e9 h+ v) ]$ ]# b
else wait for 10 sec
0 m+ z" @% ]4 E+ ]0 I if A_i=A_leave then send to die
. A) i4 h' f& f, h1 _2 P: L+ Z% F else inc A_i by 11 A. W5 w4 A! W) ~4 O' m
end( M5 a( j2 M% K* t X* b
end/ E7 _8 s0 N1 V% ^# Z/ U" @
* X6 @' W; ]+ g; Y5 I5 x! H# G- C4 e4 ybegin P_pick2 arriving: V" F9 c& u/ g
set A_i to 11, }. N% Q8 r; V/ B
move into Q_induct2/ g4 S! q i) F+ ?
move into pickaisle.induct2/ {- Y8 o! B. s* I$ S$ R# f' E' t
while A_i<=30 do begin+ j+ h) |6 G* a% i8 q, j9 V. F
travel to pickaisle.con(A_i)& ]+ P; s/ g& k3 m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# n9 B$ ?; ?# i- r. x; t) v3 f else wait for 10 sec
7 V5 p; X6 g4 F5 X8 H" i) a if A_i=A_leave then send to die, T7 P' m- a* B6 L, O; V( L0 C
else inc A_i by 1" K+ ~8 r; o3 q, c- X" x% x
end
4 W- O$ y! s& Aend: J. W0 @& }3 n4 A% @9 ~/ q& p
' I* r ~. L8 [3 ^) ]5 [$ W$ T
begin P_pick3 arriving
" `# _ l( l- z C% |1 v& M$ z0 W set A_i to 21( Q9 j2 w& a$ m$ X5 ^
move into Q_induct3
2 p) s% T1 H$ m' Y move into pickaisle.induct37 ~4 G: \% }, ^
while A_i<=30 do begin
+ K7 H; l* |3 A4 ~! O* i travel to pickaisle.con(A_i)1 }2 l {9 U+ U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! S& u/ n$ o8 a- }* a+ k else wait for 10 sec
7 ?% b; C& z, {! C9 K if A_i=A_leave then send to die, d1 A1 s: S( V
else inc A_i by 1
0 `0 K2 c8 r: s end( N! R8 N. Q# ?; B5 i, u. v) G
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,其它按你的 ...
|