|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 F' `" g0 ^8 K, K
0 G4 A& W3 ~3 s我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! R( F/ D6 c/ O0 P% |1 m# j( y$ _* Q! }; N
begin P_read arriving
{( K4 q4 N5 h; o while 1=1 do begin
/ F4 c" `$ Y f read A_tote from "data.txt" with delimiter "\n"
: ^ F$ e7 p% ?- h- v) [ read A_time from "data.txt" with delimiter "\n"2 @7 q. i: U7 P5 I# h* D1 l
read A_leave from "data.txt" with delimiter "\n"5 Z6 @4 Z; K+ \3 K- U9 [
read A_picks from "data.txt" with delimiter "\n"2 l8 v4 ^4 ^* ~- X4 E
set load type to A_tote% x7 V ~! c" v" b9 y' n9 }$ N
if A_tote="tote 1" then set A_induct to 1
& j3 N; d8 c& I+ ?* d else if A_tote="tote 2" then set A_induct to 2
" D: F& U h1 R) v; Z0 y! `7 p else set A_induct to 3 # X; E% |8 ~. R% M9 A$ x& [
set A_i to 0
# i: V1 u& b+ `% I+ R+ m# L( T clone 1 load to P_induction( p$ x9 ~' o: {) y" c4 y k
wait for A_time sec2 B# ^9 l3 N7 V9 Y( _) p# T g
end/ q9 z: o. K* R
end
9 @0 u: j& v8 M$ h, X. ?( N
# f0 o/ m6 a ~begin P_induction arriving! i8 m) \7 |! f' E
if A_induct=1 then clone 1 load to P_pick1/ G' _. y: a7 L/ m
else if A_induct=2 then clone 1 load to P_pick2+ w6 ~2 a+ C7 ^2 _3 Y: `+ m- a ~2 `
else clone 1 load to P_pick3
" _- x3 b! ]2 Nend
. c7 l/ x. C+ U4 ~6 _* [ U1 J* x/ A# }% w. `# L4 ~. \# A7 }% g
begin P_pick1 arriving
% a w, j) E5 y& k* J set A_i to 1- M7 J0 e- f: N
move into Q_induct1
5 s; B" ~7 ^9 w) ~/ y' { move into pickaisle.induct18 i, E# h0 L, a4 M7 K( o, }0 j: I1 @) E
while A_i<=30 do begin# d& [( {$ [0 |& K2 r4 y' c; d4 z
travel to pickaisle.con(A_i)
: t" I3 p( C+ { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ ?1 v6 Q; {8 S U. b3 O) W else wait for 10 sec. U+ L4 _" |* @) D
if A_i=A_leave then send to die+ P/ h+ Q2 A" E8 Z C a
else inc A_i by 18 I5 a" P; n6 `8 u1 W
end
4 f# h! v3 A/ jend* d8 Q+ G* A) L' } l
9 \- `5 M H( ^; ?/ b y
begin P_pick2 arriving% V! _5 E7 D7 `$ A) }$ |
set A_i to 11 U1 U- G. _2 [2 B0 b0 a+ l) O
move into Q_induct2
$ D0 F# z8 p, _: U: K move into pickaisle.induct2# u8 z; U z: T/ f7 O L8 Y
while A_i<=30 do begin
+ r( T, [% {8 b- Z T/ X: _* N travel to pickaisle.con(A_i)1 X% S& c) W! j1 {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ L1 C% ^( Q- f$ O" W( D7 |
else wait for 10 sec
7 R& c0 @- ^$ A7 L0 X2 |9 d a: Q4 F if A_i=A_leave then send to die
# R; ]9 _: r+ U else inc A_i by 1
% }( m) @5 u3 Y4 ~+ i end
2 N; ]/ b" a/ J. l8 aend+ O$ n7 g2 X c8 o7 N
1 H+ U7 n: m8 b7 P( |2 E
begin P_pick3 arriving: Y" |, Q( p/ n! Q. O
set A_i to 21) ^* M' L [7 y, C8 {8 g6 N$ V
move into Q_induct3
7 l& e9 H* Q) ?9 A) N* Q e* w& [% ] move into pickaisle.induct3 z% _5 p) N; c3 }6 f- w
while A_i<=30 do begin+ v& F; q6 i, L0 Y
travel to pickaisle.con(A_i)
, q7 ^6 N- Y- }$ O( V4 x6 N$ \4 c! ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* }- Q6 x; Q( h( E$ f( |& y else wait for 10 sec! W/ O. y" Z& L: q9 D* M5 D
if A_i=A_leave then send to die
7 a$ h# _# U' F% G% w8 p else inc A_i by 1
9 Y4 i7 K. y' L. Y- {, R end1 E5 M5 f, Z U; e+ B! U* k
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,其它按你的 ...
|