|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 U. J' d1 j; C
0 B+ T% z# d; ] _/ ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 P5 Z! x7 a! R" z6 l' i0 A& q
3 ~5 n b; G: _5 j& V; Fbegin P_read arriving
/ ?) J0 N- |1 }; W while 1=1 do begin
" r3 c* U8 x+ w u read A_tote from "data.txt" with delimiter "\n"! Z- v* y% W. w
read A_time from "data.txt" with delimiter "\n"8 ]! h, U0 _$ s d$ @% c' i, j3 U
read A_leave from "data.txt" with delimiter "\n"
2 r1 N: ]9 n1 @ read A_picks from "data.txt" with delimiter "\n"& `5 l. M" D2 o8 I
set load type to A_tote
) P$ Y& M1 r* ~) u) O if A_tote="tote 1" then set A_induct to 1
( {3 _5 b4 t9 V3 X9 y, B$ J else if A_tote="tote 2" then set A_induct to 2
' p) l: j4 i& t2 V- ? else set A_induct to 3 + [. D. W- |. ?( d
set A_i to 02 W* Q; B2 d+ t$ A
clone 1 load to P_induction
- B6 v0 s1 s! @. D$ V wait for A_time sec! T" Y" Y3 v% n5 ]; H7 Y
end0 N) W/ |% P+ q' g, m4 L
end
0 |: ^# C% o2 Q2 `4 j& O
0 P4 ?: h& p2 Ebegin P_induction arriving4 J) Q; d' x5 g* u2 F$ t( P
if A_induct=1 then clone 1 load to P_pick13 {0 n8 o) {9 C
else if A_induct=2 then clone 1 load to P_pick2% k1 c _( _: `! f1 G
else clone 1 load to P_pick3
! j7 c* h2 I4 u% u0 uend6 S8 b( i" ?4 \6 V! u
3 i) Y$ ~7 p3 p0 n4 m* W2 {9 b
begin P_pick1 arriving
! C! x5 O8 e: f set A_i to 1
% ~# e1 ?+ v. i( R* u Q move into Q_induct16 L. Q y" K; N
move into pickaisle.induct1
" L( v6 I. w9 j/ l6 n while A_i<=30 do begin
2 ?9 C, e P) D" E1 F: m/ V1 \ travel to pickaisle.con(A_i)5 b6 R3 X H# i& z% G) a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" d: i9 F8 c# ~, e4 S else wait for 10 sec
! }; v, T* t- M1 G( c; ]3 i if A_i=A_leave then send to die/ I2 x/ g7 C$ s! W0 c
else inc A_i by 1, _* r* b+ i9 r' {" k( |# l
end
9 Q! |( @( j: g3 t: t1 zend
' \" u* F9 p+ z5 z$ C5 U# |
( X' j* v) H* `: ebegin P_pick2 arriving6 W" @/ B; F; ? }# C6 x& t
set A_i to 11
& f' { R0 p$ Q4 l& A. d move into Q_induct2
2 M) a8 S+ b' I0 \, u$ Q0 K/ H move into pickaisle.induct2/ M% O0 W- y6 h' g: }
while A_i<=30 do begin% u4 x! U0 w0 H4 P# u% N6 T# d1 Z7 R
travel to pickaisle.con(A_i)+ B; a5 q: V* i& E9 U7 F# X$ m1 L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 Y# C8 a6 \, Z X8 r0 ?5 g
else wait for 10 sec
3 ~6 s3 M, F& c4 j( y if A_i=A_leave then send to die8 e5 T4 S" R3 y* S
else inc A_i by 1* Y5 W% M7 W* y% G& k' k, |
end7 J" ]: A$ b3 C2 f6 N
end
: N- N; y+ F& t( a
1 A2 `# k$ r; {+ r. n4 Ibegin P_pick3 arriving
3 r! W; z; ]/ j2 E2 i set A_i to 21
- L$ I+ Z/ N V/ w3 i" { move into Q_induct3$ M E# M8 A+ T9 k6 C
move into pickaisle.induct3
, e+ L+ @' {5 I, Q6 u+ I while A_i<=30 do begin
7 c& r+ c& k! u( y travel to pickaisle.con(A_i)5 I* [$ ]9 ]/ y) S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( g+ e$ p, o$ k( f, k4 S! W
else wait for 10 sec; M( A5 b) Q2 `
if A_i=A_leave then send to die' Q( C) w- p# u; N! r3 u% K* @
else inc A_i by 12 {( C$ ^ a* [4 _- t' C
end9 d0 U; y* |: m! k7 R4 {
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,其它按你的 ...
|