|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. ^7 b. N' |# i; c0 ~
, d. y5 p4 h; ^0 x) |* ~ Q$ |
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 e6 P' U+ E0 w7 f1 C" s: i' Q! W) N! t' |, q/ d+ H" G
begin P_read arriving9 S) z ^1 \& L# J
while 1=1 do begin" W6 G* j+ E- L, ~# W1 f% Z
read A_tote from "data.txt" with delimiter "\n"3 N/ K3 L0 \, X5 w1 o
read A_time from "data.txt" with delimiter "\n"
! u. E7 j0 P' {- B# M' {) ^5 Y; S% Z read A_leave from "data.txt" with delimiter "\n"
$ Q$ r' t0 W. y! z/ U5 J* P1 s/ d read A_picks from "data.txt" with delimiter "\n"
2 C/ ~6 S0 N% R) v) e set load type to A_tote
1 t; {7 H# L9 T% I# }4 O if A_tote="tote 1" then set A_induct to 1
$ a# A$ H3 }9 ] else if A_tote="tote 2" then set A_induct to 23 C" s- z9 @; A3 U1 P) l. C4 u
else set A_induct to 3
+ M8 |9 i) v' W$ \0 K$ X set A_i to 09 G$ f, `9 [8 s
clone 1 load to P_induction* Q, k' Y( d1 a; `# m0 [7 M
wait for A_time sec/ e$ r( u) }4 o u% s5 L
end1 x2 t/ ~" Y( j0 g
end
' |8 T: f+ k! D) ]. ~- N1 r) s# Y% M# l
begin P_induction arriving
6 a% |% Z# E H if A_induct=1 then clone 1 load to P_pick1
: S, a3 I. v! a. ^3 r+ h else if A_induct=2 then clone 1 load to P_pick2
& \3 o1 ?& u: l# _ else clone 1 load to P_pick3* F, [7 z, |! C6 e b3 d
end' Y( S( J* j, k6 X
% ?! O; p4 f- z6 q
begin P_pick1 arriving8 z( {) w* K% o, f7 @0 s, v* x
set A_i to 1, E+ J5 G+ Q4 Y) E0 G
move into Q_induct1
5 Y# T2 X5 |4 Q3 Z! w8 t5 S5 G move into pickaisle.induct1. O( C8 P/ f( @; [% b& h6 n5 F
while A_i<=30 do begin( u$ P, _6 x0 p n) e
travel to pickaisle.con(A_i)' j" m# Y3 x$ H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 X: Z0 V% {2 U else wait for 10 sec6 O/ J1 m n' b2 O9 |% ]: {
if A_i=A_leave then send to die
- H8 d4 s- A- e8 n$ z else inc A_i by 1
. l* O6 t8 g8 H( q2 W6 \ end; k- D& J& O$ H& d
end. | Z$ f v0 f; P) r
) J" H- K$ w& Z, Y* o) h5 }' F6 cbegin P_pick2 arriving0 n1 H- v! f( ]) L' j1 p
set A_i to 11
3 |9 B$ C2 X+ _+ ]! K: ^) Y move into Q_induct23 L( ]0 F- D J) v" ^
move into pickaisle.induct2
- o( l) n8 a' V4 H# N7 R" s- ? while A_i<=30 do begin
9 D0 g$ w+ M8 O4 v2 n o2 F& [ travel to pickaisle.con(A_i)( z& Q, K; A+ i5 t' {' j- ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 M7 r# Z, Q, H( k* h else wait for 10 sec2 l+ D" x0 d+ c9 B$ e6 {
if A_i=A_leave then send to die1 w: r3 K2 D% l5 j% z
else inc A_i by 1
3 G) a/ A6 C6 t( [8 E* C8 U end4 u! H; S6 C$ t9 i& c; _1 S
end: P2 [% O7 M2 V9 T7 k+ h9 j5 D
% e9 ]) v5 M+ D, V. Fbegin P_pick3 arriving
& I/ {, x; c( E6 G2 d set A_i to 21. T0 [5 s) F6 g" {
move into Q_induct3
2 V2 {* _, _4 d4 a$ B4 }9 j move into pickaisle.induct3+ h( t0 l" n4 I& ]" U5 o% Q E
while A_i<=30 do begin
. G8 n0 g' Q# Y4 d" X7 X travel to pickaisle.con(A_i)
$ m& j/ L( s6 Q6 A& `. r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ X! S! t- E: b/ i# |
else wait for 10 sec
. S' S# f9 {1 Y4 E2 I, l if A_i=A_leave then send to die- i0 A# D6 ~" G( P" S u
else inc A_i by 12 j3 Y% \5 B k+ G
end
- F r7 D* ~ C; b, o4 Uend |
最佳答案
查看完整内容
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,其它按你的 ...
|