|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: |! ~" k, q$ Y6 O, V$ o2 S' l
+ M) k' a: \& e% F7 N. ]% 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中的数值,不知道会不会有什么不妥。7 q0 _& f$ E O' h( C
% Z! N0 t1 A E: v0 h- Dbegin P_read arriving
/ w6 R2 `5 V0 }7 S* G while 1=1 do begin/ O. C% O' v1 x7 H! @
read A_tote from "data.txt" with delimiter "\n": V5 E, m( U2 |# q1 Z% C8 C
read A_time from "data.txt" with delimiter "\n"0 B# Q6 R% x2 G
read A_leave from "data.txt" with delimiter "\n"2 v, a$ f0 ^, s# K: S9 i! G0 k- h
read A_picks from "data.txt" with delimiter "\n"- E& k3 @( \8 t
set load type to A_tote
4 a0 q4 J5 c2 H# ]& _# C# u$ \ if A_tote="tote 1" then set A_induct to 1
/ h: n0 p: O! b% K3 K; P. G else if A_tote="tote 2" then set A_induct to 2- e- { [, S: J# S
else set A_induct to 3 * \ p# r6 P( R% g3 ^7 e
set A_i to 0/ x1 x8 S: Q9 k( A4 {: `9 b
clone 1 load to P_induction
( A. Z8 K6 Y) h- K# L4 r3 y wait for A_time sec
, X# `+ O2 o7 r3 ~' F end
8 j' k/ T" |* F+ s0 I6 p& C, A8 }* j Send
9 k( d' G f# L; a$ L; T% C7 n, e! c( C* p4 G
begin P_induction arriving# e2 g8 Y+ [. r. o! o: k8 H n4 d
if A_induct=1 then clone 1 load to P_pick13 U# I, w) }& k1 n8 r5 ^
else if A_induct=2 then clone 1 load to P_pick2
9 [# A9 o9 @4 I2 e' x% @ else clone 1 load to P_pick3% r$ o, Q. T" F5 t* b+ U% u( z
end" n! R0 p" _0 X" l
6 W# { t- }/ f% c# C
begin P_pick1 arriving4 I6 d6 k o# P6 N
set A_i to 1
5 i) J2 k, S( k/ ~ move into Q_induct1
4 \8 N2 ?" w( m# H move into pickaisle.induct1/ ~3 J# \$ p, f, T
while A_i<=30 do begin; T, m! P2 y; g5 n; Z+ m/ m0 e/ }
travel to pickaisle.con(A_i)
* q6 t. n1 f) c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 z! H' d' h: y( [: b; j4 s
else wait for 10 sec9 @" V P6 F" e! Y
if A_i=A_leave then send to die
% H" x- [, M" z- e- H& T else inc A_i by 1! t# z+ j$ Y& E. f( L1 X) h3 x
end0 z, J \' M7 A2 ?4 K4 V+ m7 ~
end& ~6 o9 r* i4 {% n5 a6 d$ D+ h
+ {$ T$ t; p9 H; b8 o' R$ ~( p
begin P_pick2 arriving, E, I4 ]8 Y/ u& p- h2 h; ^
set A_i to 115 K% l; O! f+ w
move into Q_induct2; ?% F( j1 |2 c, S4 T8 N6 G% |
move into pickaisle.induct2% M3 |2 L+ B. W# x
while A_i<=30 do begin
, z9 J# }; z* t# ? travel to pickaisle.con(A_i)
% Z: W8 v- Q8 V! @9 j K' A if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* W% R) X; Q; T f' ]% b3 ~ else wait for 10 sec% t7 b( R3 a, f4 O! U
if A_i=A_leave then send to die) S6 m/ r* l6 I
else inc A_i by 14 X" u. s9 {5 F- I
end
* Z" g$ `0 F. j& gend
# N! U8 V7 L* |" i8 A4 H, D0 Q& |# u) ]( G1 V# A
begin P_pick3 arriving; c6 v; R1 F5 Q+ p2 m8 h
set A_i to 21
2 m9 R& n8 Z6 x1 [3 Y! b, X4 x move into Q_induct31 n0 u2 ?. q5 Q: a& ]" k8 x
move into pickaisle.induct3
# H7 G* V! J9 |* _. Y# A while A_i<=30 do begin
1 A: n: z r& {4 O; e travel to pickaisle.con(A_i)
9 }2 r/ I P: R( E7 {* w' d5 o3 ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 l- V. Q1 e$ M
else wait for 10 sec, `- w$ y+ G* y" V! T
if A_i=A_leave then send to die
3 ^) l- q+ J- `6 U X" p& z else inc A_i by 1
& P: O8 `$ l! r* W* o end# i4 d* _8 @9 P
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,其它按你的 ...
|