|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, @; v1 c% T4 p' s9 X/ I8 @) ?' b& B6 |( `% U% ?+ E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 R+ z- m4 i6 c }& ^
% K4 E& n, l- c9 u! xbegin P_read arriving
% a3 W1 Z/ u: \0 h' k, [( X! Z2 m while 1=1 do begin
6 H3 w6 ?( A" E! k1 ~2 H read A_tote from "data.txt" with delimiter "\n"0 @6 {, b S" a) O' W! L
read A_time from "data.txt" with delimiter "\n"
3 z! X0 C6 ?$ R0 H. b6 L read A_leave from "data.txt" with delimiter "\n"! ?4 r& d* V3 w3 w/ @
read A_picks from "data.txt" with delimiter "\n"# D8 R9 y' o: k8 {) W) t
set load type to A_tote8 o' @& r* r0 p# M
if A_tote="tote 1" then set A_induct to 1" S. z, z) q' Q) y; v! L
else if A_tote="tote 2" then set A_induct to 2+ b- K. {6 ]& I/ s* z- D
else set A_induct to 3
5 s* O0 a- O1 @: X. ]' X2 D set A_i to 0& t- }7 u m) |0 e
clone 1 load to P_induction- @& Y/ ~; X* @( W$ E
wait for A_time sec# |: Q1 J; g- G3 a
end# ?7 v9 {9 j: x3 v d, `
end
M: G `2 |* H- y% n: D7 E( y' A
) O& q" j4 K1 cbegin P_induction arriving- R6 ~: n: K: p3 F; q
if A_induct=1 then clone 1 load to P_pick1
/ f, K! U0 ^9 x9 {% _) G else if A_induct=2 then clone 1 load to P_pick2
( s0 y& R: X2 p' {9 B) q else clone 1 load to P_pick3
' g* W* p8 `# |+ I h& \# Yend
8 J( e, w) A9 n% j) x% p/ @" L
begin P_pick1 arriving
- ]3 J' w2 F7 X! h7 n set A_i to 1& V5 s' q6 \* i' L' D# d* n4 O/ S
move into Q_induct1
6 K, v2 J/ l4 V8 h( Q6 m move into pickaisle.induct1
7 b" } P2 U0 o) | m- d" s while A_i<=30 do begin
; R, k* ^- r5 G6 t8 w travel to pickaisle.con(A_i)
+ v, d; S& u# W. M2 [( }( i7 | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
P) y/ Q( L# E% L else wait for 10 sec
, u/ h5 {, S0 _* c# ^! J, \6 Z if A_i=A_leave then send to die- ?2 }& @; ] K4 M7 S; r, c
else inc A_i by 1- Q; M* p$ E$ L: O7 z' T3 ?
end
/ f" F$ Q7 @. G' lend, ~8 M9 J. q& C& Z1 f
" k9 @9 ?% |7 y5 C X- k0 {begin P_pick2 arriving
' h$ v J' _8 _; L: b set A_i to 11
5 K. Y; R) J6 Y- W move into Q_induct2
) c* l4 v! Y% ? f move into pickaisle.induct2
. g. J3 e4 I! w% ?! b! ^ while A_i<=30 do begin3 p6 \1 Q# h) o/ o
travel to pickaisle.con(A_i)+ A8 I+ n7 L+ E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* l( a4 L& q$ E) K; h5 c; }* E else wait for 10 sec
! G1 |: V( C: v0 c if A_i=A_leave then send to die+ [* `- h; P7 N z; ]( w$ f0 m& ?6 L: q5 Z
else inc A_i by 1' {2 K# R s5 R- w8 R ]# s. G2 Q1 _
end
) V7 _/ O/ n$ L1 M. \" Oend. h3 ^1 r+ Y( C# \6 z0 u" Y
" u" y. q, f( T% W( D7 o) |begin P_pick3 arriving
8 I# f2 b. q8 N, Q; f set A_i to 21
& ?" w) s$ D/ G move into Q_induct37 m- b+ ]$ s$ W6 s. P* `
move into pickaisle.induct3
/ e1 g8 L. Y% i. K while A_i<=30 do begin' ]1 X9 N$ W8 ?7 B& t! ?
travel to pickaisle.con(A_i)6 N5 {, h" q1 T# m7 D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 ~" c: N% G/ a, d4 f
else wait for 10 sec
0 q; g h5 L: f2 P if A_i=A_leave then send to die
5 P( ?1 i7 z" a9 B else inc A_i by 1
' F Q! D: \" k end
6 ?( `6 y! p# jend |
最佳答案
查看完整内容
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,其它按你的 ...
|