|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' F7 d L; E' M! v/ S7 m& J- @ U. N. F% A
0 \0 }. L" l! _& z- [' j5 n; 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中的数值,不知道会不会有什么不妥。
5 Y0 O* h0 ?/ q7 b* ~
8 V9 P% v: e" V5 J* Y* ybegin P_read arriving6 b& \# U# T0 o$ l1 w8 H7 t' Q
while 1=1 do begin
% U4 I2 g |* |5 H read A_tote from "data.txt" with delimiter "\n"
1 U+ ~: O* j/ f5 m5 g3 A$ a6 R+ ~ read A_time from "data.txt" with delimiter "\n"
* b# S9 M, P1 g2 P; {2 Q4 U read A_leave from "data.txt" with delimiter "\n"0 ]$ S3 ?$ S3 ^ P
read A_picks from "data.txt" with delimiter "\n"( A2 r b2 N3 A) G) y' h* ~
set load type to A_tote
7 m ^5 t; f6 q0 k3 g" o6 Q* J if A_tote="tote 1" then set A_induct to 1/ x7 X) w: E$ {, F9 F
else if A_tote="tote 2" then set A_induct to 2/ X- b [6 k% f7 y& V5 f
else set A_induct to 3 " q9 v) X" i& ^3 y) j8 Q1 s* c2 z& ]+ }
set A_i to 0
. E& _( X2 I3 T5 v4 g clone 1 load to P_induction
- _% y2 G7 p" V/ I* d wait for A_time sec
5 k7 E$ i/ l! Q- y8 J end
/ E' d0 X) w0 wend! |% d3 C( z% a9 y
' b1 s2 N/ z, g& c( ^
begin P_induction arriving [5 m2 i; z; \+ d9 G$ W
if A_induct=1 then clone 1 load to P_pick1) {: V% c. z6 x3 V% N
else if A_induct=2 then clone 1 load to P_pick2. P% `: p' Z6 X5 z' w4 W8 }, s
else clone 1 load to P_pick3
9 Z5 I& N' w/ n4 m; N& Yend
3 T( f5 d6 |$ d$ e8 [) Q b* O1 T4 h
begin P_pick1 arriving! F& W- t7 [ [% b$ x
set A_i to 1
^7 v1 @( B7 W' T& Y! ^, \' A" f move into Q_induct1
! i9 d5 }4 w. D9 |3 j* n6 K) M move into pickaisle.induct19 q0 {1 R+ n# `' Q
while A_i<=30 do begin
% Z* v* K& K3 g( I- u7 l travel to pickaisle.con(A_i)
, ^! ]( l! g, f. h& K1 W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 {: R" k2 g" y
else wait for 10 sec
4 W& n* L' [" @. g. F6 Q6 D+ `, _) t* n if A_i=A_leave then send to die
! ?( ~8 i3 x' ~% e. ^/ F5 q5 q/ t else inc A_i by 19 P" j0 k' s" c5 C2 I: D' ^, j
end$ {, ]6 J5 n) X! t; v' y5 L
end
: ^# a- W" Z: Q) k# X6 |5 R, X! ^/ c4 I7 _
begin P_pick2 arriving
; \0 D2 t9 j) x7 t; q9 x set A_i to 11
0 A" m" c6 S" ^3 t5 }4 j8 x2 A move into Q_induct2
& @; I' i. d9 t1 \$ y move into pickaisle.induct2
, m& v/ V$ l0 q while A_i<=30 do begin
2 g; F0 E) C& [ travel to pickaisle.con(A_i)
1 p4 B- [9 I% O; k0 O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' a7 ^' D) g% v& e8 W3 {, i# _; o
else wait for 10 sec
# n' Z/ h1 L; }6 h8 s; E if A_i=A_leave then send to die( M6 m. j; A. Z5 [% ]5 Z! c5 l5 d" p K
else inc A_i by 1
" a# G4 q8 T: w: e2 z end
% u4 [& v" l$ V4 s+ F3 F7 gend
& c" q2 x' u- e) Q: S, h* b
j% t' M" ], Vbegin P_pick3 arriving8 @6 h. c" [% F
set A_i to 21
0 A3 p2 Y R( O* W0 s move into Q_induct3
& C, `: E& i. g4 ^- E [" W% }3 ] move into pickaisle.induct3
1 B- z: |0 y* N3 n8 P while A_i<=30 do begin. C6 {7 Y% G6 a K( t
travel to pickaisle.con(A_i)0 y1 Y( D$ |! z, a) [& c- `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ?0 V' u+ f5 e$ e# }, t6 G else wait for 10 sec, b4 l) \* n/ d! t4 v! S/ j1 O
if A_i=A_leave then send to die# G5 V8 b) O- j: l0 p0 \1 o4 ^9 K
else inc A_i by 1
) d" e3 H w$ H( K# B end
p& Q; K3 M1 n3 \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,其它按你的 ...
|