|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 R; ]. z; c, Z* D4 x3 c" a
, _2 ~; D& }5 e: A& U" x0 U我的问题是,在每个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中的数值,不知道会不会有什么不妥。* Y# C# o' I R3 A+ e& z" G3 v
0 D' m1 Z5 n, _; {; `
begin P_read arriving
U/ Z( `, [ `, _4 W& s. O4 n while 1=1 do begin
# y& r( z, P: Q( z/ a! i read A_tote from "data.txt" with delimiter "\n"
$ E/ c; l; U% Q& q4 a* J" Y( k- Y4 W read A_time from "data.txt" with delimiter "\n"0 m) i/ h- e' ]+ ]4 r1 g
read A_leave from "data.txt" with delimiter "\n"- D" y7 H1 S" u' F
read A_picks from "data.txt" with delimiter "\n"" x; [) X+ P( [3 @
set load type to A_tote
- Q) e; P9 B5 m" { if A_tote="tote 1" then set A_induct to 1% i, m6 Y$ W- X+ J7 D( D% G, R6 I
else if A_tote="tote 2" then set A_induct to 2
5 X6 P; ~# a# Z ` else set A_induct to 3 ; Y5 k/ b. U( o9 f( q4 @# N+ ?% O; l
set A_i to 0
! z, {* l; V" ^6 M$ Z& @7 R* M clone 1 load to P_induction
: @( s" s4 R4 o$ X1 j6 x" t wait for A_time sec$ I3 i y- `8 {* G
end
& L( C/ r1 C; R! z/ Uend
3 z8 D6 t- r& J$ ^# M' J" J5 n; J& O( z, [) M
begin P_induction arriving+ R0 B% R" X: v) _. [5 l: k
if A_induct=1 then clone 1 load to P_pick16 x3 {4 e1 }" M7 ]
else if A_induct=2 then clone 1 load to P_pick28 K! t/ A9 C7 ~
else clone 1 load to P_pick3- S3 X# U6 U& b, u) m: h! M
end; n; D* p! S5 N# E% N
: m) |: f; F9 L2 t1 `/ p
begin P_pick1 arriving8 B9 I, F/ A- V) L
set A_i to 16 n: ]) ~ R# W8 p
move into Q_induct1
0 N1 t1 a8 L2 y+ ]6 A move into pickaisle.induct1
2 C2 x/ F* a8 d. F* u! k while A_i<=30 do begin
- A: B: W e3 c) K+ b, x, o travel to pickaisle.con(A_i). n7 J. t4 z) F' q% ~3 A1 I1 S4 Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 n E# ~& U- N% Q
else wait for 10 sec) }, s* I- [3 h! l
if A_i=A_leave then send to die
, m( { D# S/ d7 x else inc A_i by 12 j6 e a9 s* P1 z& Z9 Q; \
end
& f# B" I2 N. l5 m1 }2 F7 Wend) D5 s! S( ]$ W" k( z; I- ~
' @) _4 N2 F4 S2 }# L Ubegin P_pick2 arriving$ p6 t, u$ Y! k# V+ E
set A_i to 11) m e. W M7 B7 Q
move into Q_induct2
( ^2 ?. e1 Z5 Z2 r# L move into pickaisle.induct2
- m5 M8 I G7 T+ V+ E3 c while A_i<=30 do begin
/ [. Q; X" {+ A2 S travel to pickaisle.con(A_i): i' G: O# t/ a" c% A/ T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, o0 }( Y; I& }
else wait for 10 sec
, t' e: r# Y' Z7 O$ @# Y if A_i=A_leave then send to die
1 H/ }0 X. t! ]7 _; B0 Y else inc A_i by 18 X! T2 a @4 x# t+ {
end
6 Z7 u+ C6 W3 ]end
! a; z9 P5 R( j1 ]) S& z" i8 K; z2 r7 D0 W- L
begin P_pick3 arriving
+ \" i" w1 G( D set A_i to 21
3 }, a0 J- L' ^. { move into Q_induct3
# x, U% n, p0 ^( M' u. k5 C move into pickaisle.induct3
3 J+ |# y7 y/ w+ G/ E- z7 s' X8 b while A_i<=30 do begin
( _/ d3 C4 W; A& K travel to pickaisle.con(A_i)
4 F/ g! b; @7 w+ X) ?9 J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 e1 @; W" S. B* | s/ |& U3 h
else wait for 10 sec
0 q! P5 P, r; P( ?/ {$ P if A_i=A_leave then send to die
! N( U* {/ q/ _ else inc A_i by 1
4 G& J& ^+ O' @8 w- x0 y% V8 Q( u' ] end
' f! m% b, o5 g" v; x0 D: iend |
最佳答案
查看完整内容
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,其它按你的 ...
|