|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% F1 c! f7 v0 m& ~7 V6 ~5 D! Z
) k" Y, m2 E! T: 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中的数值,不知道会不会有什么不妥。
1 g3 d( P7 ]( x# u9 Y' F, Y4 e6 R! l
begin P_read arriving
; _- @# \) V+ q4 @ while 1=1 do begin( g. r# G. B& J1 @ ? u# v
read A_tote from "data.txt" with delimiter "\n"; g2 U# C1 ?$ B- V* o4 @
read A_time from "data.txt" with delimiter "\n"
: J. i% Q2 v. q o ]9 M" i1 ^$ i9 L" u read A_leave from "data.txt" with delimiter "\n"8 m: K6 g9 W* j+ G
read A_picks from "data.txt" with delimiter "\n"
2 @0 @3 Y! j% j4 B6 D set load type to A_tote$ o* M+ P+ t8 E; T0 Z; V/ E
if A_tote="tote 1" then set A_induct to 1
3 p) T9 D( q! ]& ~% L else if A_tote="tote 2" then set A_induct to 2
( ~3 U9 R: \+ G+ d% C7 \ else set A_induct to 3 * J' C% p- A7 v( s3 {# c% ], r
set A_i to 0
2 C* [: U9 w( |2 b8 g clone 1 load to P_induction; J+ J+ J0 m$ {
wait for A_time sec' d1 i9 y+ l+ T- s& ~: `8 [
end( ]8 Q2 Q/ s- V: Z' p
end
, K1 Q5 y+ m3 ?* i
5 S6 _, e0 X8 U7 X+ Mbegin P_induction arriving( U/ U/ I1 r1 a- [, C6 C+ Z; Q
if A_induct=1 then clone 1 load to P_pick1$ w# @' V) u) s+ |* t$ _: k$ K
else if A_induct=2 then clone 1 load to P_pick26 z2 n6 F+ ^2 \
else clone 1 load to P_pick3
6 `( g4 o2 g) ]$ g. l/ w! e& x* T3 zend+ t' e: b- |# O; x, s6 }7 S4 s
1 D/ c2 L' v% T/ R' T# W
begin P_pick1 arriving) ?1 v$ U9 K. i& z2 _- A: ]% {5 h
set A_i to 1: O' L- e" F+ @* j. p, H) J
move into Q_induct1
, u" m6 c `6 h4 U9 P move into pickaisle.induct1 h# p% t- u+ B& w: T3 o! A
while A_i<=30 do begin
1 h& d, `$ T, h- P travel to pickaisle.con(A_i)! W% G$ X* {# N# d# Z' L! Y* V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- v6 N2 S, X1 q% V# L2 s) r, E6 u else wait for 10 sec
7 x" Z( g0 h" M if A_i=A_leave then send to die
# R' A/ R8 u) D$ e( m# h$ H; _ else inc A_i by 11 `: N- s$ x, B$ ]- |/ s" Q
end; H% c( _( m9 l
end6 Y1 g5 V( P. [
; T% @+ y- A, ^! }- M
begin P_pick2 arriving
( i/ [0 [& F# g0 |4 l8 I& C3 v set A_i to 11( [: v; {6 g( U1 n; |7 M+ L; R
move into Q_induct2
9 R: s" A9 T$ ~; j2 ]/ ]" E move into pickaisle.induct2- I/ ~3 U$ H/ R2 y% H) A0 l
while A_i<=30 do begin
" k- V3 b- z u. V) V travel to pickaisle.con(A_i)" L9 x0 e4 |# o* |9 }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 ]# [2 W2 h9 g/ f; p0 ~ else wait for 10 sec
- L, w3 N- }8 M0 {8 o6 d4 x if A_i=A_leave then send to die
l9 h: l- b! m: l. M" v else inc A_i by 1" {3 f, s1 S& w7 j9 k
end1 V7 l/ ~' O& i8 \: ~* o6 E
end
+ {5 P: [! f6 I
4 V& Z4 \' x; j3 Y, D: bbegin P_pick3 arriving2 z C; r1 H1 s. v
set A_i to 218 C/ Q- j; i0 @4 m; n! W2 x
move into Q_induct3
9 C, c* }" o0 I. R N1 T9 A move into pickaisle.induct3& c9 m$ v$ i0 c; d3 i/ q
while A_i<=30 do begin, L) q, C& y1 X9 y3 s. Z6 G7 x
travel to pickaisle.con(A_i)( i `4 e9 h- D8 y$ p4 R6 t9 R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. o: J$ j! Q( ~1 N6 t! } else wait for 10 sec c" ~9 O7 [0 r$ b& X
if A_i=A_leave then send to die
; R! H1 J: N9 h else inc A_i by 1
9 [* |4 t# z. \ end; i% r0 d2 f2 q6 B0 ~$ h$ ~9 g
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,其它按你的 ...
|