|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 }1 F+ l5 }- e4 K
; j ?' h6 S& D3 B7 i
我的问题是,在每个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中的数值,不知道会不会有什么不妥。. m" N+ S% ]3 R5 K+ t5 o+ |1 Z
% Z( l% X: d% n/ v, t+ w9 ?
begin P_read arriving# n' |# p' y9 ~$ {: j) ~
while 1=1 do begin( e3 \4 x/ S6 @. H6 _( O7 u% C
read A_tote from "data.txt" with delimiter "\n"3 h0 y: z" ~2 P1 m. k: d7 z4 ~
read A_time from "data.txt" with delimiter "\n"1 }" I: T1 L: u4 s. [( u
read A_leave from "data.txt" with delimiter "\n"
; t7 j0 b; q% l8 x$ q5 r read A_picks from "data.txt" with delimiter "\n"
% C7 ?4 j) ?2 O. H( A set load type to A_tote
( X" b" m- s% P- ~! Q6 o7 } if A_tote="tote 1" then set A_induct to 1& j& m+ G5 S" y* e
else if A_tote="tote 2" then set A_induct to 22 X/ E) N i5 r7 ` z+ f! s
else set A_induct to 3
4 G5 C, c9 {, d3 |) j( w3 s- Q set A_i to 0
: M. c N: j7 f. r4 i clone 1 load to P_induction
9 ^3 c) Q K' {- X' H: U wait for A_time sec e' h+ V- H. J, ?- U% C: h
end1 t" i1 G, V" V0 Z P& F# {( V1 Z
end
! @, r, h4 M3 I, u% I$ v# O$ D" O- x+ l% z5 Q) g
begin P_induction arriving
8 G% o/ S6 l! U3 w6 n if A_induct=1 then clone 1 load to P_pick13 C3 W3 t/ l- ?) ]5 l
else if A_induct=2 then clone 1 load to P_pick29 T( y3 w6 p( I p
else clone 1 load to P_pick3
5 u5 s& ^2 u% w( W$ send! @( Y- P' d: G. w. X
$ r8 b% m1 D0 Z2 S* i: |
begin P_pick1 arriving
5 K0 y5 {, V/ N7 A set A_i to 1
, Z8 k2 |4 b* O9 i T% D8 t( ? move into Q_induct1 ~& F% _$ z' {- z2 R
move into pickaisle.induct1
v% i0 K. [2 C; n, x) J. f* H0 h while A_i<=30 do begin3 {" J+ P7 c1 \3 ~' I: E `
travel to pickaisle.con(A_i)
$ `2 O% k" e% S4 h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* d- V. h7 |6 x0 H! \7 O! L
else wait for 10 sec
# A* q5 f% K* n/ @ if A_i=A_leave then send to die2 Q) W( g1 u$ w5 }; @$ t. n I
else inc A_i by 1& [/ A2 K( b' [
end
# N& x$ H! B; f9 n uend9 ^3 J" M" y0 D0 B! C+ X
' {: v6 |0 Z% |9 ^! H# i
begin P_pick2 arriving
5 D/ M" v* a' z1 [7 ~& d set A_i to 11
* l" g0 M+ N" r* D2 R move into Q_induct2+ C4 {' ]6 z9 D" I2 ^+ G' d# N
move into pickaisle.induct2
: p: x. N$ d- _- b- P: c+ R while A_i<=30 do begin
, Y6 f7 w |/ a# g5 i travel to pickaisle.con(A_i)
* ?/ K/ M" G* h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 U9 I4 j' U4 }% ], v
else wait for 10 sec- ?# S- [3 _8 O: A; S
if A_i=A_leave then send to die) d! P" Y' E. w5 s; a
else inc A_i by 14 n' N* m" n6 n3 }5 ?
end
* [, d5 y6 a5 H6 `0 Z2 x: o4 C2 qend
5 J. C/ R, u+ N* G7 A
1 u0 a- a' l( H' Y6 P0 [5 F- jbegin P_pick3 arriving
6 B5 v# q( ^. L; ^+ ^! x1 e& d set A_i to 21
' e! H3 W: A- J: y3 U4 { move into Q_induct37 c: Y; b- S& ]2 |, U, E& M y/ b0 ^
move into pickaisle.induct3# ~% B& \' w5 k9 x3 J+ N E
while A_i<=30 do begin: `9 ^1 U& d u. [/ ]
travel to pickaisle.con(A_i)) N: \& X$ h; M
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: a: Y5 B# G% f3 B' \( }
else wait for 10 sec [4 d9 X& O6 z, A" ]3 B/ w
if A_i=A_leave then send to die
+ b# T. m5 P+ V3 ~/ _6 ~; E else inc A_i by 1
! a1 H9 _1 W" s7 n& Z! g! z end7 b; ?' w1 w' Q; l* ]1 X1 J
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,其它按你的 ...
|