|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) C2 u. l l, y1 m. q0 d
; [& n" F# @1 \我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% v# K* a8 v9 i8 V9 ^# n9 s
1 o# B) B2 m! b- ?9 H2 \4 o. U- xbegin P_read arriving
- \+ Y! w( B% z- U- K7 F9 B/ n while 1=1 do begin2 t( q$ h- @/ m
read A_tote from "data.txt" with delimiter "\n"* B; ?& t; s6 M' D! S
read A_time from "data.txt" with delimiter "\n"
- Z; ~+ q! t) A% |) b( q read A_leave from "data.txt" with delimiter "\n"4 ]1 U( y" g3 r6 j
read A_picks from "data.txt" with delimiter "\n"
8 X8 h! F" ?+ g0 U5 }* N set load type to A_tote& a+ m; o+ k) {# t
if A_tote="tote 1" then set A_induct to 1
5 V0 L' Q" n/ B3 @; ]9 Y9 _ else if A_tote="tote 2" then set A_induct to 2
0 A% p; D x, [7 E) l" o* Y else set A_induct to 3
: K, j5 m8 S7 [1 w7 L. n; V, E7 R set A_i to 0
( C9 e+ [% @" ~5 G+ G clone 1 load to P_induction1 w& d# D+ |% e1 k2 O7 r, |( H
wait for A_time sec- ~9 w3 W. A5 R/ n/ M
end& i7 g' d# H) f: o
end( U; y9 G [7 G% r( g% P
8 b7 [- |$ i0 ]4 c$ F( q
begin P_induction arriving
8 X; E& b/ [# j7 A! T if A_induct=1 then clone 1 load to P_pick1& F' f2 c. ?9 v; E
else if A_induct=2 then clone 1 load to P_pick29 s# L# M3 W1 w/ p1 M3 q P6 N
else clone 1 load to P_pick3
! V- \, g; n5 ~9 ] Lend
3 ~, O- X( H/ A& o( Y; s; T: k! v) Z0 K; x q6 D
begin P_pick1 arriving
, V; x- p' ^: L5 x! @' X i6 w set A_i to 1+ k' e& b7 U( ~ Z
move into Q_induct1' K H j5 w# b4 ^1 n2 j u
move into pickaisle.induct1
! ^! l4 }6 j% m2 a* P) \ while A_i<=30 do begin5 L1 p8 }# i. Z
travel to pickaisle.con(A_i)* P" w4 Z Q- p% k* m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 ~0 ~! q( h' w" { R+ Q else wait for 10 sec6 e& l2 m4 @; Q. I/ T& m
if A_i=A_leave then send to die
$ Z; g9 u5 `" f' z. L. P else inc A_i by 1
* J7 ~0 C' ]4 n' ] end8 L# \2 s7 T3 T3 M- |
end% T# t. t% |9 M* F! `. Y
7 ~) |1 v) C/ q% i6 M8 fbegin P_pick2 arriving
1 F7 K( k' P+ @5 d# C set A_i to 11
- t$ U& y' t) c. ? move into Q_induct2! x& T: p4 q* a. g
move into pickaisle.induct2
+ K d3 A- G" w$ \* x0 q while A_i<=30 do begin
1 n9 Y( \; L% [! X0 B4 z travel to pickaisle.con(A_i)# u5 \* c1 x( W1 ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 E6 ?( R# P$ z( ~0 V
else wait for 10 sec$ p! n% x/ S6 T# I& A
if A_i=A_leave then send to die
1 ?% `" q) _. A/ o else inc A_i by 14 c; c: Z# q1 e2 Q9 m
end* u) B6 }: `" l% ^7 g6 o
end
4 i, O3 |5 d; f5 T" B( M9 b+ G1 \2 M$ B1 n' h. T, {
begin P_pick3 arriving& n/ Q3 u9 Z0 a5 |
set A_i to 214 d, U9 P/ z \2 W, o2 M( S
move into Q_induct3( v- w' E. m1 I8 Y0 O
move into pickaisle.induct3
& X$ l7 C8 O$ I2 L: F) O* U while A_i<=30 do begin" h$ s; H7 w' S% f# g4 }. ]# |2 f
travel to pickaisle.con(A_i)
# ^( P Q+ y f" E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& G9 c8 c( D3 n8 t else wait for 10 sec
5 \6 V l) A* y' t4 } if A_i=A_leave then send to die
4 G, Q" l5 v; k else inc A_i by 1
2 m+ H! _) s1 ^! ` end
: `: g- ~$ r% t F) q0 `" Rend |
最佳答案
查看完整内容
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,其它按你的 ...
|