|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: z" u! }+ Y3 E3 k6 T
& m: a3 H8 r7 l; ^+ O4 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中的数值,不知道会不会有什么不妥。
+ N2 Y* M7 `, E
. P Y/ p, I7 H' G" I# @- ~: cbegin P_read arriving
9 c5 D! g W/ o! G# t8 K while 1=1 do begin9 x/ m* A5 v1 n8 f
read A_tote from "data.txt" with delimiter "\n"( ?5 o1 ~# a" _( ]) `* S, i
read A_time from "data.txt" with delimiter "\n": p8 O+ x0 C1 g8 a) [
read A_leave from "data.txt" with delimiter "\n"
) w8 V4 r: A$ ?: A! `. A) n- [ read A_picks from "data.txt" with delimiter "\n"
2 Z5 C2 I4 V; E2 I7 |9 g set load type to A_tote
0 [8 X- _8 Y# U* p+ D v if A_tote="tote 1" then set A_induct to 1. B; e$ b- h4 r0 l
else if A_tote="tote 2" then set A_induct to 2
) K0 W% m4 y- Z& i/ W else set A_induct to 3
8 F8 ]; P; P, S( F set A_i to 0
- T, k( s3 }* V( b0 i: E" n3 ? clone 1 load to P_induction
+ c+ T- N& l' A4 @( j5 G wait for A_time sec
8 d- }3 ~- Y% C' b" B* }) v end# w: Q# ?* l$ M) M) ~
end
' |1 R' ~1 R% ~" K6 [; n# \) j6 j7 i0 R# B2 C, n
begin P_induction arriving1 q& v' C8 }* \( m/ g A
if A_induct=1 then clone 1 load to P_pick1
o: Q6 O8 u' T6 Y3 X9 a, ~4 { else if A_induct=2 then clone 1 load to P_pick25 A9 H' ?) g1 I
else clone 1 load to P_pick3+ I; ^7 `$ ^! ~
end8 x. W# w( Q% X/ b3 M8 n* L( e. A
`1 D, R- f x& `begin P_pick1 arriving+ K/ ?6 e) e) d5 b5 o: P; Z
set A_i to 1 b8 @4 l, d2 d+ b7 ^/ T5 X* O; a
move into Q_induct12 b6 v: e7 A. A* m9 j
move into pickaisle.induct1
2 p2 x: g n5 z+ j; M* _; C while A_i<=30 do begin/ k* _, B9 r0 D
travel to pickaisle.con(A_i)
) S$ o0 p( q+ L3 \3 S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 C3 }9 Y/ m/ S/ Z% i. A- [% ~
else wait for 10 sec- L& `; Y6 _7 W8 i$ {( @* o# c
if A_i=A_leave then send to die
6 h* R% R" h3 l/ e" q else inc A_i by 1
7 K+ l5 E* p u* q" A7 K end7 f( {! @' d' _! ^) F2 r0 O" d( e5 U$ \2 k
end
4 e, u& y& q9 o3 N: G# f5 U) j3 X/ U7 K( w1 r: V
begin P_pick2 arriving; r6 U& F* j3 S' U4 Q
set A_i to 119 J- e/ {2 u/ R& g
move into Q_induct2' [4 Z, X0 h! s9 K0 B; s# }! \" j
move into pickaisle.induct2
! i5 u1 j8 ~, f* q. W while A_i<=30 do begin
* K2 Z, j& g% T/ E$ x travel to pickaisle.con(A_i)% o( O% O2 Q$ f! d5 b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; }6 n# H- @2 q% ?# ?% F else wait for 10 sec! R, E. b0 h& s* w, O8 D
if A_i=A_leave then send to die
" d# R" K5 s2 Z) n else inc A_i by 12 l# k! `1 ~) g& v5 g8 P
end
. ]# L" M/ i# N8 Bend
$ B+ k* V8 f6 w2 p) ]; j' A: M) c6 @ V" ]
begin P_pick3 arriving
+ \3 `9 N' z) N* \. B set A_i to 21: B5 r, A9 s. P9 p5 d6 O; v6 R, @( D
move into Q_induct3
9 s" j7 V H9 T move into pickaisle.induct34 m8 I* \( `- ]" S% x
while A_i<=30 do begin) R4 j0 d! d! ^+ r6 M) q
travel to pickaisle.con(A_i)
' |: q! G5 a, k- _* i1 E3 f1 M' x# I6 ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 ~1 }! F; I% P. ]7 T# @% d
else wait for 10 sec
1 T7 f1 V) e0 o0 i+ Q. Y& D if A_i=A_leave then send to die# d) q/ L+ e5 a# r) z W
else inc A_i by 1
1 K: b& d) Y" J; {0 g) u- ~ end
, C% i: X1 J Q9 H" ^4 e: Eend |
最佳答案
查看完整内容
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,其它按你的 ...
|