|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 Q0 z& T( i- }
- x- D9 P9 u, {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# L& b$ {; r a. K( U% X7 ]5 t$ O' P9 g9 T
begin P_read arriving6 |: ?* O0 q6 L2 d; C
while 1=1 do begin0 w9 d" F8 Y9 l' r" P" q
read A_tote from "data.txt" with delimiter "\n"4 N: P$ U- o( ?: h7 ]' a4 C7 @% ]
read A_time from "data.txt" with delimiter "\n"2 z! H4 A& Q$ [
read A_leave from "data.txt" with delimiter "\n"& H, |$ v% u4 b3 ^% o3 x
read A_picks from "data.txt" with delimiter "\n"% n9 f0 J4 \4 [8 W6 j; B0 V
set load type to A_tote
" s) Q8 [+ n: w6 o" f0 f: X+ d if A_tote="tote 1" then set A_induct to 1
6 {- H J3 H b* m5 t else if A_tote="tote 2" then set A_induct to 2. M z& S" [" ]4 n
else set A_induct to 3
' t" x3 F3 @% c- G- | set A_i to 0' a( ~2 D5 h% m% M" N
clone 1 load to P_induction Y3 {+ h; m& P2 j% T
wait for A_time sec
1 X; i B3 z. C8 j( s! Z# h end
7 M S& c8 m/ M! I Z0 Tend* y/ q9 V, Q; r% x, J5 k k, U
% c, |$ |% L. D0 s) Lbegin P_induction arriving8 d7 }+ R! Q6 b' Z
if A_induct=1 then clone 1 load to P_pick1
1 Z: Q$ |9 v8 J7 Y else if A_induct=2 then clone 1 load to P_pick2
+ \* x$ F0 ]) H ~ else clone 1 load to P_pick3" _; e8 Y0 K8 @& ^' \
end, ^( F1 |0 ^& f+ F' C' h. Y. X, ?
4 Z! b$ l# V! X( ?2 i" J
begin P_pick1 arriving
0 i( @- E& ^0 w set A_i to 1
4 j8 u. ^! h1 O) j" n/ z0 S/ h! G move into Q_induct1+ F1 |9 T y$ m% i0 k7 d; k" s+ E
move into pickaisle.induct1
0 k0 i3 d, W; J7 Z( ]0 F e6 Z while A_i<=30 do begin* a d7 q1 m+ {- @
travel to pickaisle.con(A_i)
4 D8 @2 E5 T9 c+ O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# Z5 s/ o6 W, y) S$ o else wait for 10 sec
+ T6 b, X* v5 Z. O( B) G6 @/ i if A_i=A_leave then send to die% }: E+ V0 m: [% N+ i/ }
else inc A_i by 1( t5 {) Z- {! Z; Y
end
% G) `0 }% o3 s, `$ oend
/ t& Q' U' x% R; E9 T6 U' A9 V% M7 v9 o( h
begin P_pick2 arriving/ A' ~2 F5 e( T6 J% ?
set A_i to 11
/ Z$ @# p7 a0 ^$ i move into Q_induct2
2 N# q. V3 q$ u' t; G. S/ { move into pickaisle.induct2. o5 s3 u. x9 s8 I
while A_i<=30 do begin S) A4 t; ]. C9 ~
travel to pickaisle.con(A_i)- j& h' o) }8 f G& O; e) }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 O a) Z5 e' L4 {
else wait for 10 sec
( k1 O' C l9 p, f* |0 S/ i+ f$ p if A_i=A_leave then send to die
2 T4 U4 e$ S1 Q* y0 F7 Q3 t( s else inc A_i by 1
2 Q ~% E# A, g' u K end
- f# C; N! }- k8 j) x* [+ M( j2 Dend I) B' _# u" ^4 H: |
7 c* k( Q1 Q& ~# Z
begin P_pick3 arriving3 j- [. G2 h* O% U9 ^
set A_i to 21& k1 {6 c* u# L/ C9 f( G
move into Q_induct3
* j+ k& ~0 ~9 V move into pickaisle.induct3
3 z2 Z! f7 S" X1 k: ` while A_i<=30 do begin; m5 Q; I4 T3 n; b9 T
travel to pickaisle.con(A_i)+ p) ^$ g0 O; ?% @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 _ ~% I: @) J8 a: N else wait for 10 sec
# U, [3 j9 P# b) ~7 @2 k; | if A_i=A_leave then send to die: k! g3 x1 p; p& n& J
else inc A_i by 1
1 n' F# W, F- x: r' ^& @% T end
" x5 L& Q# G$ i( @2 U: m) R. Dend |
最佳答案
查看完整内容
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,其它按你的 ...
|