|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 n m# `( m1 i7 H" Q6 \, }7 x% d
$ U+ s, t! C( m+ z/ _& z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( [. G. |& m# C3 _+ t* ~+ X+ g8 |# d, S5 X6 ^
begin P_read arriving
6 Y0 F+ ~5 a6 l* W W2 j @ while 1=1 do begin# H! X6 U, T t2 j' m( ^
read A_tote from "data.txt" with delimiter "\n"
+ x6 G! x3 p/ I ^ read A_time from "data.txt" with delimiter "\n" a) m( v1 ?" c6 n0 T
read A_leave from "data.txt" with delimiter "\n"
| |4 R( _1 W8 h0 ~/ r read A_picks from "data.txt" with delimiter "\n": H( J2 m9 ~& U8 ~8 S
set load type to A_tote/ c! C- c# V( v5 l0 w: V1 P) V
if A_tote="tote 1" then set A_induct to 19 S! D# E. r& [
else if A_tote="tote 2" then set A_induct to 2' l$ N5 F9 r% @
else set A_induct to 3 " b! z3 a( z. E/ P* t! R
set A_i to 0
e: D8 F; S: w. K& Q1 f clone 1 load to P_induction
( r- U( [1 ?- U: I; p# q wait for A_time sec. J. x! E+ B0 t( y5 R; A
end
% N" ]3 u5 i Yend
l( t7 g2 r1 _4 s
0 j. k2 t3 { F+ H' b/ r' ~" g7 @1 qbegin P_induction arriving
( h( R# K0 i: H, N0 T if A_induct=1 then clone 1 load to P_pick1
6 m9 d! v7 \4 Z else if A_induct=2 then clone 1 load to P_pick21 R- M/ m3 C) n& L( S
else clone 1 load to P_pick33 O( y' Y5 \! b
end
( v3 M( S8 K. |, O0 y) H) _. W3 |2 n: Z4 a5 _
begin P_pick1 arriving
5 r8 D( d4 H G9 c& J" R5 r1 h set A_i to 1+ L- m/ u/ N) P" Y8 f' ~
move into Q_induct1
0 @* e! p! @: U* j( e/ ^ move into pickaisle.induct1- K, [( b9 l/ E, {" b
while A_i<=30 do begin2 X- X3 a& m4 e/ @; x5 S
travel to pickaisle.con(A_i)
# J* `. h& H u/ o9 c& c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 ]; W: R# W [, r1 _
else wait for 10 sec5 ^2 C2 n: G2 Z7 W* v2 z2 ~
if A_i=A_leave then send to die
. `: ^ j! C* ?9 j! b# V# D1 v' D else inc A_i by 1
) H# H4 |6 s8 A" @, s& x end
: e k+ f% m3 yend
; o. m4 R* z/ U- f4 v3 K
D$ K e' {: c4 obegin P_pick2 arriving" }2 E4 R" E2 ?& G* d! Z
set A_i to 11- L- |( a" A& t! p6 I- i
move into Q_induct2
- y0 |1 e( I) g) s move into pickaisle.induct28 R+ H+ ]4 a: G7 X+ I; E
while A_i<=30 do begin
# S) N# N4 j" K; P travel to pickaisle.con(A_i)
% I6 h! [9 J# Y. R# f& Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( }2 b! R' x9 U( a& X else wait for 10 sec
9 M, a( n4 ^- x, B9 F/ R if A_i=A_leave then send to die$ q2 {5 {( G2 G7 e
else inc A_i by 1
1 r/ a& f& |2 c- ]/ P7 _ end8 O9 u. {! ?( I' I( g* W, ?) U
end
7 }8 s1 J' K a1 M3 y2 Y* w& V$ A7 I$ t0 T7 R
begin P_pick3 arriving: |: {3 x7 P5 b2 e0 V. P7 I
set A_i to 21. m9 R* Y0 |- ], N8 e
move into Q_induct38 ]/ s3 ?8 [3 X$ A( @
move into pickaisle.induct32 } W3 E/ l6 P2 h7 l; g8 n. b# |
while A_i<=30 do begin7 Q! M0 B$ B( q) C5 c8 H" g2 B% r+ w
travel to pickaisle.con(A_i)1 F2 i; _: X3 W2 O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ b. E0 }$ y% w( r* g
else wait for 10 sec
) [6 a9 H& P( h7 e6 R if A_i=A_leave then send to die8 B0 c& r1 T$ b2 h7 k4 I5 c
else inc A_i by 1
; I* _$ _% p7 r8 x1 e6 F) i! ? end
+ G3 B# y) D3 A) xend |
最佳答案
查看完整内容
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,其它按你的 ...
|