|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 i$ [. Q5 l+ O' g$ D) B$ n; S
5 k: S( J" B2 w3 j% U8 A! `: A我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% ~5 p2 E& s: \# p( P9 o [' d; g6 c$ p
begin P_read arriving
4 X: R1 U6 d& i5 G while 1=1 do begin
H& s: n6 f: X8 k read A_tote from "data.txt" with delimiter "\n"3 F8 s1 Q. s8 m
read A_time from "data.txt" with delimiter "\n"3 W- R* V1 P+ X; e
read A_leave from "data.txt" with delimiter "\n"
4 L. r! S( k$ n0 ?# Y3 ~ read A_picks from "data.txt" with delimiter "\n"" L) J7 O! K5 [8 N! q6 X ~* Y' i$ [
set load type to A_tote
2 C! i4 ^% q' g) q) S: Z if A_tote="tote 1" then set A_induct to 1' _6 d$ I/ A( O+ m9 F4 i
else if A_tote="tote 2" then set A_induct to 2
( m9 W+ G9 a, s4 a( a9 n* ]: R else set A_induct to 3 ; s$ n( A, u: {: i) {) _
set A_i to 0- S3 f& C; P( p3 K2 \
clone 1 load to P_induction5 @- E" ^" }5 _& ~; T, X1 p
wait for A_time sec- B4 _, O3 {+ Y @! ^/ }0 _
end
; A& K& D" f/ j1 a R5 Eend
) j3 Q" }8 C9 k' T3 G6 j1 X& _1 ?( ~
begin P_induction arriving9 [6 o; L) |6 q" | s y! i7 b
if A_induct=1 then clone 1 load to P_pick1
& W2 m2 {0 c. J0 ]1 I else if A_induct=2 then clone 1 load to P_pick2% E; Y: k' m1 `& I J
else clone 1 load to P_pick39 a9 ?: R% ]" R
end
/ J" r/ i* p. O! M) U4 Y5 c" F( e
/ K! o" X9 R4 x5 {# k- f1 Nbegin P_pick1 arriving
9 s- k3 H2 S4 C set A_i to 12 D0 h# A: b8 H A+ S
move into Q_induct15 \/ y/ C$ i9 Y. Z+ {8 Q# _4 Z
move into pickaisle.induct1& u! ]) O( [3 r9 r2 `
while A_i<=30 do begin
& p8 S+ x+ n/ Q$ O) T travel to pickaisle.con(A_i)7 m/ M" i S1 U+ k* t& M
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 [; v5 l( b/ Y3 ?- u- P/ }' i
else wait for 10 sec
+ N" ]3 h U0 o% O if A_i=A_leave then send to die
! U2 R0 Y+ @& M' |; g7 ? else inc A_i by 1/ G0 d2 e" F" X/ |) K# e
end' D. Y/ R4 p& p$ _) y; ^
end
9 f) \$ e% v; n( E; ]' L: b% G$ K/ L* J
begin P_pick2 arriving* J9 K2 ?! R! M1 U! h
set A_i to 11! u0 C# Y5 f* [) A1 @2 W3 k. Y
move into Q_induct2
a4 R" n; f9 O9 r( O( @ move into pickaisle.induct20 Z' J$ ?% w9 e: ^) _/ `
while A_i<=30 do begin
T# G# t. P* B7 p0 t" i& r% O; N travel to pickaisle.con(A_i)
8 x2 u3 A( n/ q6 }4 {9 y$ `" R" l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) ^9 V! I4 J0 l a. a) b2 t# e8 s else wait for 10 sec
5 [5 Q0 y& R. S( d- M% ` if A_i=A_leave then send to die
2 b6 Y5 Z" N- K* T6 p3 @ else inc A_i by 11 n0 U# Z2 s7 _. h& V: j s
end2 @# f" ]: }* ?) H% e, j! a2 \+ j3 ^
end
/ p6 h& q8 q5 ^; K1 ]% C4 z& B% @
8 A- Z8 d% q" D) C1 E2 y2 Ubegin P_pick3 arriving7 g7 q6 G) E7 C1 n
set A_i to 21
* C- K2 W2 V+ O1 d move into Q_induct3' O8 D& a0 N8 b$ u, l5 D
move into pickaisle.induct3. b) E; z) g+ l
while A_i<=30 do begin {' a+ c1 _- k! X3 ]2 O" T
travel to pickaisle.con(A_i)- b5 i. x7 K) a J- }# I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 }* q; q( V d4 z
else wait for 10 sec
6 Z, n2 b- |, L0 Y8 @2 h if A_i=A_leave then send to die% i+ W5 l: M: v
else inc A_i by 1$ m3 x# o- n. z. f) x; M
end
1 p; O) i9 w0 [+ C# x% k1 [# send |
最佳答案
查看完整内容
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,其它按你的 ...
|