|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ K& ]: i: S6 F7 r' @
* j" O) [1 U- X9 u; ]* Q$ {" B8 i我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ n% Y, Q* j# o. y3 {2 v
5 V, k( n: Q' A4 n2 mbegin P_read arriving8 @0 y" a' b; z& z, b! B9 ^
while 1=1 do begin! r5 A+ \ q0 c: U5 Z: Q
read A_tote from "data.txt" with delimiter "\n"
4 y, U# J4 R" { read A_time from "data.txt" with delimiter "\n"
+ m$ D+ {/ V- q" a+ R( d read A_leave from "data.txt" with delimiter "\n"
9 U4 z- _! u9 e$ H6 D read A_picks from "data.txt" with delimiter "\n"
9 r" W& y9 w0 z" f; Q% b set load type to A_tote; \# s* U/ N; E2 T8 { ?9 `
if A_tote="tote 1" then set A_induct to 1
" r! Y$ r; A7 S b) ^ else if A_tote="tote 2" then set A_induct to 2+ V+ w$ T: T& E0 O
else set A_induct to 3 0 }1 n' i8 w& s( i
set A_i to 00 X) j) J# M0 P& [- q/ k8 Z( k
clone 1 load to P_induction
: H, |% w& m+ \9 T r* R( [ wait for A_time sec
; i" f% i- k2 {, f; A- P9 f# M end {7 R3 v! A+ B
end
Q6 H1 G: B3 Q' ^( u( R
# |3 g: V9 Q8 U, |" q' l5 Dbegin P_induction arriving6 ^) p$ b; a! e5 V0 \2 [
if A_induct=1 then clone 1 load to P_pick1
: ^5 q! i3 _+ T- B else if A_induct=2 then clone 1 load to P_pick26 s) \; X7 S5 L6 W
else clone 1 load to P_pick3
4 g9 R$ u% b4 e9 m8 i$ N9 oend9 O+ e7 Y! r/ I! r& P/ X
# ]6 F% i# O$ g' y- J9 }
begin P_pick1 arriving
0 |. u5 m; @% d set A_i to 1" ] ?* E2 i2 w1 X
move into Q_induct1
9 _5 \2 \; C4 y9 q move into pickaisle.induct1
9 H$ |9 l Z% x; Q# L1 F while A_i<=30 do begin1 M4 T0 I$ M/ j0 s. L
travel to pickaisle.con(A_i)
7 h6 P& x3 E* p0 @" U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ }' L. q! k1 [/ S0 ] else wait for 10 sec
) v& a6 S3 q, r3 K% [, k if A_i=A_leave then send to die* r3 }! O" r( s# j! Z
else inc A_i by 1
3 `' r) O. b3 t0 J. O1 a% E end
- G' d: n" v+ P0 t& x. send
9 H: c# |' q% F* ^& {3 L; Q- b# K& A" q# Q% ?* S& N
begin P_pick2 arriving3 e# T$ e6 k$ }2 W
set A_i to 11
* P8 ], i5 ~6 b! \0 A6 d move into Q_induct2' H- }" T8 @( a# u, v5 `' E
move into pickaisle.induct2. m3 s$ E1 A H6 f$ b* p* f+ s# z" m
while A_i<=30 do begin9 w8 F- Y) p4 b; h
travel to pickaisle.con(A_i)
8 o9 |2 [5 m$ n8 c8 b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 W6 [7 }$ k0 u5 ~: e; `+ G else wait for 10 sec! ], J7 q8 O$ e' X3 N+ n/ L; q
if A_i=A_leave then send to die
! X S6 y; P3 d# h else inc A_i by 1
/ n6 q. J6 {5 e" P1 i end
: `4 u/ O/ _7 H5 }+ `end
$ E) Y" {2 V1 w0 t* a9 b0 L# O2 ~2 Y3 |( w4 I& q
begin P_pick3 arriving! r' ]; O$ L0 o' G& ]9 W- N, M
set A_i to 21
# R& T5 v, w/ x1 a move into Q_induct3+ G- ~" ^; d' P
move into pickaisle.induct3
& T% f/ u' k* D while A_i<=30 do begin. u0 l4 w$ N& M) j: v- W
travel to pickaisle.con(A_i)2 E# d' w O+ Q2 [# T& P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 v* |7 ~3 X( p% \& T; N9 r
else wait for 10 sec
) G F* M8 I" ^/ d7 a9 T0 q M: l if A_i=A_leave then send to die0 f- ?! R% j% M" m+ z
else inc A_i by 1
+ V% z! T7 W2 W5 j4 V; i9 ] end+ E# C( O) M. k8 A
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,其它按你的 ...
|