|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 V7 d. o* j) Z
2 E- \* f7 R3 ~$ S, j) t0 T我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# r) r$ M, ~0 J# A7 w/ K2 G2 p
+ X0 R/ I0 |% N8 \ ^" S6 H" e$ n8 jbegin P_read arriving$ o% u3 Q' N0 ^& {4 E3 L
while 1=1 do begin
0 ]6 v, p2 y$ {$ L8 n( d5 i read A_tote from "data.txt" with delimiter "\n"
) O7 C0 W3 g: M8 h @8 \1 k read A_time from "data.txt" with delimiter "\n"
0 k4 A4 V/ B9 a+ v& w read A_leave from "data.txt" with delimiter "\n"" N, g' [4 I4 p9 U8 U8 d
read A_picks from "data.txt" with delimiter "\n"
' g1 u# z5 R6 m# j$ I- W f set load type to A_tote3 u, E1 z! g! D8 S
if A_tote="tote 1" then set A_induct to 1+ ?% i: ~& ~7 T9 G9 J: s
else if A_tote="tote 2" then set A_induct to 2
2 s6 J- a6 O( H7 E& y! d else set A_induct to 3 ; o0 W* q3 o- n H( B% s
set A_i to 0
- e3 m' g) `2 `1 ]/ r( S/ h clone 1 load to P_induction/ p& Z9 P& w7 C
wait for A_time sec
$ D4 J7 A/ K* w# ]9 ^ end- i8 I4 n: |$ l
end; y/ s9 S4 p. A- x# k) i' l; G" v
0 b. q2 A- ~# N% ?/ p+ |begin P_induction arriving& ?% |& H1 `& Y% o9 r
if A_induct=1 then clone 1 load to P_pick1& t( ]/ \) H/ p+ r
else if A_induct=2 then clone 1 load to P_pick2
1 b% ]' H2 ~; d, ?. C) l# G else clone 1 load to P_pick3
, D+ G0 C& E' Q: n I4 pend
|3 c0 f/ x* N6 _' U) j
) T+ j0 N5 j/ c$ Pbegin P_pick1 arriving
% T; J! X3 u6 w) c set A_i to 1! H8 x; d; `$ |1 N$ y3 V& e
move into Q_induct1( k( h. t9 k, `5 J- K3 x$ a
move into pickaisle.induct1- Z3 ~2 c+ E2 J/ Q: t3 K! f! J
while A_i<=30 do begin5 b- V$ R2 Q6 o/ p+ \
travel to pickaisle.con(A_i)
# {; p6 ], e+ b4 |/ c- A if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% h% J5 L" f$ Y else wait for 10 sec5 d n% G) J- @+ U; b
if A_i=A_leave then send to die
$ F3 x& f2 n- b else inc A_i by 1
' ^4 Y( q/ S: ]0 ^# q$ E+ r# N end
9 I. C% b1 y; u1 I, aend
: [; O9 v. {& F' L4 A! _4 T7 J4 Y b' I3 ~: f: a- f! [; d- Z
begin P_pick2 arriving- ]. B4 ?( K# c9 f9 ?; H3 z$ ?5 A
set A_i to 11
f3 E6 y& b$ N! @7 h1 \ move into Q_induct2
0 W+ Z% |& F( t5 S' E2 z move into pickaisle.induct2
# o$ z9 s/ N' h) c while A_i<=30 do begin5 N, \8 n9 V3 }3 k1 N) ~* u9 r
travel to pickaisle.con(A_i)
1 _- a- N! D( R. e: I3 ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ X: F" h( m# i: k B0 i; H else wait for 10 sec& T0 M7 G1 Y. H9 h2 Y$ a
if A_i=A_leave then send to die
% k' Y7 C6 _" _$ f/ k else inc A_i by 1
" E- c- `; b* F1 n! f1 { end
. P9 S, C4 f5 G7 J8 Y% h9 Yend
( G$ K: L) P: G2 p5 A3 ]
. [8 A5 ]0 e2 Lbegin P_pick3 arriving% w/ {, h9 y( C
set A_i to 21
" }, L M1 q% s9 g move into Q_induct3" b. \: B9 R) u% D$ Z1 K2 k
move into pickaisle.induct3/ a! B9 P' F" s# x& Z* w
while A_i<=30 do begin: P$ t0 a+ c! G$ G4 Y* A- S6 y
travel to pickaisle.con(A_i)7 s2 z8 c1 \. |* L) y; n) X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) J2 f( R# ~( ~& Y, A$ d else wait for 10 sec
7 X2 Z. B* ?5 H% I4 ]" m4 W% h if A_i=A_leave then send to die" x* b$ ]' N4 H& Q7 ]3 E# q) P( k
else inc A_i by 1
) M/ l% Y$ o# D end
6 b+ Y: e: W) {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,其它按你的 ...
|