|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& @5 O# A' ~: R1 z% w& ~7 u6 ^8 a5 E& e! v& k" N$ d) J2 D
我的问题是,在每个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 s: T( e4 C" }' T4 `
; }2 k5 \' T* N. x# Qbegin P_read arriving
: u9 A, D2 U# f" L* O while 1=1 do begin; Z% w N. K, E) z4 Z O0 L9 o
read A_tote from "data.txt" with delimiter "\n"7 s& I# o9 p- y1 a2 u( d
read A_time from "data.txt" with delimiter "\n"
3 A: ?; @! L8 W read A_leave from "data.txt" with delimiter "\n"
) k( p+ F( C& |8 U5 d/ a read A_picks from "data.txt" with delimiter "\n"; G2 |- L/ z8 P' Z; P+ {3 M
set load type to A_tote$ [# i4 ^3 t9 c1 I4 [
if A_tote="tote 1" then set A_induct to 1: ?2 @/ p8 s- v
else if A_tote="tote 2" then set A_induct to 26 ?% v% ?1 e) ^
else set A_induct to 3
- r( f( r' {* ]' w) u1 b3 ]; I: d set A_i to 0
0 c, R9 X( O! u6 A clone 1 load to P_induction
& M: F" J9 E! n, u3 d+ m& U wait for A_time sec7 x K, z: k7 L( o3 d6 o* X
end; D: `/ |: ?$ a% w4 u/ o v% f
end
6 ^- E7 h1 w- _( G5 V) t' C. Y9 l8 d9 W4 ]1 P+ q$ V+ E
begin P_induction arriving. u7 C" r2 v! \7 `$ o. R# Q' F
if A_induct=1 then clone 1 load to P_pick1
+ L7 ^0 |- {6 U8 i; E else if A_induct=2 then clone 1 load to P_pick2; J/ D; [ y8 d
else clone 1 load to P_pick3
" I5 E9 T; S- o$ z# Tend; o" k2 H5 R' j( f
( o/ @! g' Y! O6 f
begin P_pick1 arriving& j o! Q% e' k& Z D' E, {. `
set A_i to 1$ D7 Z1 C5 A' J# y4 H5 [ t
move into Q_induct1' k( V4 w# \* h8 V. V
move into pickaisle.induct11 C/ q( U1 B |& R
while A_i<=30 do begin
r, I, Y6 k$ W& o travel to pickaisle.con(A_i)# a8 e ^' b/ \6 J3 X) o3 g5 e9 G
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 ^; b/ ~! S" }! g else wait for 10 sec6 s8 @% Z: _, a
if A_i=A_leave then send to die- R. [% Z% W' Z6 D- @0 m8 Q
else inc A_i by 1
9 U( I; g1 b2 {7 |; [ end
& X% ^4 S. h8 S5 \end
# b' `4 ]- C3 t) b" R, S9 n
5 |( |5 D1 _ P- N; |1 @* Gbegin P_pick2 arriving
8 \, {9 y5 r' t9 j5 p set A_i to 11) ]" ]' ~3 y0 O; h+ s5 m
move into Q_induct20 {' T; i% c/ g( v+ L
move into pickaisle.induct2& k7 K8 T- l" w3 c
while A_i<=30 do begin' R. H) r+ f A7 z9 _
travel to pickaisle.con(A_i)
- _0 K! f$ H) |0 }1 h( o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" h$ |; W% r& J4 K# e3 |% G3 I) K
else wait for 10 sec* P! x9 w$ d& t5 Q
if A_i=A_leave then send to die
+ j7 W1 g5 y6 b6 ?2 \4 C else inc A_i by 1
; y* I+ o) @4 Y6 ~3 s0 i end3 @' Y3 ` ~5 C# H
end
5 B4 M+ J3 `& w
0 i, S+ X7 ]% j* i9 V _+ ]$ fbegin P_pick3 arriving5 k1 C6 m% o4 P6 R& ?7 t+ J7 F
set A_i to 21
1 c9 U! P+ f/ ~7 B; O* M7 s3 U move into Q_induct3
8 }. m" K# y8 a# J" E! S move into pickaisle.induct3( i- m8 Z2 M; S; W
while A_i<=30 do begin
: @9 S* \/ i/ M% e& f* G& z travel to pickaisle.con(A_i)0 f; {1 g1 n! u* W7 p+ |8 R. O2 v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- i; u% o, \! ?1 {; B# l
else wait for 10 sec
( _2 O1 H; Y0 B8 t if A_i=A_leave then send to die9 [' k9 k: n' B( ]. o
else inc A_i by 1' H2 V7 ^% e4 G0 a4 Y& j p9 E9 f
end. Q; p! G& ~3 A l. k
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,其它按你的 ...
|