|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! X! b: u3 `9 X# u, ~9 s- x! F: Z j
我的问题是,在每个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中的数值,不知道会不会有什么不妥。% }7 ?/ q6 X; s
0 a% G' L' w* C. \3 u- O0 |4 xbegin P_read arriving8 B% v$ k0 w: X* G$ h. Q: s# V. m; N
while 1=1 do begin% Q+ ]+ {% x( a6 \2 G6 @% C
read A_tote from "data.txt" with delimiter "\n"
2 X- ~ t/ o5 ]4 ~, a6 Q7 f- m- }( ] read A_time from "data.txt" with delimiter "\n"* P0 M5 H0 s3 |0 ~0 S
read A_leave from "data.txt" with delimiter "\n"4 _& l- @+ k9 ]$ h6 B# k' }
read A_picks from "data.txt" with delimiter "\n"
3 E* f$ g; ?1 _1 z/ V set load type to A_tote4 [- q1 C# D! w
if A_tote="tote 1" then set A_induct to 1/ O8 e) u+ a3 l9 i9 G. M- z- k
else if A_tote="tote 2" then set A_induct to 27 y1 ?' J- ]& {0 z+ C. C, Y
else set A_induct to 3 . ~8 [. Q" E6 ~
set A_i to 0
/ v% B/ {7 G7 A+ v" x clone 1 load to P_induction
E( d2 Z; g$ @ wait for A_time sec7 y. K8 [, ^2 f5 U6 U$ D
end
3 l' d! S% _; k o2 m* ]end* x) e8 n H4 t) ]
; K9 X6 Q# ^* U5 U K- r$ _" x
begin P_induction arriving0 n E/ z1 D- I% j& R0 H
if A_induct=1 then clone 1 load to P_pick1# T8 s" T4 q7 l
else if A_induct=2 then clone 1 load to P_pick2( M5 ~( ^& ]5 }: f
else clone 1 load to P_pick3/ {; Z* k- e1 L; _
end
: O$ @* L6 D/ G- O5 ^' _! r. j3 F
1 b, g% T! s3 F. S9 hbegin P_pick1 arriving
; n! G' r. ?; v8 b. O6 ] set A_i to 1- ~7 O) }% q+ A
move into Q_induct14 C. I+ h: s9 ]- j) |1 c) A% O$ t
move into pickaisle.induct1
/ x/ L& L7 F, X0 S while A_i<=30 do begin) M t0 \4 ?: ]* L2 m
travel to pickaisle.con(A_i)
8 f& k2 e, `# B5 E" `( R% G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, V8 ?9 f$ J) ~$ c- O3 \
else wait for 10 sec
. g' X- y) T2 W7 j: i2 P if A_i=A_leave then send to die
' p3 o* Y+ v( L5 `- \/ c else inc A_i by 1
* E0 O I3 a. m9 C7 x" d end& F" @. D( `; ^1 @4 U+ y
end% c9 W0 b) R- w) b, a
& ?1 H9 G" ?; U8 v
begin P_pick2 arriving
' v) \( O }1 ?- k' k2 l set A_i to 11
2 g- O1 l" R0 H j move into Q_induct2! G% l1 e- w( C8 c* r' V% J' B* u d
move into pickaisle.induct2
7 C* t# Y0 T5 K! p$ g while A_i<=30 do begin
% F; d1 `! r* u travel to pickaisle.con(A_i)
' K9 u# N2 K$ i7 l( K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 o$ Q3 F U1 ?" w- X; s else wait for 10 sec& _& B) h9 s3 K, ^0 T, H
if A_i=A_leave then send to die4 E: y( J4 Q" ~# J0 m
else inc A_i by 1
; P( d7 {- A# T" X p end1 ~. `0 o3 E- n5 i) S2 ]* V: T
end
4 H8 V y( k: r' }; R9 K& d1 @/ K! k9 J. w7 w3 Z
begin P_pick3 arriving
, N$ S2 ?: M) Q+ |/ I5 q! F set A_i to 21; m9 V8 n- ~) f
move into Q_induct3
. w3 g: ]' |3 V, s" h& T move into pickaisle.induct3* d# H m, y+ h$ V, L
while A_i<=30 do begin2 A. k- s: s" C5 ^1 ^: [
travel to pickaisle.con(A_i)
$ Z7 P# x9 g! `' k* }9 l' b7 X4 q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 \5 A7 l( Q1 G0 E# x' {7 H( s8 q else wait for 10 sec: b! J& l2 w7 ]8 u1 L/ v. Y# l5 l
if A_i=A_leave then send to die# G+ d( k- V) u t k( Q( S
else inc A_i by 1$ C8 x8 D7 D8 B% {
end+ N: @- T9 S/ d# A$ c/ b9 e
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,其它按你的 ...
|