|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 q7 ^) Z9 H( W" V* h
+ w' P% t& b: s4 p8 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中的数值,不知道会不会有什么不妥。
0 g2 T, x2 o9 d6 P6 z+ h
2 S4 ~* v+ m0 S2 Y+ P0 P2 Mbegin P_read arriving0 b* o5 o* o2 P6 J7 a; L, Q- W# W
while 1=1 do begin) N: O6 B" T- V* A0 ]9 b" i+ a
read A_tote from "data.txt" with delimiter "\n"
k6 H `+ k( `; ]: ~/ ?( { read A_time from "data.txt" with delimiter "\n"
# q j8 F5 J/ c& P& t$ o7 N- Z, o read A_leave from "data.txt" with delimiter "\n"
% e& g+ l" ~ w# n7 a0 g: Q read A_picks from "data.txt" with delimiter "\n"
# g, k. a' I, a# W9 \ set load type to A_tote1 N. _0 ?% Y( h, r
if A_tote="tote 1" then set A_induct to 1
/ o9 y& q) Y! }6 y8 ?& ^: n9 F else if A_tote="tote 2" then set A_induct to 2- W m! [; O) Y7 g
else set A_induct to 3
2 H8 a# h# h3 a" W' V9 [ set A_i to 0; [9 i0 V# s' H0 u- ]3 K) w0 W7 I
clone 1 load to P_induction
, b6 {; Y+ h9 s, b3 F wait for A_time sec
. Z6 ~3 d3 d/ e5 w8 ~ end
5 l& E) ~- s- k7 G, \$ P# @end
+ s, ~% D9 I" R5 h( G: r; M" }2 n8 v% U( E' q
begin P_induction arriving
$ T7 K4 W) m$ K if A_induct=1 then clone 1 load to P_pick1* y- R6 p3 T" j
else if A_induct=2 then clone 1 load to P_pick2) T1 n' K3 o, @$ U8 ~0 v5 t
else clone 1 load to P_pick3% j, u2 w* W: l6 a
end1 [* c: a7 }/ q2 s' X+ F. {
, ]! F- @0 D* M) E3 }( jbegin P_pick1 arriving
+ q+ z& Z2 l `. q5 O; `* C# _ set A_i to 18 {3 x2 n4 Z. ?* R1 Y) w- Z
move into Q_induct1
- k! r1 q/ A5 I) Y, ] move into pickaisle.induct1# m& e U$ X4 o' [& P/ e* z
while A_i<=30 do begin ^4 _3 w! x$ k
travel to pickaisle.con(A_i)3 w# g# G5 A; [) R0 E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- K" T- m6 v( ?: i* D% o else wait for 10 sec/ ^) o6 D+ b. m8 L7 V, [
if A_i=A_leave then send to die
2 Q" m" h$ x- ~5 E5 X: } else inc A_i by 1( |1 i# u+ k" x9 ?- I4 q7 r
end
, b/ O$ q+ q( s% ?9 \9 Uend
- j4 I. e1 Y/ q* q" p) R: Z8 q8 f" T; [2 ]. V4 W* Q& g! b0 _& l
begin P_pick2 arriving# n2 n! ^- s0 K9 ~; ?5 @6 K
set A_i to 11
# h2 P3 D. N3 H2 l8 k" T move into Q_induct29 l- k' _# S+ r. R' j# c5 h
move into pickaisle.induct2. d8 }+ \9 {' m" |+ p9 N
while A_i<=30 do begin
0 y) ^, p. ~, P. Z travel to pickaisle.con(A_i)
) `; H' }7 h+ k; G3 G* F, i8 d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- F4 C& x% Y: g8 f" y$ v) D9 X3 Q else wait for 10 sec
, {4 B% f/ u3 y- T if A_i=A_leave then send to die
/ |" @/ x1 m* @9 z1 T; [" } else inc A_i by 1
; y6 h* Z( S7 i- o end
: I, q- y4 d9 S5 ]end
7 [3 K( y; J' ~
9 u+ Y3 n F _begin P_pick3 arriving
# w2 N9 A2 I- Y2 d4 M- Q0 h' L4 R. @, K set A_i to 21; \3 o5 ^$ e ]( b' X) d
move into Q_induct3) @6 x( \: c! V% @8 g% F+ _ M
move into pickaisle.induct3
1 \6 E* g! L# m9 n% x$ ]. D while A_i<=30 do begin
- K# i' ~2 d" Q! n( ^5 Z( M U& P travel to pickaisle.con(A_i), a. s% b$ J3 W) U; I1 q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' a$ m# W; D0 f0 T3 P6 q else wait for 10 sec
) P* a( G# ?; ]2 {6 Y if A_i=A_leave then send to die. X, d) C! n1 S. o
else inc A_i by 1
0 C. G: L g- W+ } end7 U" h' T2 k' r ]5 `
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,其它按你的 ...
|