|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. f5 v9 H/ N1 Y* x
6 G6 H) c$ N$ D. 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中的数值,不知道会不会有什么不妥。
1 n' J J5 `: y
5 _* {3 |" [" V4 Z1 Rbegin P_read arriving
, @! ~! k) F8 ?1 m6 i while 1=1 do begin
. _$ ?& N' s( k; b( o read A_tote from "data.txt" with delimiter "\n"
' T) i q/ M- ^1 z3 o; [ read A_time from "data.txt" with delimiter "\n"
( ~% W, \5 v) S7 \' x T! g read A_leave from "data.txt" with delimiter "\n"
4 ]: s& A5 |2 h8 l read A_picks from "data.txt" with delimiter "\n"
* T9 M1 ? G% } set load type to A_tote4 a ^7 z. H7 n6 H3 Y7 P, i) w
if A_tote="tote 1" then set A_induct to 1
- @4 ^' ^2 }/ U# h2 | else if A_tote="tote 2" then set A_induct to 2
2 B' C9 r1 E' K) }2 U else set A_induct to 3
6 D0 G9 |3 A% E set A_i to 0
: E, M1 h; N. F" c" x ]6 | clone 1 load to P_induction3 [6 z* d3 d1 E2 ]* x- X
wait for A_time sec7 A9 W1 p$ N0 `2 l
end/ @% f5 l7 k* o8 e7 k q
end; I& i! p5 M0 D
7 F( m4 z' ]0 N* o3 bbegin P_induction arriving; _0 W; r$ M, b5 `: A* l( v, ]. D
if A_induct=1 then clone 1 load to P_pick1( _2 [, S0 \* U- I2 C# A
else if A_induct=2 then clone 1 load to P_pick2
1 }" k* \2 I l else clone 1 load to P_pick3
& m2 T" }; }, P8 t7 t7 G, V; Iend
: @$ X( Q, F" K. _& r4 O: ~$ p+ C+ N- H7 R7 G# f; H6 a3 ^! v+ s
begin P_pick1 arriving. w) J2 G6 c+ Z t% b8 E
set A_i to 19 d" e4 ?1 i; p, k6 J0 f0 Y
move into Q_induct11 S3 S. R) q) M* u
move into pickaisle.induct1
8 }, V0 G1 B& h: D& X1 j0 [4 d while A_i<=30 do begin( V6 D9 L; ^- t) z q% v+ }
travel to pickaisle.con(A_i)6 T7 S( |5 F6 G) q, G* g' q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ N# r4 }( D; p" w1 j( y& E else wait for 10 sec
) o, J: d% ^ l; m- i if A_i=A_leave then send to die
5 v4 U2 _7 L- v" y @ else inc A_i by 1+ G+ c7 s+ H ^" z o5 ]2 a/ l( l4 Z
end; d t [8 I: \6 P; F# P
end
8 k h6 g1 F5 h* w* B. a1 {1 u) X
begin P_pick2 arriving
: } b5 t4 k0 E8 y) j set A_i to 119 ~9 N P) V% V( E. h. U, R
move into Q_induct2
1 V! U y7 A. \+ T3 g move into pickaisle.induct2
' n2 |* g7 ~! m while A_i<=30 do begin/ s! F, f; p7 H+ f4 b- T; ^
travel to pickaisle.con(A_i). g% h. t' e& O" j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 b) w; r" O; q% w+ @1 h else wait for 10 sec# O7 G- p2 K/ f7 {' ]3 c E; s
if A_i=A_leave then send to die2 E" ]6 F6 T1 E% z; `4 k$ W' d0 r. v
else inc A_i by 1 z \, x, ]- X( x s" a
end
9 G2 m. P9 s$ w% {; N1 S" @) `3 gend* M& h- d) t( {0 ^/ R9 `
/ w) Z( `: D: w hbegin P_pick3 arriving4 F5 N* }/ q. k {
set A_i to 21
$ ]5 x& w+ G# _' ?8 C# u. L move into Q_induct3# `+ |% l0 L# p. R4 K+ A
move into pickaisle.induct3! E- r0 I9 [3 |" e: I
while A_i<=30 do begin3 p# U; g- ` Y
travel to pickaisle.con(A_i)& [8 e: d# v8 I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 I+ A# {& K" {
else wait for 10 sec
1 }2 X8 P% p% S3 t3 ^) I if A_i=A_leave then send to die
" N& n# a, O8 J else inc A_i by 1) N; S. w0 ]4 m2 \) O. M
end5 g2 [+ h; \$ i' `; S1 l$ F, d. G
end |
最佳答案
查看完整内容
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,其它按你的 ...
|