|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% h q1 R9 q- Z6 r1 Q5 d
5 [; `/ u4 n2 D4 W0 m我的问题是,在每个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中的数值,不知道会不会有什么不妥。( l% b: T, S4 z! @. q K# d
' y6 I% `- H1 W' s3 n% S6 Zbegin P_read arriving# c$ |9 s3 `: J5 [
while 1=1 do begin2 E) n! U$ m; N
read A_tote from "data.txt" with delimiter "\n"
( A c, Y$ E+ S" ~$ E m# A6 ]' h read A_time from "data.txt" with delimiter "\n"
+ x$ }$ _3 O" ?/ l5 v read A_leave from "data.txt" with delimiter "\n"
6 | ?" k' A* H: J. N read A_picks from "data.txt" with delimiter "\n"
2 ]7 r1 n$ n2 K, h1 K! v set load type to A_tote. e6 T2 W9 f# F- ^
if A_tote="tote 1" then set A_induct to 1* _, c; E) L7 ]& Z
else if A_tote="tote 2" then set A_induct to 22 v( T; z7 m8 z. t! q7 f8 o
else set A_induct to 3
7 z0 F$ K) @' K& A set A_i to 0% p5 \: Y, l* D( b" b5 b+ N/ {
clone 1 load to P_induction* E% z3 M f I7 S' R" J& Z
wait for A_time sec$ i- e, r: j& M/ N
end
0 f/ G X; C: J7 {( Rend5 c; Q. B5 Y [
$ F8 P y* e! w6 W4 s% S: T/ j7 ]
begin P_induction arriving3 d& G, B9 Y8 p; i5 `8 @
if A_induct=1 then clone 1 load to P_pick1# z1 p' y' y) `6 M* m) C
else if A_induct=2 then clone 1 load to P_pick2
. o! }+ G. ~9 ^& y else clone 1 load to P_pick3
" G: ] h1 Q" W, g/ L/ Yend
9 \ Z S; a3 f4 ^' V8 H8 ]( g' b
1 @& S ?/ Z9 r7 o( B$ y: ]" kbegin P_pick1 arriving
7 Z$ p6 t0 j8 G7 W7 ]$ | set A_i to 1
2 E$ h$ y4 z4 ~/ y& t! P; \ move into Q_induct1
+ R b; V3 C0 P+ m2 ~ move into pickaisle.induct1
2 M: |4 P, u% Q# \; T while A_i<=30 do begin4 ~$ n" I' M. T' h5 |0 y' Y, [
travel to pickaisle.con(A_i)
% ]: p3 g8 L; [# r: N8 Q/ ?' q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& l" d. e& E/ g0 G! ^8 y; |
else wait for 10 sec
( c' Q0 B- `# M5 X3 ]5 v6 t( T' R if A_i=A_leave then send to die, w; m2 F3 c! P5 Q
else inc A_i by 12 P& ]; t4 F- |4 {" f
end
, p# H3 t1 E G N8 X; kend
& {) `/ d; q+ b0 r$ S: ]2 m% X
d9 x7 c5 ^) c Z& u; m; ybegin P_pick2 arriving
3 t s, M0 D$ n2 {8 C set A_i to 11
: q8 M4 t' u1 v. k move into Q_induct23 U, k4 V( g! a
move into pickaisle.induct28 F2 h( D, Y2 f( z3 O
while A_i<=30 do begin0 q; X7 p4 C: H* C1 e; Q
travel to pickaisle.con(A_i)( Z. p J$ |( h; c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- Z9 ~% O6 s0 S8 E. k; f
else wait for 10 sec
( s5 k2 C, c+ G; e: u if A_i=A_leave then send to die: D; z6 k' Q) T) S7 l
else inc A_i by 1
4 F3 x+ x2 N8 H$ R7 r* c end; b K V) S. M4 \( }$ a
end. G$ ^- _! W# C0 c
8 y1 \/ X% `/ \begin P_pick3 arriving
, p s. E: B- @) e1 J, Z set A_i to 21
; U' w4 S/ d2 o1 A8 D7 v; R move into Q_induct3. K$ d2 U' K# x- A3 R+ p
move into pickaisle.induct3
1 {3 D, H$ q/ f) I while A_i<=30 do begin$ b* v+ v( p7 U' _5 f
travel to pickaisle.con(A_i)
7 z( `( r; X" N3 {+ o. e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 ~3 V( V" \" a2 X& q" p# V0 [ else wait for 10 sec
/ }+ g% i* h+ I9 E if A_i=A_leave then send to die$ D9 J/ h e! c5 F- E
else inc A_i by 1
4 v. a6 v- c3 T L8 Y c end
, m1 Z' P) D& v% K8 Vend |
最佳答案
查看完整内容
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,其它按你的 ...
|