|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 @6 o/ {$ b* ^# k' O. Z- {5 p. R1 Q" H* ~
我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 D5 Q& k+ l- V
, }% z2 S5 C F' p* F3 tbegin P_read arriving
( S! t! Z% }4 [9 f$ s" v5 e$ L9 z6 R while 1=1 do begin
7 I/ C, m; Y: M. J: W3 G" W read A_tote from "data.txt" with delimiter "\n"2 Q$ c; N+ ~' A l5 d3 e
read A_time from "data.txt" with delimiter "\n"
) \7 O) a/ O. V& I( N1 |, ] read A_leave from "data.txt" with delimiter "\n"
, ]# [: U8 G, ~ _6 u. t read A_picks from "data.txt" with delimiter "\n"
, z4 \8 R q9 C5 ?( f! j3 T3 r set load type to A_tote9 V( C! @6 S3 T, {: o8 o2 u
if A_tote="tote 1" then set A_induct to 1
, O/ ?2 K4 a$ d" W0 Z7 y else if A_tote="tote 2" then set A_induct to 2# A3 H1 F8 y0 l8 D( S
else set A_induct to 3
' E" I: N) O) z5 ]' b- U. M set A_i to 0- q. c; J1 y* e
clone 1 load to P_induction0 |. h, O8 f* w: v0 ~/ Q
wait for A_time sec
% |9 |! i( w% Q' c K! _4 s6 ?3 A" u end
) I1 r7 o* z. D1 t' wend
% ~/ T) q+ g2 {9 V
0 S* \% k8 {9 s% [% Q0 Sbegin P_induction arriving
8 z* @; W' V) s! N- U/ f if A_induct=1 then clone 1 load to P_pick10 R( L; i R, \' _0 k& i' H
else if A_induct=2 then clone 1 load to P_pick2
/ m2 J) w) l( E, R, Q- L( L& B else clone 1 load to P_pick3
2 b+ i0 u/ W4 ?- a9 Z$ Rend
: |$ H5 Q, [1 |* a3 o
9 f' d% ~( V1 T T) H9 @" B! qbegin P_pick1 arriving
5 P, Y, U% x: V+ z+ F: B0 U set A_i to 1
: }) G( h1 D; \0 r move into Q_induct1! Z+ D- V# D0 T/ r& W5 w4 j
move into pickaisle.induct1+ j) N, \% K7 }* f5 X
while A_i<=30 do begin1 B8 u* @' M( O
travel to pickaisle.con(A_i)
9 z/ r! |& h% }) i1 S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( L/ C7 I+ ^& I' z( S& g' o( G else wait for 10 sec
: N6 s' M! ^1 m# Z/ _, J. j8 P; r if A_i=A_leave then send to die# n' o+ A) _5 C
else inc A_i by 1
6 \- ?% H a' p5 O8 W* C end! n" u. g! B( @' R1 F' N L/ W* y
end
2 m3 I1 j5 b8 Y! I6 k' W3 I+ Z/ a* F
begin P_pick2 arriving6 p0 a) b- b" A/ V" U% X' q
set A_i to 11
- `* g: y, [; U4 s5 C" g move into Q_induct2; z/ Q! I# o2 W4 T I
move into pickaisle.induct2, w2 p8 S% n4 r7 u. Y& F% _9 E0 I+ x$ |
while A_i<=30 do begin
8 u+ |2 Z3 m+ g! D. ]5 | travel to pickaisle.con(A_i)
4 v9 I* r8 A5 L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ h; y% f$ e1 q7 c( Y+ \- ~6 _
else wait for 10 sec
- I" H. A$ a% q1 }2 W; H if A_i=A_leave then send to die# S6 R5 O5 A- Y9 b4 @1 I
else inc A_i by 1
1 r3 O* {) Z1 W- D( F( Z' L# r$ w end
' l/ \9 q6 E! s. eend5 C C; P1 G2 r/ B5 W6 h* z+ T
7 s" K( {5 T. F% V+ _- m
begin P_pick3 arriving
/ d9 k9 k* M$ E7 x7 Z set A_i to 21
9 G0 O" F! v1 x move into Q_induct3! u% q- j( ^8 I4 I7 F t+ S
move into pickaisle.induct3
8 T; z; j8 R2 L$ i; r while A_i<=30 do begin
. O, e8 p& u9 G' f2 H6 ]5 I; v travel to pickaisle.con(A_i)4 ^/ @% g+ z9 i' e' Q, P V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec a* \5 m4 l+ |5 [* f+ D
else wait for 10 sec4 |- K7 f+ p) w7 Z( f
if A_i=A_leave then send to die
6 y2 e3 k! l V* ]% V$ J, r9 Z else inc A_i by 1* [4 r9 X# B# B' r" ]8 w
end
) u* h- K( m! W5 Uend |
最佳答案
查看完整内容
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,其它按你的 ...
|