|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
% r$ `' W6 a3 p K. z" w- K6 V( n! @' \& v( d5 Z3 V7 v; c3 e
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ x" e) U7 y; [1 G$ B Y2 z5 P# w
% v6 ?9 Y$ f7 Z' ?" x7 j& k2 pbegin P_read arriving" f. K# _; J7 h( j5 u" y, ?7 m
while 1=1 do begin+ F4 j2 N4 X. Q- r6 W f
read A_tote from "data.txt" with delimiter "\n"- G& n$ e! P5 b- ^) o# A
read A_time from "data.txt" with delimiter "\n"- G, i/ R9 N# i. H
read A_leave from "data.txt" with delimiter "\n"
6 d+ D3 V9 C/ I+ M read A_picks from "data.txt" with delimiter "\n"+ |$ t' W: t& a* J( a+ n
set load type to A_tote
% Y# @: v: d. c2 s5 o% [ if A_tote="tote 1" then set A_induct to 1 d% W) K! b; W/ e5 G" ^
else if A_tote="tote 2" then set A_induct to 2
u1 Z7 J" f& E6 O0 b else set A_induct to 3
0 x2 p7 f5 e- w0 {4 N0 _' h' S* u set A_i to 0
7 k3 i% J0 \, s: I: _ clone 1 load to P_induction8 D7 d5 q" T7 R9 v
wait for A_time sec0 j3 A) p5 E7 z, |8 ?
end
0 o7 ]7 N: [% z& B( p: jend7 H6 R: T0 s! ~' s
! a" Q# N% L4 Y! c% jbegin P_induction arriving
9 X# e7 q1 X8 c4 c/ R# O3 K: D- X# c if A_induct=1 then clone 1 load to P_pick1
$ Z4 Z. ?4 h; m! _6 V" p1 [ else if A_induct=2 then clone 1 load to P_pick2
0 ?. W* H2 I) C9 }% j/ G else clone 1 load to P_pick3+ j6 Z/ p! c+ j! [8 y( K$ R* @
end
3 q M0 b4 b% K
2 I X8 y, U2 j" m: c1 Hbegin P_pick1 arriving0 x$ R5 n/ ]! _, p& y. e2 l$ P
set A_i to 1# S, T% |& x; H, c: ~# C
move into Q_induct1' M; u I1 K) j+ `0 i0 @, Y
move into pickaisle.induct1
! X# W% T+ q R6 X while A_i<=30 do begin
- O. n& h7 |* W( Y* q5 x travel to pickaisle.con(A_i)- @5 z' b1 M9 c4 b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, v2 g0 a" U" I2 b* {' s
else wait for 10 sec
$ ^/ q0 Q" d2 X" S0 L3 r# V/ }/ g if A_i=A_leave then send to die
( Z0 N! z0 m# @, R else inc A_i by 1
% U( l1 Z- S: _! ? end
2 D2 G$ A1 f; n+ F; M- f6 _end7 L2 m& O7 [+ a! T
& x7 ?/ f( n. k; cbegin P_pick2 arriving/ H" x* b2 S* b3 q( J+ J5 Q. ?) C8 E- c
set A_i to 11
0 S" ~" z+ S0 N5 m( r# P move into Q_induct2
" h$ ?. e1 U8 p3 T5 n move into pickaisle.induct2
! L" t- J- ~) N4 I9 t) ^. m while A_i<=30 do begin
& K) q3 R1 U& \4 N* m6 I" N+ R travel to pickaisle.con(A_i)& m" t1 O1 T8 h; b3 w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 u& d- S! E+ W
else wait for 10 sec
+ z% I/ z! u' }, C/ o9 s if A_i=A_leave then send to die! j+ v ? ]# r3 r) ^
else inc A_i by 1
/ v+ G1 t4 {( T' j- v S end9 ?* R9 x. y0 z& {! i
end
- V1 x6 a5 t% Z! q: P9 Z1 ]
$ y- @0 k* K6 J7 d3 x3 Ybegin P_pick3 arriving/ x/ d% y2 {5 Q" C% `% s
set A_i to 21
5 z! U0 s3 M3 [8 }. W' b move into Q_induct3
0 L* a9 o' r4 A" S. n move into pickaisle.induct3
7 f- k0 n/ V. [' U while A_i<=30 do begin
5 q: c$ d& g3 o- E travel to pickaisle.con(A_i). Y3 J4 M6 G' v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 J: T% R2 Y2 M8 C+ |0 m3 l" j' }
else wait for 10 sec
/ G" z# b: w' T/ c3 r; L# N/ G8 a: T. K if A_i=A_leave then send to die
/ ?3 O9 o- K) D( E( n4 o* L# @ else inc A_i by 1) L, w2 S+ t7 e
end
3 n8 F& J1 H( ]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,其它按你的 ...
|