|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% |+ q* {' K2 [2 g2 c+ F- G+ n
! x1 m3 ]+ D3 L1 V' S( B: C
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 ^3 H: j: Q& k3 M/ o7 `6 ]; k S0 V. [! `! q
begin P_read arriving% |0 I" G, z4 R" Q* _& `' f
while 1=1 do begin) w, |3 t2 K9 b
read A_tote from "data.txt" with delimiter "\n"
- x- ]( R8 w# o( s' I read A_time from "data.txt" with delimiter "\n"
7 r' Z; w9 t" D' v read A_leave from "data.txt" with delimiter "\n"" K4 {0 u: }+ r/ f! ^8 Q& ^$ L0 p
read A_picks from "data.txt" with delimiter "\n"
9 O- u/ L: N9 u! f2 G6 \ set load type to A_tote
! ~. u4 Q6 S) S if A_tote="tote 1" then set A_induct to 1% Y% ^1 `5 N3 U F% [
else if A_tote="tote 2" then set A_induct to 24 L% f" `8 ^; N7 o x Q' g& }
else set A_induct to 3
3 k3 ? X4 j2 Q) C E, j# v set A_i to 0
7 H n2 A. p3 F# @2 W1 m clone 1 load to P_induction) \: O& k5 m5 q( n, \5 Y$ i
wait for A_time sec
$ M" T+ W! S+ _ end
- m1 T5 E, `7 x0 X+ d+ Q% y: aend
$ b* l5 q2 I/ Q' I& B% l6 H9 G" O4 F0 H1 O/ Y# `! I4 U' n1 A
begin P_induction arriving0 N& a8 E f6 {$ Y9 |9 Q
if A_induct=1 then clone 1 load to P_pick1* u/ I- N# a* T6 y+ I
else if A_induct=2 then clone 1 load to P_pick2
2 C+ t; ]& }8 S# ~- r4 n4 G else clone 1 load to P_pick3 i3 c5 B( R* [6 j+ S h+ {
end- g$ o( n4 }2 d7 W& [2 \$ D" t
/ V6 z! W+ V& T/ |) x ]begin P_pick1 arriving B4 Q( f3 |) r2 i
set A_i to 1* s( t K- J& j
move into Q_induct1
; V+ c8 v3 t, ? ]/ p% b6 U; {& E move into pickaisle.induct1
) y2 a- e4 w0 A( F/ _- ?# v0 |( D while A_i<=30 do begin% N& |8 z1 T4 ]8 K9 o6 }, g9 h/ Z
travel to pickaisle.con(A_i)* v; z/ L+ ?1 ]- f9 g0 E2 @9 H: D* ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: j$ C+ h$ O* F' w' g4 z, ] else wait for 10 sec; j* V# u8 ~$ r! A/ W
if A_i=A_leave then send to die
A/ Y3 _$ x/ ^' q& r2 K+ P else inc A_i by 17 u: n6 J w( `, G2 B- X
end p- O& O/ |' s; I) K
end5 `& x* @6 T! A; X
3 F0 A! m" y9 E, \begin P_pick2 arriving
1 w" R) I* O& i0 x! C. C3 N$ k, r4 | set A_i to 11
W G4 ~3 @ } move into Q_induct29 Z% Y$ S1 ?' F
move into pickaisle.induct2! c4 g# a3 u0 {/ L
while A_i<=30 do begin
, x( M6 b8 h' Q F5 y travel to pickaisle.con(A_i); } d! S ]3 U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 {9 a7 n8 _- u1 X. s n& g& j- z
else wait for 10 sec" B: H5 ]! p$ Q& k, N8 g
if A_i=A_leave then send to die# V. ?; q/ n/ O
else inc A_i by 1
! j; H* C: g9 f, R' w) d+ i6 h; V4 H end
1 x7 [' N. M1 g2 n$ @7 mend
5 U- y$ Y# ], N) \
, O0 Z# ?- J! v! @begin P_pick3 arriving$ ?* z4 D Z& ~( G1 J* Y
set A_i to 218 o1 M/ p3 P' r0 G6 p: O
move into Q_induct36 w! |) {$ m. W
move into pickaisle.induct3
% G) Q7 X5 c$ M7 u* N3 V, M while A_i<=30 do begin, k, o$ P+ ~# y0 o8 m2 B; a7 g; x! u
travel to pickaisle.con(A_i)
" E# d. D) u6 ?- k; Z ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ G) Y' _4 N; O$ d! v, @4 A. b
else wait for 10 sec
& \6 d; E c$ S \+ i if A_i=A_leave then send to die( J: @* u0 p+ q7 a& k
else inc A_i by 1$ N/ D: P9 E$ M3 H! Y
end6 A* d1 G( [/ B% e
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,其它按你的 ...
|