|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! z9 o, i1 m! L8 s: X" Y! Z: _
1 t# `1 X, Z4 E Y7 U5 G) b' 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中的数值,不知道会不会有什么不妥。& B. {3 {) Q: D/ y9 P
2 D8 D- r: ?. J6 k
begin P_read arriving
/ ~# Y( @* O& c% K8 i while 1=1 do begin
, A6 P7 E5 J4 N' q read A_tote from "data.txt" with delimiter "\n"
0 w; S4 G1 ?( ~ O! `$ u1 }% I read A_time from "data.txt" with delimiter "\n"5 E2 S u7 Q# h& ]8 q2 X, B
read A_leave from "data.txt" with delimiter "\n"7 t7 V; [3 @4 ?& v
read A_picks from "data.txt" with delimiter "\n"
& [# d# p0 Q) T- r1 n) `, { set load type to A_tote
* W7 R2 Z4 Y C. J6 T if A_tote="tote 1" then set A_induct to 1; F2 S1 V3 E9 Y) W, L* y
else if A_tote="tote 2" then set A_induct to 22 G9 X0 c8 N/ ~8 g' `
else set A_induct to 3
, C* n- I) D; l8 l6 [8 c. y: R set A_i to 01 l6 k6 I0 I: U! F2 k4 _
clone 1 load to P_induction! z. e) D4 u8 m% H. c; i4 Y- n# ^
wait for A_time sec
; j- B/ [2 U' I end
4 ?& r' V, A* q) R$ g) }, yend% ]5 B$ i, ?0 c
( z: F+ q# J5 c9 E; q! m4 W' W2 ubegin P_induction arriving4 N" A& p- u8 ^4 {( X; p5 f- f
if A_induct=1 then clone 1 load to P_pick1
+ b2 H2 P- V4 T2 C$ J else if A_induct=2 then clone 1 load to P_pick24 \2 }/ c) B# P/ B( x7 q
else clone 1 load to P_pick3
2 a" J* Y: n: _, b, d7 Send
) Y) E4 B1 p7 a+ K+ ^8 D" b4 Q# x: H
begin P_pick1 arriving
6 h# J/ s' K6 F& G3 @ `6 R# ^! ^ set A_i to 1
# M* G- o$ u1 a9 `" ? Z3 y- S y move into Q_induct1, F( V+ z7 E7 W4 z! h0 e8 R
move into pickaisle.induct1
. {! n4 Q! h* M3 B* C while A_i<=30 do begin0 _! s: _. W/ E0 i: i- V! P7 ^3 j$ R7 O
travel to pickaisle.con(A_i) T& |0 G: Q& z9 n) k+ }: t
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! z0 L& |8 m7 Z8 e/ ?' w else wait for 10 sec
" K" @$ M, W$ a3 v" R if A_i=A_leave then send to die' r1 t m* C! s" G% D8 j7 A9 u
else inc A_i by 1+ S, y- z2 T% a: H
end
. I {* A" M; |; }8 [; G7 rend
3 m$ W* ^( w# k2 A+ i& {2 H6 d1 h {5 l- K* q5 r" U B. `0 F1 n
begin P_pick2 arriving7 _* {. Z- ?. v" L( S
set A_i to 11
5 k* G0 Q& M0 b& n2 b move into Q_induct2# d- r, }' I7 L2 V. d
move into pickaisle.induct2
- P7 q8 c4 B( } } while A_i<=30 do begin6 p7 h/ r# h1 l
travel to pickaisle.con(A_i)% `, j+ I* j- {: m, x7 R0 {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 m9 f% T! u8 }, ] ~
else wait for 10 sec
( ], [: |& B; ?: l if A_i=A_leave then send to die
' h7 z/ i( N# t. U9 M. [ else inc A_i by 16 u% U$ J1 r$ c" o! Y3 s
end' {/ S+ _( R0 K9 c) |2 { w0 q
end
) D9 n+ K" t2 l6 U" |) S5 `7 o: n u
begin P_pick3 arriving8 Z! y, L! f' Q$ {- B
set A_i to 21
@9 V) S5 T* ]6 q: S+ ^. |: \ move into Q_induct3: Y5 ~. S0 s! y
move into pickaisle.induct3
& K. W: {& o3 W% [$ D" _/ d while A_i<=30 do begin
' C7 P8 b5 G# n( v# K9 k8 d9 w travel to pickaisle.con(A_i)
0 u: t8 |( C3 K7 B: T+ d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# z% \1 T' L" @& F/ m' { else wait for 10 sec
: _: }4 j: ~: ^$ r. U& l( T if A_i=A_leave then send to die# A+ n$ z' E5 z2 F6 x
else inc A_i by 1
1 T* h. H- ]. J5 X4 Z% O end
: X& x Z ~/ g) q4 Q% u0 aend |
最佳答案
查看完整内容
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,其它按你的 ...
|