|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( [8 V) Q2 ]2 _8 W. y) t( c
% a. B) ?6 y5 ] c1 P H我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 }$ y" @) j( }4 ~4 @
0 T" J* ~7 P+ }begin P_read arriving' m, c, [$ E$ D) R! U
while 1=1 do begin6 G: O2 m& [, q
read A_tote from "data.txt" with delimiter "\n"+ {; b6 N' N$ m+ `% @7 r# k
read A_time from "data.txt" with delimiter "\n"/ X' g% \- v+ P3 M- A2 m" \
read A_leave from "data.txt" with delimiter "\n"
! Q6 {( x7 C* w1 y4 n read A_picks from "data.txt" with delimiter "\n"$ r- }# |! `# M, Y4 }/ Z
set load type to A_tote
1 q- j. L' C' X) \* d if A_tote="tote 1" then set A_induct to 1
# y; m: j k: C; R( h7 z6 E else if A_tote="tote 2" then set A_induct to 21 _" ?3 \; W1 ~' I, z
else set A_induct to 3
9 d4 G. D2 A6 G* K3 G$ v3 A1 H set A_i to 0
- _' ]( D: g/ X" p$ { clone 1 load to P_induction3 ~7 I# F* [, t" N
wait for A_time sec
+ P h: M, W1 p1 P end
|$ h& K* @: b' R/ x2 s& V8 uend+ q: P8 x; [/ T8 j" s% {4 D
/ m5 Z: {! H2 W% c2 h2 |0 R
begin P_induction arriving
- Z" B' X/ ?( l8 @, H' ~" j* p if A_induct=1 then clone 1 load to P_pick15 C7 [0 W7 S5 Y% Y. O# j7 J: }
else if A_induct=2 then clone 1 load to P_pick2
4 ]: C, f2 ]4 U- H1 `% W$ U else clone 1 load to P_pick3) Q- B! n) Y- {% d! x' x6 U; W
end, ^1 s( Y/ h+ E. U9 p
0 G! ~$ s* A4 g; Z
begin P_pick1 arriving2 g7 r! m6 F, I% Y3 h
set A_i to 1
2 H* i/ L; k. ?4 R7 M+ Z( d8 v move into Q_induct17 x) p) i8 R- d
move into pickaisle.induct1
* g) Y; t8 J+ W+ D# c while A_i<=30 do begin
# w4 _9 s' _8 X% `2 ~( l0 f( L travel to pickaisle.con(A_i)
+ x$ ^- _6 Y9 _' }) D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* l- ?, M7 N( {
else wait for 10 sec
3 h& ~ H2 G" k. t2 v; C if A_i=A_leave then send to die
4 k+ g2 H; ]9 H. a else inc A_i by 1* D- g9 C/ H" M8 r
end: ^0 d, G4 n# R9 g4 y7 I" `
end1 P# H; G" N: Y) R( ?2 }% K
3 Q( t* q# E6 I' Ubegin P_pick2 arriving
+ ^3 t! w1 j) r. P% I set A_i to 115 H# e0 g5 ?) H
move into Q_induct2
, ?$ k9 W$ K% f: d8 P4 _1 {- [ move into pickaisle.induct2! y# L( r; D# O# \
while A_i<=30 do begin
+ p4 G2 s \- m) @2 p" d travel to pickaisle.con(A_i)$ V8 G5 Q! E$ i4 h) y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 ?5 I6 @6 q4 G' @
else wait for 10 sec9 L. Y5 X2 F+ I: d
if A_i=A_leave then send to die
+ W {9 J, |! \6 @' H- ^. Q) S/ \ else inc A_i by 1
6 P3 m( J$ q# p" T- F end
3 a e1 B; Y( }) T. }end" j8 V' @- o1 Y, e- A5 t
& c9 @8 b! [) k
begin P_pick3 arriving+ L9 s s9 Y! U
set A_i to 21: D% m" T0 h) N- t, }9 }; P
move into Q_induct36 J! s, W i( h: m) b, X
move into pickaisle.induct33 [7 |1 J9 M0 }, o
while A_i<=30 do begin
7 g, x* J* P; s4 f F7 a travel to pickaisle.con(A_i), l! Q ^; G( {2 q" }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) X3 C- P$ \) X% A8 B3 S
else wait for 10 sec
& M5 J& ]% C) C }5 h% u7 ^# V+ ` if A_i=A_leave then send to die
$ E5 {+ E0 c0 p' ] else inc A_i by 1
5 w" a) B* ]5 |8 L: s& b$ D6 E% ^$ `% B end/ Z& X4 J- S# M% T# C
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,其它按你的 ...
|