|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ W: Z4 U, X/ J7 t; W& @ i$ A& `% N% |/ @7 M9 o: D, [
我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ V6 L+ S }! S& P0 S2 B
) v7 m5 c5 z$ i2 u9 L9 n. Ibegin P_read arriving
* w" C3 h* ^' u$ W1 V. g while 1=1 do begin
. \2 M+ q6 t% Q( A% i" l5 e read A_tote from "data.txt" with delimiter "\n"
: I$ h) w" M- L5 k read A_time from "data.txt" with delimiter "\n"
: N6 Y& T. ^# B read A_leave from "data.txt" with delimiter "\n"" {! K8 O; T/ i
read A_picks from "data.txt" with delimiter "\n"
5 h% C/ K# u# ?0 c4 X! q set load type to A_tote
# y2 M T) v5 w- z if A_tote="tote 1" then set A_induct to 1
& v/ w3 q& \+ m# k5 s7 [& ? o9 ~+ e else if A_tote="tote 2" then set A_induct to 2
" @' v) F" h: K# t, q( d+ ]' q else set A_induct to 3 % ]4 v1 i7 H" i9 D7 w$ M4 _
set A_i to 06 z3 }: Q. Q/ D7 }& v
clone 1 load to P_induction
4 \ n; h- B$ z+ x: M% X2 ?! u. N wait for A_time sec. E6 t4 K* }0 \0 S! _- r
end! }" ?% U$ s w
end
0 t- S& ]- e; W p0 \
+ G# h; Z7 Q/ w# x9 wbegin P_induction arriving5 R0 F C/ ]( H4 x, N5 w7 s" ~; A) }
if A_induct=1 then clone 1 load to P_pick1* X0 z3 l% b/ \
else if A_induct=2 then clone 1 load to P_pick29 `# Q( x. w2 A5 S
else clone 1 load to P_pick3
' }, z7 Y6 G7 J# O: w/ s! X3 Kend3 K; [% _4 b2 k/ m
& d4 H- f: W" Y( c) }: ^
begin P_pick1 arriving
3 ]! h5 p6 v# H5 b set A_i to 1
3 p; ^' j& C6 ^# k. e; b move into Q_induct1
" g) R" Z2 w8 k: t move into pickaisle.induct1 W7 w5 P4 K4 q% v* u: t# J
while A_i<=30 do begin
! H# {8 M2 R7 N2 M t travel to pickaisle.con(A_i)
* ~" t f J: w9 c1 y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 {$ c) w* C6 R' f1 ]' [2 D0 t# q else wait for 10 sec
0 ^/ M! x' ]$ G, B if A_i=A_leave then send to die( T& P' \$ n& |( D
else inc A_i by 1% F; i$ B& }% y- D$ [1 Q8 i
end
' \/ _$ t, |2 ?6 p! f6 }end: p+ y0 N1 a" A/ i5 j
7 o- m+ Z5 l% w
begin P_pick2 arriving
4 y* h0 K8 d) r6 T+ | set A_i to 11
2 l$ U' H6 J6 @$ u move into Q_induct2# J& ?4 @1 R5 C: m8 m2 `2 L
move into pickaisle.induct2
* F8 a6 W2 y0 ^- E- ^$ a( B while A_i<=30 do begin4 u2 m0 y. P# [' P6 D2 ?
travel to pickaisle.con(A_i)" |# j Z L) S6 V9 o/ A- }5 z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 @! {8 T4 G7 P5 y
else wait for 10 sec
* _) }5 f+ ?! K3 v8 e7 l) D if A_i=A_leave then send to die1 Y. x, ?; k' y3 P2 O
else inc A_i by 1
' \1 k5 V4 P8 R6 }7 z: i+ ^ end9 v3 ]; j5 z0 @
end9 x9 @) _+ z9 V) ]5 t$ ^" C' W/ {
' t4 n, m( c5 }4 P0 ?8 g; l P
begin P_pick3 arriving
" q, t6 x: r; X* K# ^: v set A_i to 21
0 S4 S4 Y; Z& A! z move into Q_induct3' E) F5 k* Y( x/ E
move into pickaisle.induct3
' a3 A5 r7 i' {* C( I0 g while A_i<=30 do begin) R% h/ Q/ R4 x* O$ o' { f
travel to pickaisle.con(A_i)6 F& ?% z& A: y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' w7 }+ } B4 _
else wait for 10 sec" S. V% X$ T+ s9 ]
if A_i=A_leave then send to die
' P! P& y5 S& V else inc A_i by 1. @* }/ B5 [ h. L5 @: ] d3 x
end
$ w: f( d6 g$ s# v0 lend |
最佳答案
查看完整内容
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,其它按你的 ...
|