|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ w% _- v9 ?' M4 }& X- _
2 e; r1 w1 W+ x6 f ^; I0 G
我的问题是,在每个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中的数值,不知道会不会有什么不妥。% t8 [/ h; a/ X' v0 N
3 |% S P6 N) X* K9 b
begin P_read arriving0 x+ e+ L6 B! X( u! K9 ^
while 1=1 do begin
( s s/ D. d7 Q( A* t2 L2 C read A_tote from "data.txt" with delimiter "\n"
- ^, r( L/ S0 t, B8 H+ v read A_time from "data.txt" with delimiter "\n"; Q0 d: q$ g! J
read A_leave from "data.txt" with delimiter "\n"
, R# H+ r. l( o. d8 r read A_picks from "data.txt" with delimiter "\n"
/ d. P( B" N7 I* [' j& i; z" A set load type to A_tote
4 {, V4 S' U2 P8 M1 g& j if A_tote="tote 1" then set A_induct to 1+ E! i' e/ d Z3 T/ ?6 s
else if A_tote="tote 2" then set A_induct to 2$ D. u# e7 h1 ?3 A. B( y4 b
else set A_induct to 3
1 ], W, ]2 r0 v1 f; q8 i! x set A_i to 0
" p* U2 C0 ?4 ^4 q2 `+ M2 w/ ?$ p1 a- E clone 1 load to P_induction$ x. @- J3 R: h
wait for A_time sec
7 V- R3 m+ l/ T end
' L* l3 u+ w5 fend. S" Z" A2 N6 C8 S
% @7 \2 }: J1 P. o3 r" L$ {
begin P_induction arriving: J; M2 h4 G7 Q9 m/ u% e; |$ C) k
if A_induct=1 then clone 1 load to P_pick1. a% r3 ]5 q; U# G& C& D; `* a
else if A_induct=2 then clone 1 load to P_pick2
5 Z7 `- f7 j# Q5 J2 N% [9 w else clone 1 load to P_pick38 |4 S3 W9 Z) X _1 x4 c+ s2 v+ q
end
0 Q/ W% i. R: w9 O7 U \8 l ]
6 w4 R: Q9 z" W6 Abegin P_pick1 arriving) {( y( u' o( L) \
set A_i to 17 G1 c3 z, i4 @2 X$ R4 p& Z- G
move into Q_induct1
2 J+ k( M$ D. K2 P move into pickaisle.induct1% j* M! n# t5 H7 S; y' V
while A_i<=30 do begin4 O- }& P+ Y( J$ ?& t6 N% m9 A
travel to pickaisle.con(A_i)
; O# x7 v$ k" \: V8 @" d3 R& l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. A# D7 C5 P4 T% R else wait for 10 sec
) q1 ?: }: w" d( D- i ^ if A_i=A_leave then send to die" \( f6 |1 a9 |8 J b
else inc A_i by 1& Q, y2 K3 \8 V
end
$ _1 h+ V) a) o, ?( L' R6 P' _end+ [$ e/ r# p* u# o8 @$ e
3 x5 M: C+ f+ {0 t# v& h* xbegin P_pick2 arriving8 [2 C% Q, M* H: v2 `
set A_i to 112 `. {& x% o# h. U: v
move into Q_induct28 ~& [) T8 p1 {0 ?* g
move into pickaisle.induct2% m& @- I4 d0 R
while A_i<=30 do begin. X& {$ O8 Z2 Q2 h9 j& F
travel to pickaisle.con(A_i)/ N0 _& U% \; w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ O$ [& D/ y, y
else wait for 10 sec
% ]; |' m! I* V0 S% d if A_i=A_leave then send to die
3 v4 p4 O0 p0 e8 W; J else inc A_i by 14 m$ r% b% R% \9 _/ p% A
end `( Y# D8 a* i
end
* E- \! x- G1 _: j9 t; d/ ]4 R+ r' p( j. z8 z
begin P_pick3 arriving
m3 W* B. y" m3 Y u2 p set A_i to 212 s( w6 w0 G# g3 ^
move into Q_induct3
; l" Z3 ?$ T; x move into pickaisle.induct35 ~6 q- j) @. E0 v* K* F- K
while A_i<=30 do begin5 a) G1 B4 {3 F* @
travel to pickaisle.con(A_i)) {- a4 ^$ m; L* F! ?# ~7 w6 `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# R& I0 o7 S# R8 ?& x/ D else wait for 10 sec2 P( k$ @" J6 g1 W: ]" y
if A_i=A_leave then send to die
* D$ m3 i( _3 p/ c, h' ] else inc A_i by 1: ~/ E4 j) h0 o* `( D* C8 C
end1 h$ A% w4 \$ S5 y$ r
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,其它按你的 ...
|