|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* q4 n. L3 D7 V% H& Q& p0 l
4 Q; }( m% ^) ~我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ e; }9 O' Z9 l' T$ j
}! O* M9 ^, {$ Q
begin P_read arriving/ b% W3 R0 c# n6 I+ [, E6 Z# d$ q
while 1=1 do begin. F* B4 j D+ l( i
read A_tote from "data.txt" with delimiter "\n"
5 M) W5 h; }* @7 N5 ] read A_time from "data.txt" with delimiter "\n"# i( S% R6 E! ]
read A_leave from "data.txt" with delimiter "\n"
# z* f# a3 D+ Z. x6 Y1 Y2 Z* Q$ B read A_picks from "data.txt" with delimiter "\n"6 {7 P# m- \8 W) ^; x5 c0 H B
set load type to A_tote5 j- b% T7 U3 A% q$ B% E) n
if A_tote="tote 1" then set A_induct to 1
! ?2 S- ^" k% X0 q& |6 N else if A_tote="tote 2" then set A_induct to 2% Z1 j4 ?! ^1 ?8 T, o
else set A_induct to 3
# n; y3 Z5 y' _1 H+ g3 o# q. k set A_i to 08 J8 V/ y& Y9 j6 H4 f, Z" w9 O
clone 1 load to P_induction) p) S" X% \* i( u) g" _
wait for A_time sec1 d2 _! z& l; A/ h7 R
end
. q0 s5 ?0 r" E/ cend5 L( o1 `0 ~" D+ L. ^& |
4 E: _5 I5 R: v2 T
begin P_induction arriving
' A- k, Y: k0 g, j5 G if A_induct=1 then clone 1 load to P_pick11 n) w* }! {, q' [6 z) ?4 J
else if A_induct=2 then clone 1 load to P_pick2
2 ^) M5 I0 ?* n$ e9 f" a e9 l' r% w else clone 1 load to P_pick3$ |; o/ ]% u1 }: s6 x* e! Y5 D
end9 h$ l" g* C! J; C& N% J+ D) q
. R) }3 z: ~+ Tbegin P_pick1 arriving) s1 v2 {5 v, x7 T1 M& j, I
set A_i to 1
- X( V. k' ~1 L9 @. T5 P move into Q_induct1+ l8 R, i; G! |& y8 [9 V5 M* \; L! M
move into pickaisle.induct1- m4 O" V& q" Z" N. `+ t
while A_i<=30 do begin
( _( y& Q0 m! ]$ V travel to pickaisle.con(A_i)/ N, y. s+ p2 D- Z' S' x9 @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 Y- G' _$ K4 }' ~2 T! }
else wait for 10 sec, i4 `' _6 o9 b" U+ n
if A_i=A_leave then send to die% }( F8 Z- ?2 q0 ?- z7 T5 y2 v6 g+ V
else inc A_i by 1
9 R' c5 Q/ E2 z end
# k+ e( h# `- f0 v, jend& f: a8 T4 N0 Q7 e5 S/ U4 O! L
% h1 C3 u( W) C+ R
begin P_pick2 arriving
9 S d! |2 U- @$ k" l set A_i to 11
/ ^# U; g2 r% Q9 ]8 ^% s1 p move into Q_induct2: N c2 U* J8 G B i
move into pickaisle.induct2
. _3 p& L& @- { while A_i<=30 do begin
1 i6 K+ |6 Z# C, f0 U1 B$ y( m+ F2 f0 n travel to pickaisle.con(A_i)
) g. P2 n! }, h, [) Y$ w if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
i8 \. D" \; B) i else wait for 10 sec
" O/ s7 Q: U" ~9 `# p, g if A_i=A_leave then send to die
9 t5 V, X7 L3 Y: m" ^$ W8 M W0 y, o else inc A_i by 1
: m! s, O2 E0 X1 j: t end
1 Z" i$ [0 e2 N% G" g5 H3 Kend7 O1 e u% k0 P8 s3 N# a: w
0 o2 R6 [; I4 n, F: B# ^6 xbegin P_pick3 arriving4 \ i- ] M5 a$ ^ O
set A_i to 21% D. K$ P, U3 n% b: z
move into Q_induct3
: q! J, y T+ p8 j( c: u move into pickaisle.induct33 R' |$ r; s- o
while A_i<=30 do begin
/ i- Q! |: S$ Y. l travel to pickaisle.con(A_i): @1 R6 W3 ]7 ?1 s4 O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 l! Z- [( p/ q: f4 z* ~+ o0 @ R
else wait for 10 sec
1 ] q4 n4 e9 e2 r& H5 G if A_i=A_leave then send to die
3 b! m' Y! u& C else inc A_i by 1
2 m% \. h+ z$ a7 g1 T end. r) d: [: b$ @& |3 d* p) |
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,其它按你的 ...
|