|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 U0 H% R) |5 @- Y
4 F ] b, v! R9 a我的问题是,在每个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中的数值,不知道会不会有什么不妥。
: O' x* ?4 u- y4 {/ ^
$ Y9 ]9 W Q0 p" o- z/ zbegin P_read arriving7 B, \, q" d1 ~9 x, L
while 1=1 do begin
9 I" t1 i2 i% R2 W read A_tote from "data.txt" with delimiter "\n"
1 o; O- b; G' q& ?6 V6 s; K read A_time from "data.txt" with delimiter "\n"
5 J* f' m. [9 D' J$ E! K& n# x read A_leave from "data.txt" with delimiter "\n"' Y) w# y- m: j9 ~, B8 p" l! c
read A_picks from "data.txt" with delimiter "\n"/ d+ U, ^' x3 h3 p
set load type to A_tote0 w, s {% @5 ?2 T, b0 c7 c2 n
if A_tote="tote 1" then set A_induct to 12 m8 d8 u5 s2 `$ _
else if A_tote="tote 2" then set A_induct to 2' h9 G2 s4 s, d
else set A_induct to 3
0 B/ U' W4 G. F, H set A_i to 0: d: o2 ^% ~0 c
clone 1 load to P_induction
3 V; q4 T, o; s ^% [ wait for A_time sec
) J& F+ t" U1 a/ F1 h1 j! j8 Q8 | end+ g/ F" I5 m2 o2 R
end
5 @$ D( J, o9 I2 j: P2 \
u, O: g6 ]) O5 C; Mbegin P_induction arriving
% }+ [3 z4 ~1 Z, ` if A_induct=1 then clone 1 load to P_pick1
; Z5 R- w9 Z7 a8 I( h( I/ w else if A_induct=2 then clone 1 load to P_pick27 _( d$ E- Q# J j9 p8 ^2 C1 K
else clone 1 load to P_pick32 L4 d2 X" ]& E9 z2 I, H' _
end$ [: M- u$ Q1 ~# w
. V- O P6 C1 Y, r$ e% }$ Abegin P_pick1 arriving
c* r+ ^. O5 ?' P7 K set A_i to 1
6 Y$ U; c$ I9 v move into Q_induct11 d& V/ e8 e0 t# a# o8 D$ c/ S* Y0 G
move into pickaisle.induct1: J# n% F& v G
while A_i<=30 do begin
; `* K) n8 n8 I, Z8 s travel to pickaisle.con(A_i)' @8 @ Z) e: ^1 v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) c2 @( s% }0 a% R else wait for 10 sec
8 \9 h: {! a; m( a$ |- x6 G if A_i=A_leave then send to die
$ x7 v$ I3 \7 t& G; h O. t' R else inc A_i by 11 l1 N! g* R' B! e$ B
end
( H6 t& q0 ^& m) G& X m. ?end1 V5 ?6 [ X1 d) _& R2 s* K
- v& E; o6 J+ Q- @8 u# o
begin P_pick2 arriving1 N- _9 E. [' x8 m; z& U/ }# e
set A_i to 11" z$ N' j$ r" I# q* [) y. `; K9 `: w
move into Q_induct2" }- U1 {+ E8 w) P$ I) |
move into pickaisle.induct2
# z1 X5 ^ \/ ~% L9 V o9 W+ { while A_i<=30 do begin
# _2 Y' y, j u5 a5 F) u' F travel to pickaisle.con(A_i)
" w, I$ M- X0 c1 a( z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, k7 O6 M) [5 Z0 A- j$ J else wait for 10 sec# a L0 T* z o& B3 g. R7 D$ }
if A_i=A_leave then send to die: F4 Q/ D1 h% X
else inc A_i by 10 P. z' X m' y9 y v
end1 _9 e# D# d! z' g$ s# B% L
end
6 v4 h6 Q3 o; K; Q: g+ z; B
5 ?: K/ \- w( h; M% _begin P_pick3 arriving
1 B; c! c. h' u8 N; W set A_i to 210 y5 w/ Q, N8 j$ t/ Z
move into Q_induct3
5 ^3 Q/ w2 G. M, U move into pickaisle.induct3
0 `# ]" {9 }% `# {) b while A_i<=30 do begin
6 { u5 z) X. |* }" M3 ~ travel to pickaisle.con(A_i)
, x& F r, I7 R( B( d6 j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ k" s. F1 R9 X5 a# k* d1 v
else wait for 10 sec
2 r& ?0 y3 p5 \2 I if A_i=A_leave then send to die# l1 q) [. i6 l$ P
else inc A_i by 1
+ n3 _( m/ x- U end
' g1 o8 P# Y6 C+ \& b- @' M. X2 M2 M" aend |
最佳答案
查看完整内容
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,其它按你的 ...
|