|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, U5 @3 F3 f1 X2 A8 g1 ?
K: J9 {# ]8 V. q5 B6 _
我的问题是,在每个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 w& y) P3 L
0 z! E- a" B( g8 z( zbegin P_read arriving
0 P# ~4 ^5 P( c6 u while 1=1 do begin# @- S5 {4 n- Q; e. @- ^
read A_tote from "data.txt" with delimiter "\n"
& m* ~( D0 M! Y$ K" R1 F3 i4 P' L5 ]6 z read A_time from "data.txt" with delimiter "\n"
3 l# j' f- A( g- e6 d' r1 l# H read A_leave from "data.txt" with delimiter "\n"9 x8 K+ E6 @9 W) S3 ?) |2 O( ^
read A_picks from "data.txt" with delimiter "\n"
* g' R2 e( ~8 @, f set load type to A_tote
/ G& R, ]! R0 v: z$ v* r if A_tote="tote 1" then set A_induct to 1
" l: f3 R* \; S ?) Q. D3 K else if A_tote="tote 2" then set A_induct to 2
& v; n, u% G" P$ ? else set A_induct to 3 2 T( y% _+ j% @ j; G/ w) P3 [
set A_i to 0
+ d5 G! ]7 [& @1 e" B9 | clone 1 load to P_induction
0 ] \2 L, x; x( P wait for A_time sec" h- G+ C! ~2 g* w/ ~" a
end
: ] j# N# }# W9 V; F' z0 bend3 S3 l* a+ _! o) w6 |- q; Y4 t+ H+ Y
# C! |8 V# ~3 ?: n3 a9 t) E9 x( x
begin P_induction arriving; d5 M9 m5 b5 w/ _0 p+ p; B
if A_induct=1 then clone 1 load to P_pick1
6 `1 h" d; M8 f; h' w else if A_induct=2 then clone 1 load to P_pick2
; x9 D0 A" m( \ else clone 1 load to P_pick3& b; x" b+ g" {0 P5 W0 a
end
+ N' L- s+ o' i k/ u7 N" k5 u1 o$ _) k% }& D6 T# r7 |. R
begin P_pick1 arriving
' M; q. k7 o5 X set A_i to 1
9 y8 m& b6 B7 v4 [ move into Q_induct1
# ~+ j! [/ y( W2 X3 L move into pickaisle.induct1
4 w% Z( |5 y9 k$ r while A_i<=30 do begin+ v2 n9 _- D$ q- c$ {( O
travel to pickaisle.con(A_i)
9 I& g Y/ ?+ A! x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: E' z, w& i5 [7 Z2 @5 p% M) q else wait for 10 sec
. u- m) d. S# S) M' R4 q if A_i=A_leave then send to die
: q" s0 g, `2 q1 D, v9 N1 O. B else inc A_i by 1' M2 p6 e1 x+ Z3 Y0 ~% Z* U
end+ N! Q9 ~8 Y8 Z/ W& J
end
) l( o! I! G3 ]) J5 {0 Z6 K
2 L) s; E- Y: ]# Y% R/ `" }4 Zbegin P_pick2 arriving5 {( l- U0 @& F5 _5 W. s
set A_i to 11# k/ b7 s0 B( g$ W7 ~5 G, G6 V% w
move into Q_induct2& _+ G# b. o# i8 R8 f% _
move into pickaisle.induct2& a& Z5 G/ q. D
while A_i<=30 do begin
5 f: W& T8 C3 L* p# P travel to pickaisle.con(A_i)
F6 E' L6 Z: J7 Y8 G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) g, Q0 h0 s' G7 F
else wait for 10 sec
+ a5 L6 G2 V( E4 m& P if A_i=A_leave then send to die
+ m( Y& u$ Z2 U! x' P1 r% j5 q4 B6 X else inc A_i by 1
9 Y, `4 c+ k' m# D end
, u/ R: j( p- v1 j q+ }end
$ e# t; ^0 @- `/ Q' K% [9 B! ? m; Q( u" L% w5 _7 w2 E5 |
begin P_pick3 arriving
4 Y8 C; x/ `: _- ?/ K8 r4 B set A_i to 21
! C) J z: S, |# z move into Q_induct3
8 ~! b1 `" c q& K& R6 c/ {. B move into pickaisle.induct32 q" e6 U Y) ]4 B$ s/ d' {
while A_i<=30 do begin: w w, q/ ^4 [$ r, a% D& u5 G5 e
travel to pickaisle.con(A_i)
: Z* L: t6 `7 q) M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ E- u+ f( k& M- w) }& W0 _& E else wait for 10 sec" t( z7 U2 D9 s; `/ a( V X1 D
if A_i=A_leave then send to die/ W, f9 O0 }8 z7 U/ y# Z* g @ D
else inc A_i by 12 D1 o/ l7 q8 ]# P
end
9 X9 ^" P0 a2 {, A( Jend |
最佳答案
查看完整内容
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,其它按你的 ...
|