|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: M1 _, o5 O u# p
& @9 G3 a8 o' E我的问题是,在每个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 j7 `0 g- S/ p6 V
/ N, c( N7 i7 r# k% Nbegin P_read arriving( N, o% n2 y8 _& q, A/ P
while 1=1 do begin6 W, T+ F9 K& i M8 H0 Z
read A_tote from "data.txt" with delimiter "\n"- M, R( e0 m/ t: K) k
read A_time from "data.txt" with delimiter "\n"' x0 M/ @- H% g
read A_leave from "data.txt" with delimiter "\n"8 `9 N7 k, Q! u5 E4 U: Z# v% u
read A_picks from "data.txt" with delimiter "\n"
1 y' ~5 V; Q7 m$ m set load type to A_tote7 R) N2 F/ H% F4 i6 V) U, D
if A_tote="tote 1" then set A_induct to 1
F' ^. H" Z+ J1 L8 n2 d else if A_tote="tote 2" then set A_induct to 2
5 E+ K; y" k) Q else set A_induct to 3 5 w- g& E2 z8 k! `7 U) I* e6 W4 ], _
set A_i to 06 B ?/ u4 I+ k) R/ R3 W$ O7 j% F
clone 1 load to P_induction
! X! V+ R( `$ D, K2 M" F wait for A_time sec4 y1 i" G) G. ^' Y
end2 |( f1 i# k/ N6 U# W
end
U+ B2 x5 C J1 O. \ Q p6 r3 Z4 k5 e% s3 c* J
begin P_induction arriving
; L. m* s% l: j7 E3 h# F$ L0 b if A_induct=1 then clone 1 load to P_pick11 m% E) ^, X* X+ w/ X7 ]
else if A_induct=2 then clone 1 load to P_pick2
7 B$ I4 M+ U; _3 m3 ]8 y, e: x else clone 1 load to P_pick3
0 M4 K3 ~0 [) cend3 P. _" b& p8 }9 {
! u- o: T! y8 r' X6 I& l' G7 b
begin P_pick1 arriving5 A8 }- m5 b* \; y5 Q3 G
set A_i to 1" Y1 E" i M' g8 B
move into Q_induct1& a9 U0 W6 W, C; p+ ?
move into pickaisle.induct1, P% s% q' s0 b" Q4 a4 J
while A_i<=30 do begin
. c% W, U% a2 s8 K' | travel to pickaisle.con(A_i)' C6 \2 L" t+ x8 b/ i& I" w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 ^2 }3 G% e/ B3 o7 i else wait for 10 sec
' Q5 J; v7 B/ d8 r1 H if A_i=A_leave then send to die
- X8 X$ z, l6 g& J: ? else inc A_i by 1
+ e* K$ h! A! _4 V6 Q end
8 b% \, |! v6 `& n/ _( g5 V L6 U0 o' ~" \end
1 h7 m2 A: L( l+ i" F1 @6 y9 @2 Z& S* Q) K- Z- U0 l
begin P_pick2 arriving
, X! R4 O. g | set A_i to 11) l% L( h! o' t! F. }
move into Q_induct2
( G. s! D6 m, {* i0 F: \ move into pickaisle.induct24 T" s. ~. i, e+ H, D
while A_i<=30 do begin# f- ~0 D/ o- @9 ^. V
travel to pickaisle.con(A_i)4 M; _+ ]0 V2 V B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ~) X/ M$ n$ I# s W4 t: w
else wait for 10 sec( e8 u* k: l# n0 P# u6 Q2 J
if A_i=A_leave then send to die
7 c) S, x: d. B( ~# {+ k else inc A_i by 13 N; S$ @( n5 S" ~
end
% s8 |& ~7 |) ~% z" C3 Jend$ g5 t3 s R* T
5 u' z4 H9 N0 h$ Q$ F3 `3 a3 Cbegin P_pick3 arriving$ d. i% P8 n1 }+ a
set A_i to 21
`8 I/ E% ?& J) [1 t move into Q_induct3
# X) _' m. r e7 l1 _ move into pickaisle.induct3
, r7 u, z5 B( P4 y* v1 ] while A_i<=30 do begin
6 ?0 d2 L1 m, N+ j+ b, [ travel to pickaisle.con(A_i)
' P J, H+ F3 q5 J3 B2 l# Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec G1 |' `: ?! R" t: s
else wait for 10 sec; R$ S1 t0 {/ \, f( s8 k! P% C- l
if A_i=A_leave then send to die0 m M8 d+ S) Z+ G/ u
else inc A_i by 1, K! q' [; D: p# c/ N
end9 s" K1 X, L1 H
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,其它按你的 ...
|