|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) `& h: S2 z e" l
B1 e: W; w& o; N3 F8 V
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 x" F% @1 r: a& d/ ?0 |3 g- g! o
begin P_read arriving
/ J8 n0 H% g1 r7 w' Q while 1=1 do begin5 S9 Y0 m2 s- n% ~. P. }
read A_tote from "data.txt" with delimiter "\n"2 }& s( [7 x+ e" v
read A_time from "data.txt" with delimiter "\n"
) j$ b9 U( w6 r: f. z read A_leave from "data.txt" with delimiter "\n"
$ ~2 r, A \ s8 r2 x: A read A_picks from "data.txt" with delimiter "\n"
! Y1 w2 R/ v+ h: O* \ set load type to A_tote$ D1 Z! O2 X- \4 N. u: W
if A_tote="tote 1" then set A_induct to 1
% h+ k' q# A! {) q) P. x A d else if A_tote="tote 2" then set A_induct to 23 m7 S* d6 o4 W' U
else set A_induct to 3
) F( k; @ n4 C' A; }/ ^ set A_i to 0' ^4 }8 O! @0 M: D1 E
clone 1 load to P_induction8 y' J* Q: F0 l$ ]
wait for A_time sec" g9 E; `3 t) b
end
; h0 b3 `: P, {7 l9 g' xend" x1 R0 E9 @9 i0 h6 M. G
+ C; g* I% q6 B, ?3 Obegin P_induction arriving- [' J6 K1 y, U1 P3 S6 q2 y- m j
if A_induct=1 then clone 1 load to P_pick1
0 H. i% c6 w; ?5 J$ }" \$ i else if A_induct=2 then clone 1 load to P_pick2" y) ?0 ^: E7 g. G
else clone 1 load to P_pick3
, `- b- V0 |1 \1 Q; [% J) P0 T- ~6 M) yend
2 Z8 S% i" W- X2 v0 h% ?0 s5 L6 e) R; F2 i8 g5 ]
begin P_pick1 arriving
1 D/ Q7 Z1 R2 |# [) D set A_i to 1
9 h/ f6 K* o1 j2 e$ ~ move into Q_induct1
. F. ]. A( A8 _ move into pickaisle.induct1$ M& V( K! R- F6 O; [. O8 `
while A_i<=30 do begin) j( ?/ }" m" Q7 L' y" {
travel to pickaisle.con(A_i)0 L" p2 k3 V' y7 \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" s% p/ J% s/ `8 {0 z
else wait for 10 sec( r8 s! J( J6 v! Y) {% C
if A_i=A_leave then send to die- N a v& D% N
else inc A_i by 1- A" [, x/ N5 O/ N8 }1 g8 O
end
% s" V9 q5 ?$ m: P9 send" w* ~% B/ F. w9 d/ @
7 I4 U `% E& p% L
begin P_pick2 arriving
* v: k: `; @. s3 f- K8 m! J& U set A_i to 11
0 S; R; t1 |, x" w* \* Y move into Q_induct21 l/ m" l d( y# |# d
move into pickaisle.induct2
$ p- U K5 g% F: Q* D while A_i<=30 do begin8 y+ ?& c' z, |5 g) j
travel to pickaisle.con(A_i)
% q$ c7 c1 M- U5 h0 i. P y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ [ }. X1 Q5 p9 x( y
else wait for 10 sec: \, `0 ~7 t* f: m1 |- ~
if A_i=A_leave then send to die
& ^2 T8 g5 w8 N4 J2 q( [0 g/ q; r else inc A_i by 1 ?3 z/ w9 c7 w2 n# B# `
end$ {0 x5 i7 O6 I% z9 a3 G0 T
end z5 ^, P9 u& N, d) R- U( A
. K/ q+ Z& c! d z2 x6 W: Y
begin P_pick3 arriving8 b; L* t$ p. y& A- @- b8 W7 e
set A_i to 21
& L7 A) h7 c' u/ b- z& v6 p move into Q_induct3
$ a, c. }) q8 s5 w; E' o move into pickaisle.induct3" }! Y* v) R+ `' ~
while A_i<=30 do begin; K2 Z! D& v+ h
travel to pickaisle.con(A_i)) H3 K5 ~8 @8 b* W3 ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' N: p6 n5 k& `$ n else wait for 10 sec4 M, h# g, {3 A+ l6 w, q3 j" {
if A_i=A_leave then send to die- V" l" U4 b" D9 u7 ?9 J7 U
else inc A_i by 1
9 l, `5 o$ i( G2 f1 a9 m end! h5 K1 O: `/ p" s B
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,其它按你的 ...
|