|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: {: B- h- C- E4 Y7 n* ?4 \+ d! U) c
我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 z5 _6 M' q4 h5 X' ^
* Z+ Z* [6 o5 f1 Y
begin P_read arriving
2 A4 _5 D! `. f. C while 1=1 do begin& i# ^; K' h6 k
read A_tote from "data.txt" with delimiter "\n"
1 Y9 U# ~3 o8 w7 p! r8 C" ~* _1 ~ read A_time from "data.txt" with delimiter "\n" m) g% { q! |' O, I
read A_leave from "data.txt" with delimiter "\n"
4 Z* g: U: L0 {- j read A_picks from "data.txt" with delimiter "\n"# p& q0 h/ b; M
set load type to A_tote
+ G" l# N; D/ _3 K3 h# }: ]+ y9 ` if A_tote="tote 1" then set A_induct to 1
! ?. g# ?' ^) u else if A_tote="tote 2" then set A_induct to 23 N6 a7 Y8 u$ u7 ~
else set A_induct to 3
3 D* b H) } Q6 N- d set A_i to 0
8 @) ^. Y' j' v8 C B$ P2 S; i clone 1 load to P_induction, t. {4 c8 A! U k. G& w
wait for A_time sec9 m+ p" U. {: r4 N) a& X6 u
end
1 {- ^/ @( ]% ^7 Fend
0 \0 X4 b z: x) _* k4 N5 o! [3 y) ]) x' `+ @, m* c$ P
begin P_induction arriving' o) s [$ M2 J5 z6 a. q% m. N
if A_induct=1 then clone 1 load to P_pick13 M: P' W/ e+ y, g" L) I5 G0 q% e4 Z
else if A_induct=2 then clone 1 load to P_pick27 B( v8 L( K- A E- Y' ~
else clone 1 load to P_pick36 r5 a7 `. B$ x- S% ?# N
end/ w3 a2 K0 n1 ], v4 B! m7 a+ x
9 D4 q9 r- Y' N) }# t
begin P_pick1 arriving
/ `9 V# c6 X' {/ Y A set A_i to 1" e& L0 a: z5 _# ]# o
move into Q_induct1
1 U& Q1 x0 H Q% ? move into pickaisle.induct1
$ ?+ l/ \6 _' e. m3 ^ while A_i<=30 do begin0 o9 z5 J" k% [* b" {* u4 b
travel to pickaisle.con(A_i)
) u8 X( X- F4 c. j$ ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. P! L3 I7 k1 W) k/ r
else wait for 10 sec5 B/ @5 F8 S2 K* f' g5 O1 m d" R
if A_i=A_leave then send to die
" ]* N- `( D3 {: x else inc A_i by 1
! R! c3 M# I( d: i8 k/ ^ D" s0 ] end0 x3 H0 A1 y/ P7 z
end( V E) w) T8 }% {' T% n$ S x; D
% l) K% W8 L9 j# V9 y
begin P_pick2 arriving
% [ M* ]1 X2 j [# O6 B set A_i to 11% w3 s- N3 y$ m! r$ [: d
move into Q_induct2
# @ l* t6 K0 s( V. K move into pickaisle.induct24 w W- M, Y w/ v- b
while A_i<=30 do begin! h) R( h# u8 K3 [
travel to pickaisle.con(A_i)4 y! D" Q* r7 [; H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 P1 ]9 ~9 g6 [ e6 z
else wait for 10 sec
, n, S0 k" Z. {% J/ h; f if A_i=A_leave then send to die
1 R: i0 q8 X9 ~8 T5 r else inc A_i by 1
* S0 B" _1 t' F. E end
" n. R; m/ @2 Mend4 v$ G9 Q8 D/ p2 A
, p& X9 }* A+ }8 }begin P_pick3 arriving
) B$ e& }; j, r- g set A_i to 21
% o$ U8 g( ?. X, g' J/ T } move into Q_induct3
5 {- \7 q9 \. i9 Y! B: k9 W/ m move into pickaisle.induct3
4 U. ?* n4 m: k+ T while A_i<=30 do begin
6 d0 Y$ d. d1 Z! m1 b/ G travel to pickaisle.con(A_i)
/ ~) K4 A2 _6 p/ U* O% p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 m" N& C$ d" y! j1 r9 P& P else wait for 10 sec
8 D$ z% s$ { o, }' w' H, \6 m if A_i=A_leave then send to die
% j D( ]6 X4 b5 x else inc A_i by 16 U- N* p" x6 `& d5 d
end& J- E: \+ [6 u5 V5 s
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,其它按你的 ...
|