|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
Z& p% a# l) s6 j' \
8 d6 [& e$ R9 z4 P+ R我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 ~3 J5 t' K# K" `# U/ w3 Z
. M. o2 c9 ]) r, k$ e6 ^begin P_read arriving
7 [1 c0 ~/ @- y" z' `- }7 f while 1=1 do begin' \5 ?4 l: f" I, }2 u. b2 b1 v& q* V
read A_tote from "data.txt" with delimiter "\n"
% p' V5 }8 _- H& T5 ]" w5 t read A_time from "data.txt" with delimiter "\n"0 ^, e/ `2 a+ t( H! c
read A_leave from "data.txt" with delimiter "\n"; I% d! d% F1 g5 b! _- _1 k
read A_picks from "data.txt" with delimiter "\n"
+ a+ E3 X3 x" p+ f: B5 m set load type to A_tote
; F3 q, w8 v$ {$ G& H0 s if A_tote="tote 1" then set A_induct to 1" Y8 Z1 I& s' f6 C& ~; P7 T
else if A_tote="tote 2" then set A_induct to 2/ Q+ N) F# V; C9 w( E
else set A_induct to 3 9 N; q. h! x; y
set A_i to 0# X) u" f* l/ [3 H8 h# @
clone 1 load to P_induction
0 [) \9 K5 m: B7 J$ z- n wait for A_time sec
# E( |2 w+ D% f* S' s end% e7 @5 R6 G& n! `' J4 `
end
- u" d4 h$ q3 b( h
! _* L, B* p# B- v1 e. Ubegin P_induction arriving0 t9 V5 m. F3 Y$ T6 S; n! I1 s7 r; u
if A_induct=1 then clone 1 load to P_pick1 Z5 f( B$ K" r# T6 [
else if A_induct=2 then clone 1 load to P_pick23 M3 S7 M+ ~" L. F
else clone 1 load to P_pick3
0 y7 s2 B# V0 ~3 q; Z4 z, Send0 @$ W9 O0 }/ m- { b9 A. d! y" D3 S
+ G$ v+ T1 P" n* y7 t' \ qbegin P_pick1 arriving
# L/ R- i6 {9 s( _- W8 k3 D set A_i to 1
2 Z3 Z9 L2 K) d3 x0 t' W* w move into Q_induct1; t+ L/ X! @* m/ t' C1 P+ P$ }
move into pickaisle.induct1: }) z- L6 K# D a- f
while A_i<=30 do begin
( P0 b N& ~! k( U1 |& U( Z0 X travel to pickaisle.con(A_i): a A) m) D& v! X: Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 y6 O- F! @5 G% P6 o" G4 T
else wait for 10 sec
# e" E2 X7 t; A1 t if A_i=A_leave then send to die0 r- h* I8 s) i
else inc A_i by 1
; l' ?% Z6 Y( P& [/ l: L end; O" B2 W# Q5 e+ ]
end
+ n: {9 L; b8 A5 e `- u* ^2 G+ s; @" b+ J* L% z
begin P_pick2 arriving
0 |" I9 K5 z/ P. i$ Y set A_i to 11
$ T, `7 \3 V: H move into Q_induct2
. {; Y5 i5 y8 y* S C: f6 t move into pickaisle.induct2/ P8 k. t, H3 G! I0 ^3 T4 ? k
while A_i<=30 do begin
1 o8 O0 e) H: o B% } travel to pickaisle.con(A_i)
( _/ J" X9 A- z1 `* x- ^# D) D; J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* Z4 R* ~) G; u2 k% t
else wait for 10 sec
9 B3 k6 T5 l/ m$ H3 S if A_i=A_leave then send to die0 X6 [" W* N8 x, |: r& D& x
else inc A_i by 1/ n% V8 M0 A7 Z9 O. N& o' ?7 Q- H
end
% I e2 S3 D* Qend& u" u8 z. Y( L/ e
' Q7 x% N/ Z1 I4 K. z+ O6 j9 R
begin P_pick3 arriving+ W/ f. E' v) K$ j
set A_i to 21/ o" s. G( l7 k: p1 z
move into Q_induct3
8 l: ]3 ^7 F6 L2 F" I move into pickaisle.induct3
! K% x5 A8 a4 X/ D3 M( U while A_i<=30 do begin
- e- I$ D+ _; @% [ travel to pickaisle.con(A_i)
5 n, E4 S, ]1 Y2 Q5 c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 @0 N9 b5 Y7 w+ J- A else wait for 10 sec
) G/ t. K4 d& c# m C if A_i=A_leave then send to die K9 h# X; d. m, ]; d0 {
else inc A_i by 1* \1 h# |' J. i* k) T5 L
end
( C2 y9 S0 s0 f* C; W; J1 p p; zend |
最佳答案
查看完整内容
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,其它按你的 ...
|