|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 S! }- Z1 Z8 A( K% @9 J m: v
- `/ u. }% x Q$ F我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* s5 \3 h( t8 l4 [" D
- j( X! R: }( ~6 ~; xbegin P_read arriving
; ^5 U/ o/ d( `8 d( \ while 1=1 do begin
( e8 I" Z9 U: ?' z read A_tote from "data.txt" with delimiter "\n"
( [! Q. B, F* n2 S4 P. L4 \ read A_time from "data.txt" with delimiter "\n"
4 {+ L8 p' z% L! F3 ] read A_leave from "data.txt" with delimiter "\n"
# d0 ~5 d4 l5 p' e+ W! |' |$ I read A_picks from "data.txt" with delimiter "\n"- ~* N0 H. f0 m' |: _3 F
set load type to A_tote
( Q( X0 E3 i$ |: w- F: ~$ z if A_tote="tote 1" then set A_induct to 1
6 z/ X! o' n! x4 r7 C4 T6 k$ i else if A_tote="tote 2" then set A_induct to 2, U3 t8 P0 B& | A: b7 {
else set A_induct to 3 B, l: z& e7 p3 h( i# i
set A_i to 0
0 m2 Z2 V# j; l8 A7 _- s clone 1 load to P_induction p8 ^$ Z5 R( s; O+ M
wait for A_time sec4 [ i# E0 `; l$ H A
end
6 a* l( u' ~% d4 xend
1 O+ I |& c1 ]6 ^" m4 m1 w. e) w9 Y2 z6 G" W+ v1 j
begin P_induction arriving4 q; J+ x, K' j) Z& @& |
if A_induct=1 then clone 1 load to P_pick1
) U: [8 c: O1 y else if A_induct=2 then clone 1 load to P_pick29 S. x% ]1 S+ r7 u
else clone 1 load to P_pick3
# N) c1 R+ d/ k: K2 B3 ~$ c) N6 ~' bend( b) U1 [0 m8 G* c5 B5 Q0 _7 R
: w& ?: k- c6 _8 q) U0 Ibegin P_pick1 arriving
' o: ^8 f$ s! S1 X set A_i to 19 L6 ^% |0 n4 T1 I8 g7 n" {5 E4 D; e
move into Q_induct1" V" A( h) W4 W# f: h
move into pickaisle.induct1
' `4 y$ J" m4 _. }* F, q; E# g while A_i<=30 do begin
9 L) I1 K% h; s) O! k8 x6 N) F travel to pickaisle.con(A_i)* v+ @6 s9 p6 i$ r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! U8 Z# D! s) X3 R* i% r! [
else wait for 10 sec
) y; u% B5 e/ J( D/ O if A_i=A_leave then send to die' Y: ?$ R. k" F8 d
else inc A_i by 1
3 ?$ P& `6 }; v% h* _# _0 A: l end( r2 C: D8 |; w: l
end9 l9 H8 f+ n0 q q3 _0 f4 }8 D1 W
, ]4 Z2 f8 y+ r7 j( d+ t
begin P_pick2 arriving2 J6 b% v& ~6 S* X! \, y- d4 T
set A_i to 11) G+ P$ I( r8 t) U6 E/ n
move into Q_induct2
0 S5 @# _2 q" d$ B move into pickaisle.induct2
( k( l& w9 ^0 u/ w$ e while A_i<=30 do begin& {7 d$ B( S# k. b1 e6 L
travel to pickaisle.con(A_i)2 A/ y; D8 P2 u( F
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 M8 M" ?$ E/ q' K& \& I' P0 x. R else wait for 10 sec9 P4 K% W" p& c+ Y* M
if A_i=A_leave then send to die
4 K4 |1 L5 o" R( c: S else inc A_i by 13 Z/ Y/ y4 T( y$ |
end
% b1 C+ b: k5 s. e |end' G/ G/ `3 F. s1 g: s
5 |+ b0 c p5 S ^- f3 D! K: G
begin P_pick3 arriving
0 Y) `3 y% c9 S. |& K set A_i to 21
G6 V6 Q* c `( L move into Q_induct3
* `6 Q6 T Q8 b: s. J move into pickaisle.induct3
) f6 r# W7 e! p6 `% p while A_i<=30 do begin+ U# j5 [" [7 `6 T- i7 r$ O
travel to pickaisle.con(A_i)
4 t1 _: g r1 i% P( _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 Q4 I- c i/ }8 o
else wait for 10 sec
3 ]$ O0 l7 j8 V! h if A_i=A_leave then send to die" `3 V4 t: ]& x M+ q2 r
else inc A_i by 1
$ i" g8 L) z' S( r- ~ end6 a# Z& D, w1 R" A/ {* b, f: o
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,其它按你的 ...
|