|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ P% E, ?/ H3 F2 j9 E) Y
7 V2 Z( u# _. D9 u, {我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 W+ h, t" U& _6 B2 `- o% N& W7 R! V# Q; W
begin P_read arriving a7 D: C9 ]9 L
while 1=1 do begin
6 t" b5 _3 O A7 ]: G read A_tote from "data.txt" with delimiter "\n"
' K* i7 R8 A r$ k3 C read A_time from "data.txt" with delimiter "\n": @: Z, } ^, N+ `! C% G
read A_leave from "data.txt" with delimiter "\n"
2 t) [2 g" ^& F/ `( [* r4 e read A_picks from "data.txt" with delimiter "\n"
9 u% U5 i2 F0 u q1 g5 x set load type to A_tote
, {" p% E& P0 j. H% \. w$ l9 W) H if A_tote="tote 1" then set A_induct to 1
& u# e1 e8 [1 D else if A_tote="tote 2" then set A_induct to 2
7 y1 U/ w- D: r" e else set A_induct to 3
/ \; j& J5 t! S1 l/ O2 y8 R set A_i to 0
: H* I( V0 Z! s1 `9 | clone 1 load to P_induction
* y& J5 p, U% ^1 b wait for A_time sec) y5 P3 ~/ m3 L
end0 z( J" V0 @: G; e8 r! O: a8 s' a# U
end
4 Q( j3 O7 j& k7 y
% C; l1 u; X' ~" i. i" u7 ?7 Gbegin P_induction arriving
3 b7 L/ L9 {8 [# n9 A if A_induct=1 then clone 1 load to P_pick1
9 Z2 T+ `6 p; h7 N else if A_induct=2 then clone 1 load to P_pick2
; p" Q1 | W$ a! {/ n! t4 z else clone 1 load to P_pick36 m1 p1 N0 s. k
end
* _ g \. d" L& g4 a
2 C* Q" q; g2 k$ U8 tbegin P_pick1 arriving
}+ R/ M! D6 Y% k set A_i to 1
/ y; l2 [/ C. Y' C a( z move into Q_induct1
2 @! W0 a, W& w9 M move into pickaisle.induct1
' F' M( ]$ B4 {* j while A_i<=30 do begin4 `. }0 ^8 |& X& e
travel to pickaisle.con(A_i)+ J1 O0 Q; X+ W. {4 \* K _% e, Z% S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 y6 Q- K& v" \5 }+ j; H$ l6 \- `
else wait for 10 sec
% ?/ d( A' k- j8 s: B. }8 V if A_i=A_leave then send to die
+ s* A( ~& ]' Q' h. O8 I9 ^+ v0 o else inc A_i by 1
% r7 }$ v& i4 Q2 Y, w end
, B6 Q7 r) h# F% a5 fend5 N/ e( Q3 U5 i8 [0 X/ H* n
- \! L; J1 E8 o7 k/ ebegin P_pick2 arriving
3 a) c; e$ r, y set A_i to 117 E7 x. i7 d/ ]/ H" a
move into Q_induct2, C2 ^8 e T% O8 R q+ b
move into pickaisle.induct2
3 v8 \1 t8 T* R' n9 i; S+ D while A_i<=30 do begin
7 m3 I( i- c* U% a8 V* O travel to pickaisle.con(A_i)) I& R' M8 p. L% p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, Y1 P: d N3 { A* ^: ~
else wait for 10 sec$ k+ B" {+ x `6 S
if A_i=A_leave then send to die
7 |! W+ u+ S; w% v else inc A_i by 1
. ~, Z, C: c* _# i# u end
" q# b0 x; S1 y4 zend( w" q3 _4 |$ L1 q% Q! [/ K3 V
. C* N$ z6 V5 g3 }! Q) U& K( i+ Vbegin P_pick3 arriving0 J/ t8 B$ W3 u4 p7 ^$ Z \
set A_i to 214 \7 }% D3 W$ V( r O$ b D
move into Q_induct3" [5 l* h* l" x d* e0 _
move into pickaisle.induct3" _) y7 Y8 p7 a/ v/ e% P- U! P
while A_i<=30 do begin
, ?# H- S0 ^# {2 B3 B travel to pickaisle.con(A_i)
8 a5 a$ Y, L$ B$ O. h Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 N# ]- x1 C2 F7 R' E& u else wait for 10 sec
' V8 I2 w% x) u5 J if A_i=A_leave then send to die
, S2 F! l* q3 Q3 ^; X# Y else inc A_i by 1. x i6 b: @: X3 M! }& `* t# N% O
end: Y9 d4 V, Y$ E- G0 F3 L
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,其它按你的 ...
|