|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& f7 v( D: N% ?7 ]2 O; F* D" m
8 a0 h7 J) T( i# W. z+ r2 p我的问题是,在每个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中的数值,不知道会不会有什么不妥。: z5 t1 U- Z. ^
9 C7 Z6 F" c# O$ O" X. c. Lbegin P_read arriving
( `, R( e' D! Y% b while 1=1 do begin
# _3 |* f5 N G" Q; s0 n read A_tote from "data.txt" with delimiter "\n"
) V5 }" Z( E* ^& \ read A_time from "data.txt" with delimiter "\n"
0 Y$ e# r3 M* c" t; Q* m, m read A_leave from "data.txt" with delimiter "\n"
, {- O- R* i2 B read A_picks from "data.txt" with delimiter "\n"
3 ?& t( R- p8 N set load type to A_tote: s% u. I% {6 R: t
if A_tote="tote 1" then set A_induct to 1
+ i2 `( K0 \3 @2 ~ else if A_tote="tote 2" then set A_induct to 28 K6 ]& G# W( b( B2 m' F- B, e
else set A_induct to 3
+ m1 J. e) E* l. Y2 R set A_i to 0( B( f$ p. A* a+ G3 n$ ]
clone 1 load to P_induction
- R) I8 A3 P" R6 j# p wait for A_time sec6 ^* }6 I- \0 d# ~# {
end
7 P% B& ^# i$ M& M0 Zend3 O$ v2 e' B( ]5 Z6 a
8 y' c* R3 x4 y( ~1 K& c2 E
begin P_induction arriving* t4 B! o( x/ M1 v' U# j
if A_induct=1 then clone 1 load to P_pick1
* h# Q+ y' h$ T0 b& }9 {1 `3 _ else if A_induct=2 then clone 1 load to P_pick2
5 ~6 Z1 f4 x4 p, r5 y" |" j. U1 `% @ else clone 1 load to P_pick3
' G7 J4 O: E$ Q# G4 \4 \end. ]& Q+ c/ C) x6 p1 k O
7 i; H; r! R% b& Gbegin P_pick1 arriving1 m0 h' s" B0 ~
set A_i to 11 |7 ^' N( ~" R- M1 n
move into Q_induct1/ U" K ^7 i0 ~& I' f) J) W0 O! s; q
move into pickaisle.induct15 m- J6 T5 z2 ?1 S; e6 ^1 W
while A_i<=30 do begin
3 w- ]! e% T$ F$ W0 S# Y+ y travel to pickaisle.con(A_i)
) }: e* l, R1 l3 s; k1 }+ ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: J# w1 F, s- @" P6 d# H
else wait for 10 sec( E4 W1 h V9 z4 l% b1 ~
if A_i=A_leave then send to die: _- T$ H% t. A. [' ^9 M
else inc A_i by 1
& k. m5 M. U. r; N5 I) { end
4 p6 s1 B C: }end
, D- B1 K) L5 x# k$ \4 x" I( K. }8 Z% Z7 p4 h+ {' ?* P
begin P_pick2 arriving1 q. D- G5 a# i
set A_i to 11' w ]$ \0 ^" V- i, ^/ r) q# f
move into Q_induct2
$ p3 ~8 l3 M3 U7 P0 s move into pickaisle.induct2& q. N# L5 }: X0 q4 Q: h6 q& T
while A_i<=30 do begin/ Y8 y& \. a4 p% U% H% Y
travel to pickaisle.con(A_i), ]9 N2 e. g/ ?! N# y7 W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ g) z9 m& s, R" ^9 y( U. r+ C. q+ [
else wait for 10 sec4 {* z) h+ s* ^/ d
if A_i=A_leave then send to die" i4 Q* m5 S. c
else inc A_i by 1# i+ ^0 E9 H9 w& e) s( d3 e
end; y4 l. l; N* @! Y3 @- \4 d8 y
end
1 s0 C# E. B- b0 d+ E
3 j% ~; g- O) i5 Z" g1 Lbegin P_pick3 arriving
; y- g' h. F+ a- Z) F8 y5 Q set A_i to 21
$ S A+ |% x1 A/ O! s& K move into Q_induct3
3 a( P% R% `2 t, X' ]; \ move into pickaisle.induct3
/ L1 l- R% c0 ]* ~ e0 q while A_i<=30 do begin
# y. ? b# u2 b( m! k) b+ E travel to pickaisle.con(A_i)
0 g3 a! @: i8 P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 q( j T M$ s* e else wait for 10 sec) f: w' e% o1 M' Z' n5 l6 p+ c
if A_i=A_leave then send to die3 u7 O& D' T: S, k
else inc A_i by 1
' H) ~0 r) X3 [: L w; |4 n end6 M) f, d$ M# |! ^" y
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,其它按你的 ...
|