|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 t; }9 |8 ~2 ^3 m2 C
' L" {+ }$ C, L我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 ^/ m1 G4 T, x# P3 K2 V
4 n B+ {* x% \begin P_read arriving
, m+ Y5 T% D5 w K while 1=1 do begin
( a) b H/ _# P8 B: Y) ? read A_tote from "data.txt" with delimiter "\n"# \& @! y$ y# j5 l6 Y& C; F
read A_time from "data.txt" with delimiter "\n"( {% e Y$ `8 p( E/ h9 s
read A_leave from "data.txt" with delimiter "\n"
9 R Z5 L: l: @* w" p read A_picks from "data.txt" with delimiter "\n"8 ^+ c7 _1 a7 f, L& E- S% O3 @ Q
set load type to A_tote- h; J- P- V* c( P1 l) `
if A_tote="tote 1" then set A_induct to 1
/ P o9 x; u& y) j+ X9 Q5 h8 ?9 B# w, M else if A_tote="tote 2" then set A_induct to 2) r( i1 f: \: n. H
else set A_induct to 3
: Z' f2 S$ |' j) }/ s) P' f set A_i to 01 |4 L: b, @2 D" r
clone 1 load to P_induction% n$ C) T& r# S! ?; `+ _4 f$ B
wait for A_time sec
h3 J% r* S+ M P: N- G8 g end. y% Z+ t0 t4 _" o! b! X- l: p, S- e
end. p- @2 n1 H1 E. l2 P$ ~
9 I1 [, \2 G2 r" \) i
begin P_induction arriving) K x+ ~% C) Z4 R% O; B0 f* {9 f' ?
if A_induct=1 then clone 1 load to P_pick1
/ P6 S8 {/ d \* ^% }. n else if A_induct=2 then clone 1 load to P_pick2/ ~- Q6 R$ ~: ~5 M% }/ L6 _
else clone 1 load to P_pick3
: k+ t# ` i2 Q9 |( C0 dend
, y# Y7 w, O: Z$ x+ W8 u5 F6 n
8 C( S' V; X: y, kbegin P_pick1 arriving
. W- b7 Y. |; t) s, v set A_i to 1
/ }9 a' W& z8 i9 {, Q/ L% j move into Q_induct1
9 O5 B, m8 N* @; M" J* v& S move into pickaisle.induct1
5 g, v7 i1 k% u" o6 Y5 a1 E0 S while A_i<=30 do begin
/ J4 ^+ j* G$ S. r C travel to pickaisle.con(A_i)
& J, `% ~) f6 s/ V0 i8 | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 Y S: v3 g; m else wait for 10 sec
9 Z8 [" x9 m# P/ l. E if A_i=A_leave then send to die( ^. B5 ] j. r3 r% K
else inc A_i by 1. X5 n7 I3 n9 h9 p
end) r% A4 x& B/ Q) o9 j, k
end
3 P6 K2 o1 F% p( ~
, w$ o3 l8 [" E9 y! bbegin P_pick2 arriving
2 Q/ c' R9 Z1 f- S. j8 K set A_i to 11! R' T" M J8 j) Q
move into Q_induct2
* t+ W$ |! [# \, j$ c move into pickaisle.induct2. h& j4 K8 H# j! S' t' ^
while A_i<=30 do begin
' t9 O0 Q: P* g/ Q$ D travel to pickaisle.con(A_i)- K# u+ C/ I7 m; q5 I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' z/ T" x4 Z. d( y. x% K0 o else wait for 10 sec
1 {5 u4 {8 _ ] if A_i=A_leave then send to die# m0 p$ S! H8 ]% z
else inc A_i by 1. B. }+ b/ l% ?& S; N
end2 |7 p& ~' p9 ^; P# J3 C' `
end: V6 s* t. h. h
- P/ B, L/ l* z( t/ i- jbegin P_pick3 arriving# n; L5 |+ @5 n0 G' i
set A_i to 21+ L2 s+ S( _1 }) D# ?* |9 R
move into Q_induct3% e% F2 o2 y- m9 L% q# q4 k( a' q
move into pickaisle.induct3: V8 m# k- u9 y& T
while A_i<=30 do begin: a' J# _4 O: x9 J7 m1 c1 {. i3 p
travel to pickaisle.con(A_i)
: {) U) {+ Q. W7 m! P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 w% u" @( A2 P4 x. u. d else wait for 10 sec
4 T i3 S F% x; v+ d if A_i=A_leave then send to die3 E2 w# w# C0 f a
else inc A_i by 1
, c6 i- N' G1 ], Y j5 C end
. |) p8 h8 J7 {9 @5 B0 q% [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,其它按你的 ...
|