|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
l# a8 t0 u# Y# S% s0 v0 G; E% A# h; y" U
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 q. W8 i- j; R9 s+ |
/ ^8 R% c# A$ i+ R5 }' J U! }! Ibegin P_read arriving1 J% R5 n: w. y
while 1=1 do begin1 H( Y- w6 C) k8 `8 _
read A_tote from "data.txt" with delimiter "\n"$ ~+ \, K' B0 h- x7 E
read A_time from "data.txt" with delimiter "\n"/ b8 L' @ K* r( R/ X. i! C
read A_leave from "data.txt" with delimiter "\n"
9 v! J& i( \3 l5 p3 q3 v read A_picks from "data.txt" with delimiter "\n"1 F2 M% N- q% Y' N0 P2 w1 _
set load type to A_tote* ?# I- [, \) |
if A_tote="tote 1" then set A_induct to 1
~4 R/ O7 a: L6 M; {3 a else if A_tote="tote 2" then set A_induct to 2! v& J1 h: ?, x/ r6 A
else set A_induct to 3 . u6 b6 i$ W7 O) M6 c
set A_i to 0
; v/ l: q9 r# k5 T* {) I. ~ clone 1 load to P_induction
( s+ |% G) {. r$ o& a5 W6 b wait for A_time sec: O2 A8 Y3 d, ?7 [$ u. d8 u" O
end
7 e- y& }$ a; N! B4 _+ }end1 x. ]# {8 E( e& j4 Z& T
! [+ g1 S8 X2 @2 }begin P_induction arriving0 ]) d0 u8 q; B G; m. t% H, v
if A_induct=1 then clone 1 load to P_pick1
, I) Z) y& G' y9 o! B else if A_induct=2 then clone 1 load to P_pick2: b% m+ [* P$ d# k u* {
else clone 1 load to P_pick3, H# {! l/ j4 b
end
7 `+ i4 o9 i& [( \4 U8 C: Y' X' C% q" {$ h
begin P_pick1 arriving
2 \8 T" ?, a$ d2 x set A_i to 1
: g! J) q0 {# o, L( N2 }% f& ]' [ move into Q_induct1
. @/ b, Q) T9 U6 r) ? move into pickaisle.induct12 P( h$ Q; y% P/ b+ P" c7 g
while A_i<=30 do begin) E8 k' t7 P, I7 d n3 c( y
travel to pickaisle.con(A_i), i+ ^6 z7 f* ^4 f/ E5 Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ D1 k$ k' v" M( N; p' R
else wait for 10 sec( _7 s: S- g, ?: t0 O8 y2 D
if A_i=A_leave then send to die$ x$ o/ ]" K6 `+ y! I2 I) v
else inc A_i by 1 i% G) [4 x, ?5 g; }
end
' [ a( e, a: Y0 X. P* x; s0 ^end U/ `9 p) j9 h2 b
: @, }* `6 W' x/ J
begin P_pick2 arriving
: u0 H5 x& m+ k- }+ c set A_i to 116 c: M5 o: W" ^. u- W
move into Q_induct2
2 W1 Q# p7 z, [& ^, H move into pickaisle.induct2
( y' ?2 x* F, F5 f while A_i<=30 do begin
" ^; { o2 U7 t" N travel to pickaisle.con(A_i)
+ B! W* d& q* V1 {( q1 G& a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' O: W- G7 p* }) d2 ^ o& w
else wait for 10 sec
6 B1 U. E5 M% @: Z2 A if A_i=A_leave then send to die' S* Y+ N+ [, W' d
else inc A_i by 17 j) j* l6 w1 U5 S: p
end$ W! @! `- O( N, i0 P6 V! Y/ U. e
end6 M( m1 c8 v0 B, r/ [% T/ r3 a
$ j5 w! l; [! P' m, {
begin P_pick3 arriving$ m- ]4 L6 F- ?: M
set A_i to 215 C+ G# A% A; A4 F7 h
move into Q_induct3
; j$ U# E: I/ j, _: r7 L0 y move into pickaisle.induct3
7 i3 m- C* N( V; K1 | while A_i<=30 do begin
0 b6 G. @# s; a1 x& _% Q7 S travel to pickaisle.con(A_i)6 J' i, @/ A9 |1 K" A7 w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! ]) b( E% \: U% [7 r else wait for 10 sec
. y; ]0 L/ }4 n( [$ `0 G if A_i=A_leave then send to die1 S$ @3 z, G2 `% _: R; `0 ]4 u5 n. K u
else inc A_i by 12 {+ \) C) `. X# h U; |! w
end F$ J& t+ \' S9 N4 ~8 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,其它按你的 ...
|