|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 B1 b' f: o }- @! @. f; {( Q3 Q, G- w7 V, K
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; O' A. Z7 K* y8 A& h
$ C, W8 [' y4 ~- h+ _, Lbegin P_read arriving9 X5 ]; I/ p) B; Y8 P% Y
while 1=1 do begin2 f5 P- I7 x k
read A_tote from "data.txt" with delimiter "\n"% n. B8 Q. R9 T! I3 t F) o/ O
read A_time from "data.txt" with delimiter "\n"/ A1 s$ z7 X2 s9 n, k# e$ T
read A_leave from "data.txt" with delimiter "\n"
4 U% Y" K- z, N. E5 m5 p/ h read A_picks from "data.txt" with delimiter "\n"
& x3 w3 }$ Q7 q- E. y set load type to A_tote
+ W$ B5 T* y, A0 k& c/ V5 P2 O if A_tote="tote 1" then set A_induct to 1
* v" b- i. E1 B) P' } else if A_tote="tote 2" then set A_induct to 26 ~/ h6 Z+ l( Q+ X/ Q
else set A_induct to 3
9 U0 e; ^0 P' t set A_i to 0% T% o0 n( j6 N8 r" ^+ C
clone 1 load to P_induction' T$ t7 s# R" h, r
wait for A_time sec' o9 |3 I; h9 U8 d+ Z2 Z1 x8 Z6 [
end
$ s, h# Y/ Q+ E# Iend
0 A( i0 R H2 T# I1 x6 Q
/ h7 d/ A( W+ j H4 Mbegin P_induction arriving8 [% o9 Q! \5 D. ?9 a- k; I0 H
if A_induct=1 then clone 1 load to P_pick1
1 K$ |& Z1 K" ?* C% n, W else if A_induct=2 then clone 1 load to P_pick2, o8 w. i% C2 `1 {
else clone 1 load to P_pick38 ?/ T' u6 c9 @) _
end
- k( C1 _; f& f4 s. K5 Y
0 f( r9 p: D; jbegin P_pick1 arriving
: e( Y5 x* c+ T5 Y3 X/ j set A_i to 1' q7 I) u, p& Z# |. G! j$ }/ m
move into Q_induct1
' {: D/ C1 {9 E, g move into pickaisle.induct1
& \ {0 W1 V( u0 W while A_i<=30 do begin' q G) n. y0 |8 {4 e, g( e% P
travel to pickaisle.con(A_i)
& u) n5 `) R8 i' h I, O0 r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 u H0 O$ c: ?8 m+ i else wait for 10 sec
' {* h2 r- K7 a+ P1 q; Q if A_i=A_leave then send to die" G! K2 W2 S! X2 D% B* |# U
else inc A_i by 14 E& F+ q6 R; j, P2 S
end
4 C" P4 L/ K4 q4 P: send
. e( d) }- ?. T4 d: \6 h- }. \1 X) Y. \
begin P_pick2 arriving5 h* E- q5 n3 t+ M5 J' X0 W
set A_i to 11
* v& \5 Y2 Y( [9 j G# f5 l/ A move into Q_induct2
' M4 n J1 h9 c0 ], X7 N move into pickaisle.induct2$ ~9 w2 j: w8 L
while A_i<=30 do begin Z# s9 }$ z4 P: g
travel to pickaisle.con(A_i)
/ i$ k% X# R6 R9 j0 G" ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; a; {6 `7 X6 \. O3 b else wait for 10 sec) m# p8 I# ~& B; k
if A_i=A_leave then send to die
' d' k" P( p7 V8 s7 e5 E# Q else inc A_i by 1
0 Z) m3 ^' I4 L) o. F: K end
& a. Q; k) l, @) Q) L. n8 Xend3 R" O3 }" q: q" z' X$ H
# C: T9 U% g6 K
begin P_pick3 arriving2 ~% k* I8 D/ p8 S1 v, Z8 R% o7 T
set A_i to 218 X4 J. t( u8 C2 i+ P0 s5 q+ b
move into Q_induct36 H" \- ?. O7 p/ l7 O4 W( v* H% {* L
move into pickaisle.induct3
2 V0 r/ `/ o8 I. O1 a& ~# S$ Z while A_i<=30 do begin
2 T9 X) g/ n! [. B' I) f7 x; p travel to pickaisle.con(A_i)
, ]/ N( P" y* j' Z# Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, `4 d; M$ i2 c. p$ R- x$ x else wait for 10 sec
( c! U) z3 r4 C M if A_i=A_leave then send to die
3 D+ V" C6 ?; d2 J2 @* H else inc A_i by 1
( P4 x/ `( C! [ end3 w Y+ U3 w+ f; K
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,其它按你的 ...
|