|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! F+ I O5 p6 ?+ t/ Q
: ?% `) Y7 @) I% T- 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中的数值,不知道会不会有什么不妥。
$ c: X. W( n( y$ d/ W; E
# t1 h8 F+ K jbegin P_read arriving1 o- n; P7 ]. Q5 L+ {+ M* a2 D
while 1=1 do begin5 L3 x6 R0 b+ ]' k; B/ [
read A_tote from "data.txt" with delimiter "\n"
6 c4 S3 t7 j9 G3 \" ] read A_time from "data.txt" with delimiter "\n"
( i) E+ v) A) u& I' y& O# S- s; X# T read A_leave from "data.txt" with delimiter "\n"" W3 L% R) ^9 i g$ G/ d( _
read A_picks from "data.txt" with delimiter "\n"
9 N6 K4 s+ f& k, g6 P& S: A) W W% U set load type to A_tote7 P0 Q. l( j6 K& G
if A_tote="tote 1" then set A_induct to 1
/ k8 J" y/ {0 `9 |0 t: U3 d' n* Z! J else if A_tote="tote 2" then set A_induct to 2+ r; D4 Z N2 t4 C* ^
else set A_induct to 3
( u- W u' g5 J! W set A_i to 0
( s8 S3 l8 l$ p0 |6 n& U clone 1 load to P_induction
; U# A6 |0 Y- M( l) u9 [ wait for A_time sec# Z; K. o/ k7 I0 B9 m
end# Q) w; [! g6 c* T- B. }
end
9 M/ x8 F Y( U. e" |; p! y
7 I/ \4 \7 i& Obegin P_induction arriving1 ?6 R4 t) x7 l2 |& A
if A_induct=1 then clone 1 load to P_pick11 j) m$ i7 f5 P3 B6 W* t
else if A_induct=2 then clone 1 load to P_pick2
R/ l, B3 I- D- O3 w else clone 1 load to P_pick3
( d" B B. s6 f3 O3 lend. y$ w+ O. H2 P. ]3 Z
Q/ S5 o, `& V, wbegin P_pick1 arriving5 p0 ~: m0 G) R/ _
set A_i to 1
; ?& Q. e( B, }/ ^% I5 z9 s9 L move into Q_induct18 H9 P0 \; p/ s9 k2 s
move into pickaisle.induct1$ B9 M" I1 m S
while A_i<=30 do begin
; [' e( ^8 a1 C" Y8 `/ G travel to pickaisle.con(A_i)# r: b4 |& R8 w( f/ A/ e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- K2 {: ?+ Z. m& G* H else wait for 10 sec
+ O8 D/ B2 i" t: a( | if A_i=A_leave then send to die
" `6 t. V/ m, s& y! R5 i else inc A_i by 1+ k j: E% @# O! m+ G6 V
end+ @+ e5 H( ^2 e( K! D8 d& v
end4 ]2 `$ j' l/ c
7 H8 S' W, r. z6 Hbegin P_pick2 arriving8 r# Q8 V, r, ^1 Y
set A_i to 11/ l0 U5 W# Q' n8 _8 \& e4 h
move into Q_induct2
- A1 k$ J [5 t- k) [7 p: }: d5 z move into pickaisle.induct29 q+ Q7 P* z& A( C
while A_i<=30 do begin# \1 O7 g8 |- N! w V
travel to pickaisle.con(A_i), M2 B- v0 y1 s+ b; R! Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& [* T: v$ o1 f2 d/ l
else wait for 10 sec
; m! Y9 \7 d K. \) U if A_i=A_leave then send to die+ s# |9 a; ?0 Q# U
else inc A_i by 1
3 r* o; {) W+ O( c/ J+ @. V end
9 g. b" g) V2 S/ @1 W3 E# L$ J6 |end
3 w/ p* X I* j k% y4 w5 z
7 [. z3 O( Z1 N9 fbegin P_pick3 arriving6 u& b( F, }0 f6 Z3 _8 F& y
set A_i to 21
+ e5 ?9 e! F% P$ }* _ move into Q_induct3; Q& S6 |: T# D- ]$ @# r% ]5 l
move into pickaisle.induct3& y' \4 O8 q: ^0 Z- R6 F
while A_i<=30 do begin
$ Z& W* m3 C# P travel to pickaisle.con(A_i)* x# W: j" [0 n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, a/ J' l+ |; \* ]4 G
else wait for 10 sec7 y. ?: ?/ a, h, f' S. w2 {
if A_i=A_leave then send to die
1 U }3 `* h$ b! f- x, j1 ] else inc A_i by 1
) s6 v: l+ N; G, V- f end
! F: H0 {" z9 g6 _2 xend |
最佳答案
查看完整内容
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,其它按你的 ...
|