|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' I7 q7 X# \/ v/ U; \' m+ A0 n- |$ e4 E# e) M
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" s' f: U& h- h+ G+ i7 a; J# ^% s( b- c( f. m
begin P_read arriving
. S1 F, L. w& R while 1=1 do begin# o$ v9 a. k- u+ U7 b* J% c
read A_tote from "data.txt" with delimiter "\n"/ D8 D% Y6 i9 |1 Z
read A_time from "data.txt" with delimiter "\n"# F# P/ }. y+ Y4 U! s; U$ s4 \5 }
read A_leave from "data.txt" with delimiter "\n"* P7 a$ Z) }" K( R+ ]2 y
read A_picks from "data.txt" with delimiter "\n"
1 n5 \* `) |2 i/ F set load type to A_tote
+ h0 a1 C0 E% z' v if A_tote="tote 1" then set A_induct to 1+ c" G( I4 O1 s: |4 J
else if A_tote="tote 2" then set A_induct to 2
3 L* R7 W) I/ ]" t8 F$ e$ U& W7 X. F8 s else set A_induct to 3
* L2 \" _- i. t& X1 R* X set A_i to 0* D* h5 V! [+ R" `* I
clone 1 load to P_induction6 o; N5 Y$ \0 J4 v/ d2 M4 Q
wait for A_time sec
" Y9 Q; a9 s, E# Z B { end
' D/ J1 X3 |6 ]end
9 V. D7 g2 K V5 X# s H4 _* Z% X$ [- ~9 u+ G
begin P_induction arriving
9 X( W; ^# q. |9 d X$ {- U if A_induct=1 then clone 1 load to P_pick1! Z: T7 l7 O2 z, ?
else if A_induct=2 then clone 1 load to P_pick2' d+ r7 H+ f/ z( k5 v
else clone 1 load to P_pick3
) K5 z3 B. O5 s- F( w$ e% ?end
; q! ^# z7 m- a. V1 h% g+ l* S, J0 q$ h: k! e0 p
begin P_pick1 arriving
" H6 ~0 g; [/ c1 i4 { set A_i to 12 E3 i7 @, M P6 v: \
move into Q_induct1
0 s3 k5 W# P1 F# l0 ^& }5 X& F3 P- _ move into pickaisle.induct1
) {% r) V9 L6 U5 Z- n8 z- ?0 h% f# Y4 k while A_i<=30 do begin
6 x& ~. z- h' P! `! {/ r( r travel to pickaisle.con(A_i)
' h; w! G1 o* O( j9 \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! r( k% x5 E% i5 Z" I: q
else wait for 10 sec
- x9 J- s, \0 @4 P) X4 ]' N if A_i=A_leave then send to die
: l/ G3 ^7 a! X9 R; ^5 X else inc A_i by 1
& x5 K3 C" _3 r4 z# e- `7 o end9 ]8 S3 N( d( U; ^+ _2 _3 {
end
! i1 h4 L% s' @3 `. |7 W# o4 X. L9 h! I5 h/ J: d1 _: z6 f( p" E
begin P_pick2 arriving9 H7 A" G5 S$ H( Y3 K/ m r" {4 ^
set A_i to 11: x. b5 P% L3 `6 o( d% ~. Y% }# ~
move into Q_induct20 n" B6 v* C8 x
move into pickaisle.induct2
5 |) S8 k+ e8 B: H- a while A_i<=30 do begin
; }4 }2 ^2 k+ d N7 R/ o travel to pickaisle.con(A_i)
6 H0 I+ C, w; X8 } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; H6 A# W! g- J! g k+ }
else wait for 10 sec- }8 M; b' N+ p: W
if A_i=A_leave then send to die2 |1 _- p7 S9 Z' B/ j
else inc A_i by 19 L+ g5 q% y6 C- s ]* I- Y
end
$ v' {% x5 b" @ Y G# {+ _( w: Vend
* d, l, M# w6 [8 e3 J8 V7 t+ Q
4 A" _, [% A. k obegin P_pick3 arriving; b |6 A" M* q7 M
set A_i to 214 Y2 k: D, O1 x' b5 G. p
move into Q_induct3
- o( N: @ c8 U! m9 L% \ move into pickaisle.induct37 U+ ?1 _9 G1 ^( u- ]: k
while A_i<=30 do begin
: |0 f. \( I# T. ]6 u0 W travel to pickaisle.con(A_i)
( ?* T# R+ k% A6 W6 j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" h) [! d: V$ J" n% g else wait for 10 sec# A5 `# j* X! I. \) G5 N
if A_i=A_leave then send to die3 D2 c# A" \+ Z) ~& ^
else inc A_i by 1
) r. \& _- X( ^0 ]7 l! x; f2 m end# g3 x9 @9 W6 F1 P% a9 @* s
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,其它按你的 ...
|