|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 F1 {4 i e6 N9 G- ^! [
7 ]0 K& A7 g) H1 w- b0 p; |1 r5 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中的数值,不知道会不会有什么不妥。
+ J6 N4 ^) o- j$ h J7 F
) I9 J% U/ h( M5 Ybegin P_read arriving6 Z2 P G/ ~9 E7 p1 Z) s
while 1=1 do begin: z0 j" d0 S! x4 f% l
read A_tote from "data.txt" with delimiter "\n"+ S7 C6 F# w% i# q0 e2 _
read A_time from "data.txt" with delimiter "\n") [' R( m# t' W% f& S
read A_leave from "data.txt" with delimiter "\n", s; @% |" I: a, |* Q8 t
read A_picks from "data.txt" with delimiter "\n"& E, {, c+ J+ l% U
set load type to A_tote
( I3 ~- w4 }' C0 k7 v; O! K/ U if A_tote="tote 1" then set A_induct to 1
4 p0 y1 |/ [4 {# s0 m/ t; y4 u else if A_tote="tote 2" then set A_induct to 2
: U) b0 u: W$ k: X' K8 b else set A_induct to 3 , {+ L. Q8 L. i m/ \
set A_i to 0& G6 | t1 P7 e7 b7 J. a* N
clone 1 load to P_induction
. Y! z' V4 p- P% H. [ wait for A_time sec: Q: ^! n& t4 M! n" P' T
end
6 k+ v8 W* @$ A% iend
5 S& e' p, N+ y; E+ Z' ?
7 z' V3 a; e* |" A! R! P6 P8 \begin P_induction arriving
- u$ } @5 L |! Y if A_induct=1 then clone 1 load to P_pick1
# b0 {. z4 T3 c% p else if A_induct=2 then clone 1 load to P_pick21 J/ T3 s9 i+ _' n
else clone 1 load to P_pick3, M- ^% `9 o5 U4 E- a `
end; O4 `9 q1 N- ~
3 t! a6 W9 L! G2 d/ dbegin P_pick1 arriving( D6 Y$ @" y1 H
set A_i to 1
& j% c8 ` l0 P7 b- _9 n& H( t move into Q_induct1
+ A0 C* Y3 j; i' \% q4 u1 e move into pickaisle.induct1
) O5 u" v, d5 X H" U! V: f- Y while A_i<=30 do begin
) I& r0 X O# \. ~2 N. x7 l$ ^ travel to pickaisle.con(A_i)3 C2 a4 p% B# t0 u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, A/ y5 L, s- G4 U4 x8 Z2 C else wait for 10 sec
1 q; t- Q x0 g if A_i=A_leave then send to die \4 b2 s) I' {9 g7 ]) ^6 t2 R, n
else inc A_i by 1, t; ~4 E6 c x; ^
end
8 w( v0 O4 V2 z4 b, T, z) s* Yend
, S3 T) ]$ I j4 ]6 w0 }0 H
5 w, v* g8 U" Gbegin P_pick2 arriving# e9 `- Y% n6 j+ G7 q- ]
set A_i to 11# ^- v9 X# Y# U/ w- A! ^- c
move into Q_induct2" A8 @8 d& B' [: b
move into pickaisle.induct2( n% M0 G# R) l/ f* s6 j
while A_i<=30 do begin
$ O2 b1 v/ ^4 ?& W3 R6 r travel to pickaisle.con(A_i)
; z0 z4 x, C. k9 x$ ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ V' R9 J2 C# B9 l
else wait for 10 sec- W; q, E+ @8 }: X7 }
if A_i=A_leave then send to die& N9 n& Q5 l# {1 r+ d
else inc A_i by 11 j9 Y: Q3 ^1 [) Z8 S7 T9 i. f
end
+ i( z# R* g" ?' L% t6 Kend3 a4 C+ S. S/ r+ [' B
8 |- O$ U* N% I# P: A% ]; V6 lbegin P_pick3 arriving/ ]" x1 x/ [* K: }
set A_i to 21
" L# K4 z- z4 A0 b- L: w move into Q_induct3; B" }$ I/ o1 T
move into pickaisle.induct3
3 O' M5 V I2 B$ N! w while A_i<=30 do begin) H( j h/ j1 O
travel to pickaisle.con(A_i)% R7 S, ^. h( s; [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( L( A$ `) Y* k( A, S# P else wait for 10 sec
: B; n+ `8 _5 e if A_i=A_leave then send to die
9 D& v V% f/ Y/ `& |3 T else inc A_i by 1
4 v# z' q- _6 n( X end! p7 {8 I# A6 ~8 H4 t X+ i- n2 w5 _
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,其它按你的 ...
|