|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ M. ]1 Q6 _( f- R
3 C' k1 q; a) q6 U* R5 ?我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 y; B) C" N4 b
! A+ Z! B# h7 [: j2 _% J+ c8 l abegin P_read arriving
( z _/ L2 w1 y" ~& ~ while 1=1 do begin
8 O: Q; l7 [, i) j8 `7 T) Z2 J# ` read A_tote from "data.txt" with delimiter "\n"
% z6 @& w: W& P+ g& K& _( w read A_time from "data.txt" with delimiter "\n"3 P5 v0 @$ Q5 L$ ]3 r" L$ A
read A_leave from "data.txt" with delimiter "\n"
4 u4 n. o6 z0 \% r' O9 _ read A_picks from "data.txt" with delimiter "\n"
3 J9 B$ l: x$ U" g set load type to A_tote# A# o/ b8 D% i( k- u' ?5 E
if A_tote="tote 1" then set A_induct to 10 E& X9 H+ ~2 y' q+ @6 ]' n2 Y
else if A_tote="tote 2" then set A_induct to 2
+ T- J7 y; ]6 b8 w4 O else set A_induct to 3
) e7 v$ T+ m- X1 a3 I S set A_i to 0. Y% ?! S/ g5 l( [
clone 1 load to P_induction6 ` i a9 A2 M- q
wait for A_time sec
8 `* E. K* c! u3 T5 {/ F end
( E/ a5 Y) w' ]end- O& }" D% I" v4 U0 O- V
) C& d- j/ g( \begin P_induction arriving+ I- I* S3 G9 u
if A_induct=1 then clone 1 load to P_pick1
3 n: N/ ]2 U- N( B& n3 I else if A_induct=2 then clone 1 load to P_pick2
# B. Y* J, l, h" R) [) t else clone 1 load to P_pick3 l& e) f6 r# x5 R4 M$ I
end
7 y* {' P+ ?% |6 L: c5 C% Z# [( d7 [7 |( @4 i% c Y
begin P_pick1 arriving# i7 @& ?) U0 R& i) p d# h
set A_i to 1! C( @! S6 I- p( \
move into Q_induct1
( g5 L8 ]$ D4 p( q1 G4 r8 U, ] move into pickaisle.induct1
' C/ b/ k. Z" ^5 H) ? while A_i<=30 do begin4 {/ E$ N! F: h5 o0 Z d
travel to pickaisle.con(A_i)0 \& u: O5 Z# F4 f& _6 r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# ?3 t& i/ x, C3 j, y2 H
else wait for 10 sec
3 O/ H7 o% p/ W if A_i=A_leave then send to die
/ `! Z( z0 W% ?1 [9 h else inc A_i by 11 ]+ ?0 |. a' s8 Y7 m
end) C4 {( ?5 X3 f, V. T! l
end: A" x* ?. g$ [
6 o7 }* p; e( u _4 l7 [begin P_pick2 arriving2 Z, s9 E) s) m2 Y4 W P: s
set A_i to 11
3 a* R5 w5 t: }3 q S move into Q_induct24 E7 U( R( y& @5 o- O- u
move into pickaisle.induct2
: J! P l9 ?& v/ X* O7 \( R3 _ while A_i<=30 do begin
" J* r6 D4 J! W$ g, j* e! [ travel to pickaisle.con(A_i)
2 w" s1 S: O. o! G: C! a2 T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- y7 {: C- H. i8 u% p else wait for 10 sec
. p5 O) b8 e! G/ o4 l6 ]) R( k, C if A_i=A_leave then send to die
$ K/ @6 m' v2 y+ A1 U4 {; c else inc A_i by 1$ L. U) [3 m9 r: }5 f9 q: Q$ W" W4 f4 s
end9 L/ S3 P8 I0 p: y
end
: I+ H2 d/ w* d. m. d+ R6 C7 R g/ N
begin P_pick3 arriving
0 M( Z b4 Z1 V set A_i to 21
8 p5 E% t6 d3 [5 M move into Q_induct3
- X$ D+ K( }1 u- i. c+ c move into pickaisle.induct3
. G, O. {& s* _8 \( @' P, D9 h while A_i<=30 do begin
: y- a: p @1 a2 f M travel to pickaisle.con(A_i)
! U+ M* e9 @% Q' @; h0 I9 {5 ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# S5 v- M" h1 j! \' ~ else wait for 10 sec- v: v6 T7 w4 V0 z
if A_i=A_leave then send to die! o9 s$ ]% _" r _% J/ `
else inc A_i by 1
' I4 P' ]$ a5 {! ^ end# A+ ~* O8 s, J& v
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,其它按你的 ...
|