|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& \" D1 A) e6 k0 E7 F) i6 Q' a- p
- A8 f4 D0 F: \9 E- ?' I: 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中的数值,不知道会不会有什么不妥。! e9 T0 I% N1 g! Y- }
( b+ l, |$ ]7 Y& d
begin P_read arriving: N( E2 ~0 i! [
while 1=1 do begin
3 O, W2 o# X3 j; L read A_tote from "data.txt" with delimiter "\n"
4 Z% P( b' G0 ^$ f0 o. l; j read A_time from "data.txt" with delimiter "\n"
$ c- C7 l, h& ]- m( s, g/ l5 P+ L+ f read A_leave from "data.txt" with delimiter "\n"
3 A/ Z3 X, h1 F& H% {0 w1 k read A_picks from "data.txt" with delimiter "\n"
- H, U' L; Z! w$ n set load type to A_tote
6 Y7 R6 o- x4 f' i+ d! [; J4 o if A_tote="tote 1" then set A_induct to 1
: J) Q( R, E/ ^( P& [! J else if A_tote="tote 2" then set A_induct to 2
# k: K5 ~. A* T: r else set A_induct to 3
2 N0 P% ?8 y9 d" P" Z' Z6 ^ set A_i to 09 s, n& w- t. ~# l
clone 1 load to P_induction
h- a5 ~3 y: H wait for A_time sec% i* j, T @% f- C
end; z+ I8 r- b9 Q2 t* b, f: e( r
end4 y7 G4 F# Q3 @$ `" I& K
# e: l+ p0 K# |% g4 Y
begin P_induction arriving
: Z$ G7 m0 w, l' j if A_induct=1 then clone 1 load to P_pick1$ y. N2 b5 L0 [ p3 q! e' A9 |
else if A_induct=2 then clone 1 load to P_pick2$ E0 k" b8 a. z J% \" [
else clone 1 load to P_pick3
7 J! N' D. e, o5 c0 p+ j- y* q4 ]end3 e7 c6 u4 b* ]5 W; I9 x& M
) t& L8 k( F, D0 t I8 H
begin P_pick1 arriving5 v( u T$ J# F- D# {- F
set A_i to 1
- b+ D- N( b- h/ N7 f move into Q_induct1
2 I& r7 F7 P6 ~* q+ s% J move into pickaisle.induct17 P5 {# D* y: i7 h( i
while A_i<=30 do begin, n6 X- P7 S' v" L" l C
travel to pickaisle.con(A_i)
( s: J: b5 J3 A& f5 l, f. T* W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ d; u J0 ~: L0 w else wait for 10 sec2 d% v ?7 a- h- z( u/ z( A( z) z( M
if A_i=A_leave then send to die; ~ M/ L1 `1 d8 C7 y% w- e
else inc A_i by 1
3 q n9 @( R1 l, G9 ^, a F8 K end
( b) r$ l" f! |2 N, [; `end5 G3 R, i% T* `+ t: a0 J; |; }
. W' J9 B0 K5 x& g5 Mbegin P_pick2 arriving" r# J. k4 [* B9 F/ ?" s: q
set A_i to 11
8 O1 {' W# [3 t5 V move into Q_induct2; v+ A; K; B D5 ~9 t* C. ~# B
move into pickaisle.induct2
6 g$ }7 E9 n( C' C% W, } while A_i<=30 do begin1 K: ~* D: k) @9 @- m: ^2 _( @
travel to pickaisle.con(A_i)
5 ]" V& A2 F q3 f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( b+ W7 m( v$ _0 K9 b3 _ M" q) ` else wait for 10 sec2 C/ a) {% W! c6 a& m
if A_i=A_leave then send to die* N* C7 a0 @* e
else inc A_i by 1 f7 e. [/ c2 B0 v' e# z L9 u
end7 i/ t3 @1 E3 A' y
end8 g2 p& j% }+ F2 \$ N5 |/ E
; U1 T; X* w5 u; S) Z* c5 c/ y9 x- Vbegin P_pick3 arriving
$ c6 {/ n: _' [: S: Y( c, S set A_i to 21$ {- b( q3 B$ F2 W2 H2 n4 F
move into Q_induct3
5 b d |* Q4 V" m5 Y( k$ L* k' a' Z move into pickaisle.induct3
/ w% q" a% V( q3 D while A_i<=30 do begin& }3 `1 i" V# c0 Q9 `7 q9 v- V
travel to pickaisle.con(A_i)
: N. p2 T) j- N/ z, _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 f: @ D# s" l- h) k else wait for 10 sec3 d& i w6 L" u; ], Z
if A_i=A_leave then send to die
# F5 X1 h4 ~" `8 [) ]& V9 Z else inc A_i by 1
v5 ^# {+ e& {% V x! e- h5 c end/ z3 s- m9 I; F9 w2 c- Q- v
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,其它按你的 ...
|