|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) G0 ?5 }5 }% E! w$ N
' o$ S$ I. s+ N我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 V8 L, _! M( g8 F
5 V$ P2 h3 `1 h8 {begin P_read arriving, V1 z+ ]3 `* i/ M
while 1=1 do begin' ^* R2 m. Q k3 n7 ^6 f
read A_tote from "data.txt" with delimiter "\n"+ U) D% A" C2 D6 D* T& \
read A_time from "data.txt" with delimiter "\n"
, v1 l8 j; {, c! j N' Y read A_leave from "data.txt" with delimiter "\n"8 h+ j5 v0 ?( u1 i
read A_picks from "data.txt" with delimiter "\n"
- f- }" o2 F z2 O, |( k set load type to A_tote& q8 h4 D4 _( X
if A_tote="tote 1" then set A_induct to 1) m0 M8 f3 J/ ]9 J6 K
else if A_tote="tote 2" then set A_induct to 2# C1 K# F* p! Q7 @) u4 x5 _4 w
else set A_induct to 3
5 j+ N p# h8 H; y set A_i to 0
. z6 L) j' p0 j/ H8 A1 m clone 1 load to P_induction& b. x( Y5 o! X- j8 Z
wait for A_time sec
: L3 |: F3 J) w end
" \% x! G. K6 y& w n6 k( Dend; P1 F6 P; z' e
' N2 N" t) `- h4 F3 c
begin P_induction arriving
% n- u% X& c# a _, p v if A_induct=1 then clone 1 load to P_pick1
; q* Z3 q7 I- m) ~ else if A_induct=2 then clone 1 load to P_pick2+ f' l( y% K, e! B; j/ P( g
else clone 1 load to P_pick35 @" A8 i+ ?9 u" j7 j
end
. c7 e$ Y/ H8 S# z( K" p* [- F9 ?$ {1 K
begin P_pick1 arriving6 c/ Y5 {9 y6 a9 h
set A_i to 1; y% X8 B" `% `; u: a
move into Q_induct1
) Z. j" q2 O8 ]9 [1 J* I move into pickaisle.induct1% b# R, s& v+ M% z: r" ^+ T$ l$ T
while A_i<=30 do begin$ w6 d& y- T& Q5 ?1 K8 d$ d" i( A
travel to pickaisle.con(A_i). Y1 F- l/ U+ ?9 \4 Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 M3 L7 ]" m/ Y4 D u else wait for 10 sec
" E7 ]3 _+ B! O8 A$ m+ v9 p" D if A_i=A_leave then send to die$ C- E, p8 m! e' S# b7 ?
else inc A_i by 16 b' E1 Q% [( u3 L) Z% G8 G8 v: ~
end3 j; }+ W A1 Y! k b2 l) J
end2 y" I0 g0 a! K6 x
1 E6 p1 i5 @& h9 V- _begin P_pick2 arriving2 {. @ d( ]% u9 t p, v
set A_i to 11
/ ^: b$ z6 ~& V; A: k* B move into Q_induct2, f ^+ |5 i( w4 Y% d
move into pickaisle.induct24 U4 B* j6 z5 d! S
while A_i<=30 do begin
; e) Z: O" p1 t travel to pickaisle.con(A_i)
6 |( r E* z; e5 t9 Q% V: b3 s if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ m; W! F+ k4 o) Q
else wait for 10 sec
5 k5 N, u$ E8 W, z; f: m; \9 L) N if A_i=A_leave then send to die
: T- M6 o" `; f# T- e; O2 r( k% B else inc A_i by 1
: ~6 {: `- X; I* {# l end
6 d8 e5 ^3 W: l8 o( I5 tend
2 H( B/ }6 I! i: o* ]/ H
3 A p# v7 Z w4 jbegin P_pick3 arriving
% g; e( r, P* g& x( P% T' j( z set A_i to 21
z1 o( d* h' e, u m move into Q_induct3
) Z S; _* L% d move into pickaisle.induct3' x6 H6 e$ k$ X7 g
while A_i<=30 do begin
6 @/ r# W! ]6 y* _" V travel to pickaisle.con(A_i)
' K: z1 n I, f! v; M0 s# L0 L w if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 l7 d7 ^' [( x8 P3 f8 f
else wait for 10 sec
* A( }& p0 k3 A7 a* P if A_i=A_leave then send to die3 C3 L& }( t* o1 Y! |9 u
else inc A_i by 12 b+ _) o1 P, M1 n3 k* l4 Q
end* x" w$ t! I9 `, ] L' 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,其它按你的 ...
|