|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 J) C8 f" Q+ I, b8 i' V) w" {' P3 ^
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' p% J p( N6 w& h5 q. ?! U
, w, b7 T$ d7 o- j! `begin P_read arriving! w. t0 H' h4 W" R( w' x
while 1=1 do begin
5 { X* T& K. O9 `: h/ P& F. x! [ read A_tote from "data.txt" with delimiter "\n"
L ]. Q6 r! R$ w read A_time from "data.txt" with delimiter "\n"
/ `2 M# \# s) r# Q! n( h6 e read A_leave from "data.txt" with delimiter "\n"
! X# F: f7 L& M' X3 d read A_picks from "data.txt" with delimiter "\n"- Y( t) v B3 _
set load type to A_tote. V' n2 K7 k$ j" E2 x
if A_tote="tote 1" then set A_induct to 15 n8 e7 n: ^3 c- w
else if A_tote="tote 2" then set A_induct to 2* b9 [+ {: X* r
else set A_induct to 3 " g: p6 B( Y* ~( j- x% m O
set A_i to 0
1 Y/ r% S! P, u2 h4 R$ o/ m2 v) B clone 1 load to P_induction2 w3 T; x: [9 p6 a5 h$ H2 _# y: j$ s
wait for A_time sec
& {. f4 x5 k8 L0 Z3 Z9 A5 w8 v end7 V# k; C. `- W6 K- h* H$ ?/ r
end9 i. |, y9 P9 @1 \. I0 r& Q6 G
. S2 l; t4 H6 q+ C! `
begin P_induction arriving
& J( A' R: Z" }& ^ if A_induct=1 then clone 1 load to P_pick1! y- u2 R2 L3 O5 d- @) k) x& o
else if A_induct=2 then clone 1 load to P_pick2
+ u, t, ~( h/ d2 j( x else clone 1 load to P_pick3
% S, _- k1 ]3 p+ R8 e- iend
% a/ y3 n$ o8 y1 B; w
E' |. W! N/ Fbegin P_pick1 arriving
& N2 g2 V1 C6 V set A_i to 1
7 ? ?4 A: ]$ M8 ~6 R) _4 u move into Q_induct1
+ P# r* N7 S+ w move into pickaisle.induct18 `% j( @# ]5 o/ e2 ~: L% V
while A_i<=30 do begin
{' @9 K- K8 f, L2 ]: }# l/ e travel to pickaisle.con(A_i)2 s: |3 z+ a/ c! Y {" `! R! P* I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; b; _( L3 [; y3 u8 \
else wait for 10 sec4 H* W- `8 f) ]; [/ `, _- s
if A_i=A_leave then send to die
9 y3 o# T2 j: |2 i* l2 v) M7 D3 V else inc A_i by 1
. h4 x! Z0 k# g. p2 L& D end0 W2 C! l$ R8 |, G: b
end1 _/ L; r* \0 s8 {
, q9 R; m: P8 w' L; X- m( `* a% cbegin P_pick2 arriving% m2 |0 P+ I8 D% C4 W
set A_i to 11
* i9 r5 H' n; Y move into Q_induct2
# ?/ w9 ]4 P+ M+ _" e move into pickaisle.induct2
2 T- {8 P7 O" `* F while A_i<=30 do begin$ D& w& F) B2 i8 L2 \; x/ r
travel to pickaisle.con(A_i)
. y5 W/ {+ G" d" B/ Y6 c% r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" x+ ?. K9 `1 q, U else wait for 10 sec
1 j" t1 H; p$ U if A_i=A_leave then send to die8 t# t+ D6 d) G+ _* m
else inc A_i by 1
5 W- A+ p1 F+ Y end& |4 q( V$ b/ @) L; p5 i" c
end
6 \8 x& S' b, w9 H6 t$ l) r: ]5 X2 _
begin P_pick3 arriving7 y6 s: |. y @( D. `* E
set A_i to 21$ E2 q' H# `: @: e
move into Q_induct3
0 R9 [- M% R! E move into pickaisle.induct3. e2 E/ _$ {8 P; {
while A_i<=30 do begin
& A: O% j7 _2 N: ^5 x: V travel to pickaisle.con(A_i)1 o; f, ^% i' x5 q) E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 z$ ~8 @) Y) ^% k- t6 w" j4 k
else wait for 10 sec$ Z' X% @3 j7 j& X$ i7 S$ h0 @
if A_i=A_leave then send to die; v+ e5 F4 A: a% g& C" t, F7 R
else inc A_i by 1
) B L& o8 X* X3 Y/ J/ j end
& ^/ K# ?# s$ L8 bend |
最佳答案
查看完整内容
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,其它按你的 ...
|