|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
}$ ^+ o3 x# i0 [9 {' g; Z' Y
# w2 w3 U v1 T# c; W/ p" l我的问题是,在每个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中的数值,不知道会不会有什么不妥。: ?7 V- E7 Z( X/ s# A
; `7 l5 B6 w7 O* kbegin P_read arriving% p+ e2 R, [+ u8 m$ [% m0 P" g
while 1=1 do begin; b# S) u. T, ]* ?7 |4 m0 s$ X
read A_tote from "data.txt" with delimiter "\n"1 b- ?! f5 U' W3 a0 t' e* }" [/ B }
read A_time from "data.txt" with delimiter "\n"2 N( N: }0 P! \7 O. r
read A_leave from "data.txt" with delimiter "\n"
! H7 y& {8 Q8 `, w9 j! X read A_picks from "data.txt" with delimiter "\n"
1 P% M6 f D/ m3 j" I+ l! h( J4 } set load type to A_tote
0 m# S/ G9 w" d; M5 f5 ~1 w* Q if A_tote="tote 1" then set A_induct to 11 v0 Z% E4 Y4 Z0 x+ R
else if A_tote="tote 2" then set A_induct to 2, _+ h5 L- U* g* ~* |
else set A_induct to 3
8 N+ O c# f0 d' ~ set A_i to 06 V7 c! [ y B% N" a N2 Y4 P6 `
clone 1 load to P_induction7 e: H5 w# L# ?7 m* Z, Q2 j4 `
wait for A_time sec/ O& ^' R. s7 B3 [& t) M0 {
end
- c4 Y+ ]1 |9 a# Y3 Pend
& z' ~4 k) c1 g* l( d. y
4 b- T! w* ^; p7 ]3 Dbegin P_induction arriving
* X2 q; q0 W# [* W- q+ L if A_induct=1 then clone 1 load to P_pick12 u4 G( V( D; F2 P3 F. H& F
else if A_induct=2 then clone 1 load to P_pick2
* L- {( i3 w; X& k else clone 1 load to P_pick3! p: ~) J% P$ E3 p) V3 y
end6 V( V6 h8 h4 \8 Q ]5 p: F
$ ~0 M* d! L$ i, u$ n1 _ l
begin P_pick1 arriving
8 L1 _+ `% V" K! C) ? E+ @7 O: g set A_i to 1
- ^3 M; v3 ^" J0 Q& f move into Q_induct1
( w; I. {' f v$ `/ n move into pickaisle.induct1; d: \4 L0 Q3 J e7 x
while A_i<=30 do begin
7 s; ]$ Q: Z( M2 P+ s travel to pickaisle.con(A_i)
7 M( H6 |( @) _. x, H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) G1 U5 U/ R4 q2 H3 G: I9 I, @ else wait for 10 sec' o5 \, y$ r' p
if A_i=A_leave then send to die6 n# M$ W5 d" R9 j
else inc A_i by 1; I# c( o |6 [9 A* G* p0 a
end* @ ~7 Y0 ] d' E6 X/ Q# P
end
3 ^6 ?4 r H+ d4 l0 m* j9 D1 O5 e9 ?7 p
begin P_pick2 arriving8 q% `. t ^/ M% Z) R
set A_i to 11
) X8 z: i8 ~( I$ d; y! f. h8 s: b move into Q_induct2
/ s+ Q6 _* j/ o6 ] move into pickaisle.induct2
7 Z7 j' A+ _: [" `3 a while A_i<=30 do begin" o1 A- e' l( e7 V' A" F. d/ [' P% }
travel to pickaisle.con(A_i)0 s1 _" [- R; d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 x9 V5 ^% { w. y X9 ]1 y; I else wait for 10 sec
. o: J2 ?5 U% ]* `3 {! ^, i( h. r if A_i=A_leave then send to die% G, T$ L( k8 X6 G9 R
else inc A_i by 1
( y# p' @# ^2 J4 u3 _- m end! N0 d* w! W4 C1 o; L0 w! S
end
; c. R8 _# F" J; V' g6 q+ ?( v4 ?7 |5 M
begin P_pick3 arriving
) u# G! V) r# Z% n set A_i to 214 I. `& C! B/ W4 Y& z
move into Q_induct3* ~: u2 {9 Z/ ]8 T) B |; h& ^$ v
move into pickaisle.induct3
2 ^5 K6 c4 B% P; o) u while A_i<=30 do begin, N+ j8 c/ B% y, y: G! f2 i
travel to pickaisle.con(A_i)
/ D; M E1 `. F7 S0 t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& B9 q: S% O9 A
else wait for 10 sec( }) U8 \- S8 V! Z3 p# {, }! a
if A_i=A_leave then send to die
; [6 q; t& D) T& p6 [ else inc A_i by 1' R6 j7 S, h6 r( e6 Q5 M1 c, c) F
end
e( e T! c- c) eend |
最佳答案
查看完整内容
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,其它按你的 ...
|