|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 L8 a. C) B; M% Q% U& ^
& H/ L$ h9 A: q1 b$ `
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! X7 S: Y3 Q8 M
8 Q2 l/ @/ f0 s
begin P_read arriving1 T; V* b: |# N7 a- Q
while 1=1 do begin) _5 m1 S- n6 Y$ {; U
read A_tote from "data.txt" with delimiter "\n"
1 a/ `) l0 X9 b/ j read A_time from "data.txt" with delimiter "\n"
* \6 ^( r1 g2 G2 B) j2 D7 n read A_leave from "data.txt" with delimiter "\n"9 q4 w9 i& B* o3 x& n
read A_picks from "data.txt" with delimiter "\n"
) r r: `7 L! P set load type to A_tote
; m6 T+ B/ w$ R& g1 p3 h if A_tote="tote 1" then set A_induct to 1
. P6 q& x }% i4 ]- t% u) h. c) B else if A_tote="tote 2" then set A_induct to 2
2 z' P+ t0 k; J. X& f else set A_induct to 3
# o' i) h+ c+ r' Q) B: _ set A_i to 0) c% o* A* Y& o: D a% \' F7 R
clone 1 load to P_induction
4 i7 _: I' N8 |) T5 L wait for A_time sec
$ G3 t% P$ p* F( u end
, v. y! {* z. {" Qend
- i5 b$ d, X6 a* J4 m6 Y2 ^4 g0 f2 s9 @5 C
begin P_induction arriving* \! t0 l2 K! @
if A_induct=1 then clone 1 load to P_pick1) z( L6 F; v8 ^( g" B) H0 h5 |
else if A_induct=2 then clone 1 load to P_pick2' A7 |, S# E' T+ q
else clone 1 load to P_pick3
0 f1 H% K/ c( M. pend9 |! p) A& |% q$ W
: _+ U; D2 ] cbegin P_pick1 arriving- K) F$ {0 |% ]% F7 x9 _
set A_i to 1
4 @' r5 W2 T2 s0 E [& I9 g move into Q_induct1: I$ y- O6 w# Y1 Z' K' Z/ O
move into pickaisle.induct1
1 E* T$ q; }7 e" p% z) s" V while A_i<=30 do begin
( I9 }# h r9 G5 P% X6 [6 [ travel to pickaisle.con(A_i)5 \, w5 N* ^- x0 U% a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 Q N) M4 p4 g! w else wait for 10 sec4 w+ @9 A6 k$ J8 Q* a7 B
if A_i=A_leave then send to die. o+ @4 F. S+ S" r7 J
else inc A_i by 1+ ?. _2 d5 V9 L# t7 O! [
end
) C' W% T: Y5 U4 [$ }& ~2 H Uend" p$ C& C; m% O B3 s
# T! B( j* ^" c( V' i: u4 B0 kbegin P_pick2 arriving
3 d7 c# z h: D$ t1 v set A_i to 11
5 U" O6 t# k1 ]! k" b3 Q8 @ move into Q_induct29 u5 a' ^; J T2 M
move into pickaisle.induct2
. S, `9 F q8 {9 ~ h. b( C) E3 c' P while A_i<=30 do begin% t5 T) d2 r W
travel to pickaisle.con(A_i)
( l% o( d: V4 X% t* Y( e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ M, A! F' z0 L7 c. u* G) V4 d' I3 [
else wait for 10 sec
, ]0 ?6 I! F- j S/ N if A_i=A_leave then send to die
0 ?$ @' | z* P1 k& F2 c, F, C8 T3 B else inc A_i by 1
% N* l. E) n) |6 M. r end
; \! x/ m$ p: H! m% E9 {end
! s4 g/ S$ D4 g4 a$ c( N" E' p2 K" u7 ?0 L# n* z* S! v6 y
begin P_pick3 arriving: Z* ` Q9 F. l6 R7 A
set A_i to 21
. }8 t% V! V) M move into Q_induct3
- J; k: D- K! p' ] move into pickaisle.induct3
) P O6 t, J! ]; m" h while A_i<=30 do begin
" [4 }: B5 b! D4 t, @ travel to pickaisle.con(A_i)8 p# t" J" c4 U) |. }$ F* H, \4 B6 h
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 H" [2 Z8 q b; u
else wait for 10 sec+ C: R# J M" u& s
if A_i=A_leave then send to die( X: D3 m w) E( {" _2 r
else inc A_i by 17 o1 Z0 x# V1 o$ M0 Z' n
end
9 X5 `& S5 R3 t3 B p6 h% N9 Wend |
最佳答案
查看完整内容
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,其它按你的 ...
|