|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, W0 K# H$ p$ m6 j5 [$ A) P
! i% k J8 A8 b
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 Y* T( j: H6 I0 h3 Q5 y! B2 D1 s+ N# h
begin P_read arriving# c: j% L$ J1 u- M3 d
while 1=1 do begin( c5 C8 u& A3 {0 V0 G$ U
read A_tote from "data.txt" with delimiter "\n"
" k3 k# {* {3 L6 g read A_time from "data.txt" with delimiter "\n"4 D+ O" Q. v8 L# A5 ]) l
read A_leave from "data.txt" with delimiter "\n"' H( F" {) ~8 F1 W+ n0 b u* S
read A_picks from "data.txt" with delimiter "\n"/ t3 L2 ~7 p9 f) |% w
set load type to A_tote
. g f) b% U! Q, x; ?: O: L$ k if A_tote="tote 1" then set A_induct to 1
7 D9 F7 P1 U2 G else if A_tote="tote 2" then set A_induct to 2
- `7 ?5 e' P! O. F9 ^ else set A_induct to 3 7 I) h6 H6 G8 U) Y
set A_i to 03 G" ]2 }) ?$ w& k4 S3 ^/ N2 p4 @
clone 1 load to P_induction
3 E5 F( L4 P" Q wait for A_time sec; R) R2 [& s) u6 g& x
end; [7 q+ J5 W3 i# p; p
end5 W6 o) D9 Q0 j0 k4 }+ p7 Q
) j! Z$ @: S! Y
begin P_induction arriving
: L9 R1 r! _! m: f. g if A_induct=1 then clone 1 load to P_pick1
. _3 B) q; G. R$ D1 B0 P+ e else if A_induct=2 then clone 1 load to P_pick23 x1 q% j& A/ h; b$ j- |0 b0 J
else clone 1 load to P_pick3) V7 L: y- U8 B: J$ K! g; q
end2 F1 W+ x! n: H
8 C' d( n4 z' i: E) g
begin P_pick1 arriving! r" A/ R" z7 V2 Y" A! ^- d
set A_i to 1
( p# X& a( C3 @, z% {& k. I$ @ move into Q_induct1 N2 r7 n0 A [+ `1 ]( f8 t) D
move into pickaisle.induct14 x6 A$ \# U! R( t. t( Z
while A_i<=30 do begin
. a, @' i6 D6 M7 `; V travel to pickaisle.con(A_i)
9 ~9 a& J! |5 h6 z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& p: T* d; c/ d
else wait for 10 sec: d5 y( }1 ?9 i! o
if A_i=A_leave then send to die
6 E2 C, o& O9 x* R& N, l6 O else inc A_i by 1
- o" U# l- e* t1 _( g5 p8 e* d end
: M$ n( @4 s8 H z+ ]# z5 \end
5 t* w& O; n( T+ @- ?4 d
0 |- `) E) P3 ]& w6 Ybegin P_pick2 arriving
# }( o, e: ]% {- X set A_i to 119 T: E& K$ P: w H
move into Q_induct29 v H0 Z+ {" o+ y# Q* Z9 N' ^! C
move into pickaisle.induct2
+ R" E ^. L4 _. { while A_i<=30 do begin! W. L, C6 f* V& Q# }2 E
travel to pickaisle.con(A_i)5 J/ `1 }) j0 s1 G- v8 V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 h4 i% G& N/ S. X/ Y) R2 m
else wait for 10 sec
. ]3 [" e% m& |+ Y I! G if A_i=A_leave then send to die
9 k: L: ~! e" c8 V1 } else inc A_i by 1
( L! F" x8 s, F4 |5 E+ ? end1 V5 f' [; ~$ H" F8 _( [
end# A8 N5 p5 ?& f' t' g
- T# X0 ?1 q% X1 Q% g# [3 F, V
begin P_pick3 arriving
. {. F6 ]' c @2 ~8 ^ ~6 F set A_i to 21+ k8 b2 A4 A2 K
move into Q_induct3
5 N; T/ x! G' r. m1 ^ move into pickaisle.induct3
6 J" i# ?4 E9 ]" J. ` while A_i<=30 do begin, E) t" m% q7 V/ Q3 H
travel to pickaisle.con(A_i): k- b- o; k, @; c0 u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 C1 }7 D2 G1 p' b else wait for 10 sec
$ Z) l1 {% O) W5 ^$ u% S if A_i=A_leave then send to die
0 P4 Y3 p+ b* d, _ else inc A_i by 1% m. w+ u5 T/ O: ~+ b8 f" O
end4 M2 L* _4 H" x; b
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,其它按你的 ...
|