|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, T1 Q# v( f! j2 G O5 @9 |" M' B$ e0 Y2 y8 H) z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。# d* r. Z' P6 f* @7 s0 m
+ }# K) o7 W2 F2 P4 L" D0 rbegin P_read arriving& e, b& e" e, o8 P; v$ N( c' m. X
while 1=1 do begin/ U/ N) h; _0 n! |+ {, `
read A_tote from "data.txt" with delimiter "\n") Q% G2 ~, P' n7 k! Q; b
read A_time from "data.txt" with delimiter "\n"+ F0 [- D* u8 L7 J6 I- B
read A_leave from "data.txt" with delimiter "\n"
0 s1 O, u: T: S1 I1 l, A/ `7 P$ }( T read A_picks from "data.txt" with delimiter "\n"5 @& m+ ~! z2 O" R
set load type to A_tote
5 C! E2 `! M$ J) x( ? B/ f, a' A if A_tote="tote 1" then set A_induct to 1
& _2 U8 y- F6 k4 O1 M else if A_tote="tote 2" then set A_induct to 2
7 H. S' B, E/ A3 w' q else set A_induct to 3
) r0 }( `; U! Q$ ~1 A9 K set A_i to 0
5 x) m) G" f' c9 Z5 [ clone 1 load to P_induction; x9 j$ l# C D2 z
wait for A_time sec
: \8 l6 A* l2 v end" y3 Z( B0 f0 X" L( m$ Y
end
7 ]- g- U0 L" h5 o1 _
9 }( u) {, K: k6 Wbegin P_induction arriving) F( X/ y, t7 j6 O: R* v
if A_induct=1 then clone 1 load to P_pick1/ ~* p; {0 w! I0 F
else if A_induct=2 then clone 1 load to P_pick2
/ t$ R% V. B5 w4 y else clone 1 load to P_pick30 a# J- t" i# @5 G
end. b4 }& G* c: R; Y" V3 P3 m+ A
5 s. `" r" [* l8 Bbegin P_pick1 arriving8 ]6 q" x5 Y( I2 H& T/ I6 I9 U
set A_i to 1, g* b, R8 L* w% a; L
move into Q_induct1
- J' n& a! u& f& m. M' I, h move into pickaisle.induct1" N# P* k# W U: y- C; `
while A_i<=30 do begin
9 r! Q3 ?5 `) L5 p- b9 ^! U3 i { travel to pickaisle.con(A_i)1 w9 [: b# `( W: t c6 t& V; ^! a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% j% v6 D$ l/ @/ x) c
else wait for 10 sec" A. ]: |* c+ Q3 h3 \
if A_i=A_leave then send to die
3 o5 T1 b) ]: y# X+ t else inc A_i by 1" w- H% d8 R% Y0 J; W5 |) Q
end4 J7 h/ t2 ?4 m
end) a2 D* b8 h. s$ r+ ?
9 L* k/ ?" D" N2 ]' K/ p+ w, T- [begin P_pick2 arriving
- ^/ B, A9 _) Q$ X3 ` set A_i to 11 l4 M, U% t4 r F' Y/ B. ]5 C8 }" _
move into Q_induct2
' X c( f# o/ ?: M7 | move into pickaisle.induct2
9 j2 o8 X$ B: `3 B* I/ [; E, b. Q while A_i<=30 do begin( ~' F1 J- G6 z) E" M
travel to pickaisle.con(A_i)
6 Y! ]% \# u: Y% k3 G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 N# e( v+ Q) N
else wait for 10 sec2 H% r% c+ i8 P$ W
if A_i=A_leave then send to die
- \ S# w' p, L! C9 b8 g+ M% T else inc A_i by 1$ C! G7 I' E' Q s1 e/ @3 w
end, j1 K; i7 k+ t
end
* O" [- \: c( H1 P) A; I2 b& b* U, l3 B S6 k. D8 n
begin P_pick3 arriving5 Q% X+ Y: w6 V9 O0 X! r
set A_i to 21( N: y+ _' G+ M
move into Q_induct30 J; a* h# M8 c1 P5 `5 @% \$ q
move into pickaisle.induct3
. D% g R0 |' d5 Z0 e while A_i<=30 do begin1 w2 [( s/ D" U3 d/ [" K
travel to pickaisle.con(A_i)
% U) O8 ]$ G5 Y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 z2 U$ L% T: Q2 ?( Y
else wait for 10 sec, i8 n# X, w E/ F
if A_i=A_leave then send to die
' ~+ @( D' }. c% t- I! ` else inc A_i by 1
+ y& I8 a5 n5 I7 U end
, J& ^# l6 n0 K. Zend |
最佳答案
查看完整内容
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,其它按你的 ...
|