|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( h; g1 G9 k; y8 d* U
' N7 n- t5 O/ ?- m5 D1 O# w$ K: E我的问题是,在每个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中的数值,不知道会不会有什么不妥。
1 D" y5 a4 o4 v: ~, W0 `5 N+ `) h9 T4 M6 R# g. i4 A
begin P_read arriving H8 E( D* h2 {/ p
while 1=1 do begin0 V8 L8 j8 S+ {2 F" b1 c8 g
read A_tote from "data.txt" with delimiter "\n"7 ?- e# B8 Q8 w9 b u
read A_time from "data.txt" with delimiter "\n"# d6 }# P W3 ]0 X: k2 d) s$ C
read A_leave from "data.txt" with delimiter "\n"& y& u# {! ^- ~' A2 C, W
read A_picks from "data.txt" with delimiter "\n"
- u2 \, O/ ` p& ?! O L6 ?! b set load type to A_tote7 h, a- B. I2 g$ L
if A_tote="tote 1" then set A_induct to 1
) Y6 K1 ?; T( d" g1 B# b else if A_tote="tote 2" then set A_induct to 2( k" z1 r( y/ w, X9 t- `, ?
else set A_induct to 3
: \+ b# u+ m0 |; Z. O4 f set A_i to 0. O: l& v z. Y& J* Y6 M& l$ ~4 _6 n
clone 1 load to P_induction% g" j* ?1 S* j2 ~9 a2 t
wait for A_time sec
+ Y+ P& x0 j5 ^0 z8 O4 a end: I, c9 o" l4 R, e9 n _' o
end3 P6 ?$ g* Q" x; M
* `4 d9 W B9 [* w( q
begin P_induction arriving
$ O# x3 E" X' c4 V; F) i; v if A_induct=1 then clone 1 load to P_pick1- ?8 d0 f9 I6 d+ z
else if A_induct=2 then clone 1 load to P_pick2
5 {9 Q2 }& c8 m% g3 e* K6 F else clone 1 load to P_pick34 h2 V% z: f, N; ?0 G" z
end5 O, r/ J" i: F! B3 n/ i
4 M9 _! N/ n3 b; r" [( q$ a3 K1 \8 J
begin P_pick1 arriving
2 h2 u1 f) M2 H7 L1 _: U set A_i to 1: J- ~. b( [2 b/ j$ e
move into Q_induct1
0 ?! J [. n& c+ v+ H! n3 f& A! A move into pickaisle.induct1) I& v6 C; \% `: N2 j! H; g
while A_i<=30 do begin7 @2 k; N, c! l o
travel to pickaisle.con(A_i)/ c7 l. N* Z1 v+ S- E( n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* f7 s- b- q! z% m" n) x
else wait for 10 sec
0 h7 l4 H- \& R E, G) D1 o$ m2 F if A_i=A_leave then send to die
: O6 `$ j; v3 x! [( w# h2 [$ F else inc A_i by 1- e% z1 d" S( @6 [" g2 o
end
: `) j( j4 g' |end! Y6 C* A" o' f: R! B
% u9 Y v) s6 C1 ?9 sbegin P_pick2 arriving+ n; k& f5 D2 W4 u% E7 T$ ^7 M
set A_i to 11' I# G# i$ Y& E% H) r0 n; U
move into Q_induct2+ e$ h. Z' h# l. j2 `* }
move into pickaisle.induct2
+ p0 z( g) o* J3 @: ^1 r& q. a& ~, a while A_i<=30 do begin( r8 Q0 B* E8 u% B) P' N
travel to pickaisle.con(A_i)1 s- ]% |0 [; h. J3 o
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 K5 }6 m0 X4 v else wait for 10 sec$ B4 G% \; o. F1 v3 |, ^4 ~
if A_i=A_leave then send to die
* d8 T( y0 |8 Q- X8 U! G$ P+ f else inc A_i by 1) x9 x. i6 h1 d) [ s# T
end8 R* }, C$ k8 \. m; h6 z% o
end
1 f0 R2 ~/ I; n7 X# u; K- P
* Z4 w% R& f0 k% U7 v( n) _0 I0 _begin P_pick3 arriving
; t! n, B- t# c! ?6 t$ ` set A_i to 21
6 o9 }" Z! D" K5 N move into Q_induct3# y# t4 c1 p7 f' \, N
move into pickaisle.induct3
' i4 N0 j7 O2 W; S9 h7 u( | while A_i<=30 do begin5 x2 X5 H4 g# D$ t9 S
travel to pickaisle.con(A_i)# a8 x/ w9 Z2 [- R6 q, Z5 x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( `0 _0 f$ L1 G, A
else wait for 10 sec
# N* j" S2 ]" O/ W# e- N+ ^% V( Y if A_i=A_leave then send to die
; [6 B! y9 Z& Q0 ~! J5 r7 G1 H else inc A_i by 12 W6 o0 K% T, D8 {+ S0 C% @) H! C* N
end
/ Y- V1 @ j3 d" ^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,其它按你的 ...
|