|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ z, G7 M8 e" L# f# w; a* u. Q/ ^# ^# I$ f7 l3 A
我的问题是,在每个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* k8 e* P6 I1 q) y$ e% a1 `, R. e/ n
begin P_read arriving
) l; f; N5 h F+ I0 c, i0 d while 1=1 do begin
& g! k/ T' W; ?4 F& T/ s% E3 D read A_tote from "data.txt" with delimiter "\n"4 S9 _& J% v9 a' @/ L! j
read A_time from "data.txt" with delimiter "\n"
! e g( f) m6 j read A_leave from "data.txt" with delimiter "\n"
8 t. ?5 j U) H: X- J read A_picks from "data.txt" with delimiter "\n"! C8 R" A4 U, {0 C7 M0 n+ f) s
set load type to A_tote: F0 U" p7 C8 z, b5 i4 Y! n
if A_tote="tote 1" then set A_induct to 1
0 y' B X$ K+ w0 V else if A_tote="tote 2" then set A_induct to 2" ]. p: R* M& n8 e$ A2 N
else set A_induct to 3 2 o' D( h: Y2 `6 Y" ^7 D6 `3 q
set A_i to 0
2 i" u8 Q0 X- ^" ? M clone 1 load to P_induction) D' t# o: u9 J) S) |' H
wait for A_time sec* D5 @, w, J8 e4 C
end0 D" h# d& w3 ]2 o8 u- V _
end
* ~6 |& i& z# Q% j5 C0 q4 q' e+ x. U% N; ^' a& V& K+ B B: E8 ^
begin P_induction arriving% t) F& ^' z' B6 Y6 q: z% n
if A_induct=1 then clone 1 load to P_pick1
/ i% p8 p& T1 \; x9 f else if A_induct=2 then clone 1 load to P_pick2
: X! H/ \2 R- Z else clone 1 load to P_pick3
: t: {# H; [, ^, H& pend
" ]* A) B$ t. [ W' c% v6 C$ q. Z' r
begin P_pick1 arriving$ x' p" A: T. u, o: l% D
set A_i to 1
. G: A* X! \1 ]5 R7 c) m move into Q_induct1( E7 C( O, A" W, s3 Q+ a" F
move into pickaisle.induct1
6 E( [* b& W; O# j0 D; \ while A_i<=30 do begin% ~, i7 K& }; x$ C$ A3 ~- }+ L
travel to pickaisle.con(A_i)
. H* l# ]4 e9 I+ K3 L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. k- p0 K9 O" q else wait for 10 sec
/ F+ t" @' ^. M/ h' k if A_i=A_leave then send to die* u H0 C, |/ w) d2 j6 W5 [
else inc A_i by 10 M. F5 W, E/ @1 `, w
end" r+ ~- K9 V# K0 J v- y& W
end
+ y$ h5 ^: G+ G& N% a* D/ I5 q* b: s* {6 I# w5 Z3 p! L4 x
begin P_pick2 arriving
3 n) d. }1 x! U4 s set A_i to 11
* d- T1 f- t9 J w$ w, G" a* j move into Q_induct21 N% {$ c4 ~$ k: `+ O) s; H
move into pickaisle.induct27 x; U" |8 w1 q) x
while A_i<=30 do begin
& O) ~3 @4 c* x: \0 O travel to pickaisle.con(A_i)
" j) a8 f. Z9 W1 y3 G1 E x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. I7 [% E4 k/ L; M0 [
else wait for 10 sec
) b5 U2 @* r* A1 N! o if A_i=A_leave then send to die
) s& }8 p4 v$ @) y- l; c% o! e else inc A_i by 1
/ J; H2 j8 c( P1 q. H# @, L) l end
5 z, t9 P$ [3 bend5 b& i& h' m# g9 v% i
9 |: N, B: L7 T# C. O
begin P_pick3 arriving: d9 @+ p4 b- s' J, b
set A_i to 21
7 l* {) q! Z+ v$ v: Q/ K move into Q_induct3. G K5 T. n s& J3 R
move into pickaisle.induct3% m1 c# S* O1 T, L" M0 d: J+ e9 r
while A_i<=30 do begin
4 e& J1 @& G+ S8 x, H5 n travel to pickaisle.con(A_i)
9 f+ i0 {2 V6 q' F4 y3 J8 U1 R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- {8 J$ }5 }) w4 W- |
else wait for 10 sec! j4 Z2 Q- C! i w$ `7 i1 _
if A_i=A_leave then send to die
& D: _. n9 A: K& g5 P3 N else inc A_i by 1
" b/ C; g% f I& Y2 j end; M( u( w5 G( e; `, |! ^6 x9 @* V) Y
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,其它按你的 ...
|