|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" R5 e* r' }, P6 @' }8 a5 @- ^/ P; ^* t& K% y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 u z# B2 Q- n! m* T i3 I
: w+ J& Z w: W Mbegin P_read arriving
4 Y! M& e# k; I1 A while 1=1 do begin7 |* J% R% V( ^& y
read A_tote from "data.txt" with delimiter "\n"9 }" B- D2 k4 [1 ~, R
read A_time from "data.txt" with delimiter "\n"6 H2 w- w( V5 g5 @4 ?$ k: b7 l
read A_leave from "data.txt" with delimiter "\n"
; t" b* z" e! {+ [/ P# u8 x read A_picks from "data.txt" with delimiter "\n"/ w& [) M* K) w8 L# N% K, B8 P
set load type to A_tote
$ T1 P( f' p/ h if A_tote="tote 1" then set A_induct to 1; {4 u/ i- e/ _
else if A_tote="tote 2" then set A_induct to 2
' ^; b: [7 v3 t0 @9 p1 ^+ F$ x else set A_induct to 3 : }: P" ~( `. s. t; F5 L! z* g
set A_i to 0
: _0 x, ]! |, ?& U7 @* W clone 1 load to P_induction
% Q3 V4 [7 r& i, n9 [0 h wait for A_time sec
; ~6 {- U% H6 k/ f. ] end
5 ?9 I& B9 V5 B; ?end
% f) j1 I4 a% p; c4 ?" b4 y h) W: v( I
begin P_induction arriving
& U( F# @+ P9 O: h' B' h if A_induct=1 then clone 1 load to P_pick1
& Q+ x, F- z) L: t( S+ n- k else if A_induct=2 then clone 1 load to P_pick2
$ ^. v6 F- o6 n. E( R- K else clone 1 load to P_pick30 L' U* N- i+ a. G2 u6 [
end
* i; e/ D% S: l6 d/ G0 g, d
) u5 I* v) F7 b5 G( k3 [begin P_pick1 arriving0 ^9 }8 r' i, q, i! l) p& J0 F& {! K7 |
set A_i to 1/ x4 G+ f, q% c0 Y( y" v0 k
move into Q_induct1
^) c3 l" ]4 Q& Y move into pickaisle.induct1
9 f3 L( n' h3 t while A_i<=30 do begin
/ z; e% {6 e$ q travel to pickaisle.con(A_i)
! m" @# S) F0 N- m# f ?' P7 ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. w) C- d% a6 G' ?3 o% k s
else wait for 10 sec! I, x0 w8 l, ?% L# m- K: Q! c
if A_i=A_leave then send to die
6 ~; u+ O' x6 B2 S else inc A_i by 1
: `- E0 Y0 v. i4 i5 [+ o end4 O" S \( k2 q& x# Q
end" n, R$ t( r' p8 {
& p B( b! g: D* i+ N- @* t# N0 w& ]
begin P_pick2 arriving+ W2 U5 ^& ?3 f* J0 o1 J
set A_i to 11
$ A# M, U& p0 l$ W) c move into Q_induct2
9 x) ]& f* A$ P+ i3 x move into pickaisle.induct2
9 E: Z. B7 k/ X, H while A_i<=30 do begin6 G f) U2 q) x8 m2 A6 m J2 E
travel to pickaisle.con(A_i)
1 V# J; X( [5 K. V. E+ g' J7 g if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 x' S v" D1 Q% E
else wait for 10 sec
/ g, l& G* s+ F5 I if A_i=A_leave then send to die
6 v3 m+ E5 E0 d! ~ else inc A_i by 11 `" a4 h9 G$ e* o# _4 }
end
% v5 W* m, `& C- o4 G1 g; O5 `end
+ c Z- I( ]% S7 Q* C8 g6 |( B( `5 x2 O
begin P_pick3 arriving
- l8 C5 U5 c7 l0 f ]1 n set A_i to 21( \" J9 n2 u+ T' z3 Q: B2 K3 l+ M
move into Q_induct3
+ H0 [- K/ R v" t' n0 ^; c move into pickaisle.induct3
, O1 y" ]2 ^2 ~( q while A_i<=30 do begin/ t' q7 S' [( E: x8 o
travel to pickaisle.con(A_i): D/ u6 Y: \ y: g! z9 h1 S) q* U4 J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& ^% w( P% v( h+ C( n7 C# E else wait for 10 sec
3 `7 |' A% \4 U if A_i=A_leave then send to die$ H$ z# A2 }* y* i7 S6 A8 S2 b
else inc A_i by 1
9 i8 x% f1 w# w% n& E% t end
) O, d- Y: S0 P' Oend |
最佳答案
查看完整内容
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,其它按你的 ...
|