|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ e/ F0 t9 V8 H3 ]$ x. r3 X
. S- O# b, A; X. c3 ?. c( H# P我的问题是,在每个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中的数值,不知道会不会有什么不妥。& M s* @! m: u+ i& M' `
0 k; e2 U3 y( _begin P_read arriving2 {6 ~5 k" _' P0 A
while 1=1 do begin
+ \* ]% w' c: n9 r read A_tote from "data.txt" with delimiter "\n"7 z# f1 ~9 {& C8 Z: P" \
read A_time from "data.txt" with delimiter "\n"
. Y; |% d1 p/ h" C+ U% e2 J read A_leave from "data.txt" with delimiter "\n"/ u: |* P7 p+ h. a2 {
read A_picks from "data.txt" with delimiter "\n"3 D S, f7 U1 P! r- U3 t
set load type to A_tote
# M2 X5 m4 ~: x* o if A_tote="tote 1" then set A_induct to 14 [* [4 g% j7 q
else if A_tote="tote 2" then set A_induct to 2
/ U3 `* E) Z: O1 I" ` else set A_induct to 3
3 G3 l' |) Z8 S" b0 |8 ` set A_i to 00 q! v5 B7 Z; j( @8 z, M. z
clone 1 load to P_induction
& _; a- [; @# ] ~- ^, d wait for A_time sec
8 T- j) [# s. B8 s: A+ _! t+ L end
. J. o7 \% r* ^$ R$ r2 ? Lend/ r8 Z5 B8 U' i. i3 m( w" W; h
1 L' W. D0 h1 V! k& \# I+ Lbegin P_induction arriving
4 o. G( [6 x0 c+ \, m, k if A_induct=1 then clone 1 load to P_pick1
2 S( ?: ?$ P6 q: r+ O else if A_induct=2 then clone 1 load to P_pick2/ m3 m# q1 k0 d" ^* u/ |( ~
else clone 1 load to P_pick3
?6 Y/ b, I; ^; w# G) z- O. Wend
) G. x& ~6 G4 G2 i1 A$ l# k! ^; V; a, y( r
begin P_pick1 arriving: \/ ]3 P, M6 C9 O* ]# o
set A_i to 1& K- \; j" d& D" j& P' v; y
move into Q_induct1
% t( @5 h6 n/ v move into pickaisle.induct10 r6 \ T: a9 @7 l
while A_i<=30 do begin! v; r# k/ D+ P. T7 p7 j+ b0 ?
travel to pickaisle.con(A_i)/ V; ^- v% M s J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: z2 E8 J" S. j4 o
else wait for 10 sec* Q: A. d: r; ~; `0 w
if A_i=A_leave then send to die
, n( z7 P J1 | else inc A_i by 1+ V- M; D2 ?: O" s+ f3 S! ?
end
0 ]. S8 ^7 C, V0 g9 Jend1 S% @! J6 A1 E3 r) N) K7 _
' G$ Q! h/ h' g U E
begin P_pick2 arriving6 I5 @/ l% a- C
set A_i to 11
2 E! i `' p, O7 c! v+ f* l move into Q_induct2, N2 |! \! n, H4 {2 i
move into pickaisle.induct2
1 d& G7 J& e6 B6 }( _ K; O5 T& J while A_i<=30 do begin$ @, m1 R! K5 q" g' [
travel to pickaisle.con(A_i)
% Q; `; {' @$ \# a2 p% G( X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: Q- S3 ]" R0 y( A2 @* e1 [
else wait for 10 sec
. P: y$ p8 g9 u( A1 p if A_i=A_leave then send to die+ Z4 M/ c2 `& o: {8 V" I
else inc A_i by 10 i" _9 r/ f& B2 H
end
- e: O, P' {. O& r! W- Uend
- H8 p& j- l$ A! ~( [0 w! ~' d
5 ?, Q' ?. G4 Obegin P_pick3 arriving* p4 t" x# N* K, r# I( Z, x
set A_i to 21& F- w% H3 s% \* @; ~/ e7 J
move into Q_induct3* D- J4 w5 j7 E& c1 R! P$ A
move into pickaisle.induct3
+ i% E! b) Z" E while A_i<=30 do begin3 f- {. e; R9 E, B: o2 c7 H" I
travel to pickaisle.con(A_i): E3 H0 l- a+ p% v3 d( w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* k) ]+ Q( U9 a# O, ^7 C else wait for 10 sec) k/ j3 L. q! {) F9 L( g, v5 ]
if A_i=A_leave then send to die# u% \6 G% U- `$ S4 {1 [( |8 g
else inc A_i by 1
, b! t- @8 z5 O& {2 ^# N' f# a end, G3 y) S$ |. F, @) f
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,其它按你的 ...
|