|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& R0 f: O0 D( \7 n7 T
2 |: y) U7 Q H/ A我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ d) h- v4 h9 C7 }( j( a# r$ C, f& Q# V6 X
begin P_read arriving4 b( @5 I: e, P7 L
while 1=1 do begin
5 e( C4 b( S3 ~/ }0 ] read A_tote from "data.txt" with delimiter "\n"
; w. N3 p( N; G3 s! r read A_time from "data.txt" with delimiter "\n"
- |& c# P( C! l; C, ]- l/ t read A_leave from "data.txt" with delimiter "\n"
$ r' T+ C/ ^: d- t& [ read A_picks from "data.txt" with delimiter "\n"
. U) E# K2 R* d# g1 w set load type to A_tote
. x; x" N0 k3 u1 s if A_tote="tote 1" then set A_induct to 1% \- r1 ?* S n) X, B( f! |; U
else if A_tote="tote 2" then set A_induct to 2
$ V4 X! `& t# r7 E else set A_induct to 3
! {- J0 \! Q& O! [( B& D set A_i to 07 z3 C/ w4 K* V/ a! R
clone 1 load to P_induction; D1 `2 g$ c+ ?7 l! a0 D2 X/ T
wait for A_time sec
/ W2 B$ q t* |9 C end2 P0 f, i& h! d- F- p8 P
end/ W4 C) L& b4 @! k1 \4 e
% q: {1 m, Q9 u! i- b! Dbegin P_induction arriving
% a1 Y: W, g2 t( i: y' `' H if A_induct=1 then clone 1 load to P_pick1
6 Q% Y5 G' Y2 I# [ else if A_induct=2 then clone 1 load to P_pick25 O% R$ J& C- n) j5 n b. i
else clone 1 load to P_pick3
: o5 @! E7 `' S0 |2 Aend
Y/ P! m4 Z, h7 d( T7 ]3 ?% ?: u: K) `+ d( r ~2 |. r. C
begin P_pick1 arriving
, d. Q: i3 ~8 `! x# G* H set A_i to 1
6 @ [, p( c& q0 p# G0 I3 j move into Q_induct1
3 o% y: U6 q' o- y; z* o& A move into pickaisle.induct1; |6 K: T% N" g- M: Z2 a
while A_i<=30 do begin0 V9 r A1 V: ^7 H0 I2 N
travel to pickaisle.con(A_i)! c6 w; a* j( W& Q% n3 \, `3 P3 y" f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
c3 ]. O* C1 g6 \ else wait for 10 sec& \1 B( z9 f; G0 G
if A_i=A_leave then send to die$ j, \$ `8 B+ C$ c' J' e
else inc A_i by 1& e7 L2 l, V( X" n
end
9 z7 x! m8 O. I# a' O. f+ @end& v4 A! v! C) T) L: u5 z$ w' J/ F! Q
) P& m7 | c% R- ?) u' E
begin P_pick2 arriving
* K3 w6 D; W5 b# w set A_i to 116 d# q4 z: `/ W$ ^
move into Q_induct24 F3 K7 C% K! Y
move into pickaisle.induct2
, e! j+ q! G: A+ x: B: D! y while A_i<=30 do begin
6 q: g. @; Z; e* M V travel to pickaisle.con(A_i)1 G9 |6 T9 z+ L5 ?8 P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# x9 h, o/ \) |5 L' z7 C4 i. Q
else wait for 10 sec
1 ]! u* B7 l# d- {+ a if A_i=A_leave then send to die2 ` c- C( ~, |1 N% p0 ^
else inc A_i by 1% c7 {, x# K- l$ ]5 h. l
end K( J0 g7 a! W% x: l
end
( z$ n" ~, Z+ O T7 X6 A
2 B6 W. F1 l! G; @begin P_pick3 arriving9 x3 G( x& j- ^( K" |
set A_i to 21
0 N, b+ ~, L( ~/ s4 k, x% H/ g& y move into Q_induct3
# M% D1 F- G; C+ S A" t J move into pickaisle.induct3
) \* f5 ~8 R4 W! h3 f/ @ while A_i<=30 do begin
2 `8 g* L5 l/ d. J% W( e n, d travel to pickaisle.con(A_i) @2 ^+ ?- I6 Q5 f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: r! X' B( O& B' W2 C/ N, m else wait for 10 sec
4 m+ Q# \1 P+ ?3 e if A_i=A_leave then send to die
1 \2 _( Z) b; k7 _; t( E else inc A_i by 1' k5 D' p* b u& P2 t% ]
end! j( N3 U8 }2 Q$ N
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,其它按你的 ...
|