|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 _4 B8 T6 o3 T/ j7 A, d- h5 b5 |1 F9 M" V
我的问题是,在每个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 r$ p+ Y5 O \- Z, G3 G8 g1 @2 p6 x" c. S8 {+ V& e
begin P_read arriving
3 j! I( w* O! X/ m0 t4 c while 1=1 do begin# ]: |( W- F- x& L2 E
read A_tote from "data.txt" with delimiter "\n"
, r) }* S7 D. Q1 U. j read A_time from "data.txt" with delimiter "\n"# `2 T: I; u& j
read A_leave from "data.txt" with delimiter "\n". ]6 B) W7 Y2 H% T' E
read A_picks from "data.txt" with delimiter "\n"9 L0 O, c4 N7 `
set load type to A_tote
' I' n1 u8 Z+ \ if A_tote="tote 1" then set A_induct to 1. |/ _* q9 W6 Y! v& ^) w, o
else if A_tote="tote 2" then set A_induct to 23 P6 e" [% }; G9 l' J
else set A_induct to 3 7 x7 Z* {" l. d6 t
set A_i to 0
2 h6 ?6 E- e6 O/ T6 [ clone 1 load to P_induction% `. S o* W! `# g
wait for A_time sec3 e6 y/ Y7 y# b
end
1 E( o, _3 |* c# oend
9 B1 a" X0 C0 R4 A, u6 E3 H0 w% E- R4 S, R- }
begin P_induction arriving
% O! H7 ?* I& P if A_induct=1 then clone 1 load to P_pick1* z3 Y4 O- ?8 n5 a
else if A_induct=2 then clone 1 load to P_pick2
. j# T5 W0 i4 f5 A6 y6 P else clone 1 load to P_pick3
4 {: j: s; \. h6 G5 ~+ }: mend
T+ D+ `" k$ t3 ?, Q+ T" m( ?: J- b( \; O( i
begin P_pick1 arriving* t7 L5 s& i) S- a
set A_i to 1
% Q2 }* a$ n6 Q" ` move into Q_induct1
4 ?6 A: ~* w( f# E) v move into pickaisle.induct1( [6 ~6 W6 [6 D- _1 [
while A_i<=30 do begin
8 X! {% I3 R% b4 x3 f* _5 j) T2 ]0 n travel to pickaisle.con(A_i)
2 `: O6 x m- Y" T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ n% t' c* P0 _
else wait for 10 sec( j, A: T9 i, c! m* l, l
if A_i=A_leave then send to die
! w6 g* V1 M i$ s- ? l else inc A_i by 14 j& b( l" `( k( b
end. t& n/ D! {, `$ J& z; u( P+ U
end
0 Q7 J) A0 Y$ q6 Y4 F2 s3 i0 ?. b2 C( r" \) J" q
begin P_pick2 arriving
! p8 m$ k8 b+ j- z set A_i to 11
8 s# u( }; _6 G" v move into Q_induct2
6 u0 ^( Z( u& l7 A) ~/ h9 i. a move into pickaisle.induct2( G, m8 e4 D, A$ x0 C _2 J) R8 i
while A_i<=30 do begin
. t3 x/ Z0 q3 O' ]/ W1 Y0 u travel to pickaisle.con(A_i)0 k( ~' x2 {; u, |( p* b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, t' X& O0 Y3 f( p W, l% C
else wait for 10 sec
) a! X0 W' r' a3 h5 W3 G if A_i=A_leave then send to die
2 t8 _$ U1 A4 R else inc A_i by 1, d0 `( e1 Z- e% v* o9 L
end6 _; W8 y" G: W, z5 k d
end3 |" F1 @" z2 `1 e0 O" H
+ `# P8 I* W# c v# f& {' }& @; s
begin P_pick3 arriving0 G) }5 @* o8 J. q+ A; z2 n
set A_i to 21) p/ m3 R# S$ I! f ~* f/ y; e
move into Q_induct3
( r# E, x- n5 d9 e# \( p% S* t* L move into pickaisle.induct3
1 S$ q2 O, ]1 @. _# s! ~* E' X while A_i<=30 do begin
# J! z3 U" Q8 g/ X travel to pickaisle.con(A_i)
+ s) `$ r4 b5 l( u6 L# Y5 L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ A9 Q6 H) q3 g1 G1 p
else wait for 10 sec
+ M q$ E$ S( m4 W& ~' R5 y if A_i=A_leave then send to die: ?) |. A& x& k; V* C
else inc A_i by 1* j, |: j: G# a F
end
+ r7 y8 n0 W8 ]$ }" p% xend |
最佳答案
查看完整内容
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,其它按你的 ...
|