|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" z! F/ y& s2 t! v0 W( ~" a% L9 O
" S( p( D$ J5 C. G% x我的问题是,在每个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 Y4 M t8 ], r9 ^) {$ W2 t1 r3 z8 c- B
begin P_read arriving3 h3 e' G! J9 c
while 1=1 do begin
$ |* m( U6 c8 W: y1 g" F read A_tote from "data.txt" with delimiter "\n"0 W7 X# J( c9 J& ?3 }
read A_time from "data.txt" with delimiter "\n"
& w8 l) m: [& n: }6 q& ^8 x0 Q read A_leave from "data.txt" with delimiter "\n"" I \( U' I3 Y# ~" g$ J
read A_picks from "data.txt" with delimiter "\n"( o! z Z$ Q9 |$ W' O
set load type to A_tote: z7 b2 `7 X, B# Y. U
if A_tote="tote 1" then set A_induct to 15 N Y, X9 O: }/ e8 M! X) `
else if A_tote="tote 2" then set A_induct to 2; O: a+ L8 M7 v# M- W2 D+ d# M
else set A_induct to 3
7 B# e j6 V3 m+ @/ x$ k% d, ? set A_i to 00 |5 M1 D8 {. j) ~/ v$ b
clone 1 load to P_induction# F3 S6 \+ \+ z6 ]: P1 _9 O6 D+ X
wait for A_time sec' p g3 o* s9 O" S7 B1 L* r7 _4 _1 T
end/ f# X: I5 I1 v' w3 ?/ w+ C
end. ~9 z( R6 c3 n7 B5 n. i
, e9 X# Z2 g! C, Q
begin P_induction arriving
) t$ e) Q H4 D% z( n if A_induct=1 then clone 1 load to P_pick1
) v& g+ O- f7 _ else if A_induct=2 then clone 1 load to P_pick25 y: S6 M# N* H7 E7 i1 L5 s
else clone 1 load to P_pick39 r: G9 V d; M" [
end8 A. N4 B; [( |5 q" {& [! A
1 w- h) F# K* d/ J nbegin P_pick1 arriving& {$ t: A0 Y* s0 E, U
set A_i to 1
b# H# z7 _: I: R move into Q_induct11 ~: O ]# U2 e1 Z4 G, t
move into pickaisle.induct1" B; ^3 ^2 d+ G) @8 G
while A_i<=30 do begin
8 T! g$ _. b6 Q; X% b travel to pickaisle.con(A_i)3 W" e6 |7 n& Y; C6 t* G A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- s9 @" v& A g9 s1 @5 \+ k+ ` else wait for 10 sec! c( q1 ]" B" i4 P
if A_i=A_leave then send to die" ~5 B8 f( ?* l) Q
else inc A_i by 1
, r. N8 { _- g$ P- R end e9 N _' v) P V# h
end, q, g+ @; t& W2 U- m) G
0 k: j; S v7 y' L% N8 p
begin P_pick2 arriving
- S2 o5 X6 i' L& K7 o set A_i to 115 }( A7 f8 _6 y& ]* N% f
move into Q_induct2: \' y! H7 f2 u& O5 G. O
move into pickaisle.induct2
' V& X9 A- m" _7 S4 q4 L while A_i<=30 do begin
! l( L5 f e9 |) }2 \% ~' } travel to pickaisle.con(A_i)
" H) U6 w$ P' \9 n4 a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! x$ { @' J r$ Y* c else wait for 10 sec6 {6 v! ~/ N7 x$ c& K
if A_i=A_leave then send to die+ W, M- t% i$ O% ^ a* S. n, E
else inc A_i by 14 _0 B. ~# p! q5 p) H1 d
end! N, x# f& c* O8 a6 L
end
0 u* O: U3 @3 f( `, b+ B) R g4 l: U
begin P_pick3 arriving) {5 Z1 R0 _# u8 R* z
set A_i to 21
% J5 {$ R& d7 L7 E) k: W Y% ^5 R" w move into Q_induct3/ g5 v9 {% k7 M- |" L2 E+ d
move into pickaisle.induct3
j; Z2 p! U3 i6 ]& u; O9 y* s& @3 i( ]& O while A_i<=30 do begin
) N9 O: ]' x; |* X4 } travel to pickaisle.con(A_i)# \8 s+ a" |/ Q) ?5 S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 B$ K! j0 F! f% p$ q6 ~" y
else wait for 10 sec5 d1 N) j6 j4 U3 e$ z
if A_i=A_leave then send to die$ q+ E* r$ D& g4 B# d3 q' [& i
else inc A_i by 1
& L# p# ^1 o. @0 `) Q6 X2 r end) {6 \; g# Q( w# {9 l
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,其它按你的 ...
|