|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; m! n: `: `( \+ n9 q/ X
: H: @8 w' I+ J! |- Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 \2 |" V, w( l& Q% u+ H* }) w* @* m
9 f8 b" Q5 [5 \7 ?begin P_read arriving- ^# n. }. U1 y- n }9 }
while 1=1 do begin' }2 L8 D& d- ?# X0 S
read A_tote from "data.txt" with delimiter "\n"
$ E3 n' C# f* c% C! c- N, R G read A_time from "data.txt" with delimiter "\n"
. q" y# U, i" |, Y+ w4 h% ?6 E read A_leave from "data.txt" with delimiter "\n"
+ n) j+ t6 j! x. z! Q read A_picks from "data.txt" with delimiter "\n"
" S! I4 |; U4 e5 G% @ set load type to A_tote$ p" D% x5 O/ ]$ O3 \" E- h
if A_tote="tote 1" then set A_induct to 1
( K. w, U l+ s9 E) O else if A_tote="tote 2" then set A_induct to 2
+ @5 g7 ]+ \! `# H/ Z* Y else set A_induct to 3
6 ~# B' m! `) W0 n. | set A_i to 0- \+ o- N @% \# }
clone 1 load to P_induction1 T% E g' K( |! W( J
wait for A_time sec
# k; }# x/ H+ s+ G7 [6 }7 M% |5 p end
! w( T8 B9 R* l' |, x6 H' I% pend9 _/ |3 d% o8 U& `$ O5 m
! m/ ^( h" ?" b7 Bbegin P_induction arriving9 T- Q1 Z; q6 M3 i3 w! q
if A_induct=1 then clone 1 load to P_pick1
$ I, ^9 I" U1 \1 ` else if A_induct=2 then clone 1 load to P_pick2) K# u# V% w5 @' Q6 ~$ }6 a! i
else clone 1 load to P_pick30 [1 d& ^8 c! W, }2 r8 F% R
end
1 A; V" y8 ?, @$ U3 H* D
, V. C, `$ x9 o- B7 vbegin P_pick1 arriving3 [, N% h. `8 U* f z( S
set A_i to 19 F9 C% G9 y# K
move into Q_induct1
4 X; Y! f) t+ t6 y! {4 D move into pickaisle.induct1
- D# K7 s L) v( i while A_i<=30 do begin
: U* o$ _# Q4 _4 {1 v/ a travel to pickaisle.con(A_i)
" s3 w% [! X) o# L# T2 [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ a2 |- F/ z) o: A' W
else wait for 10 sec
+ i, W5 Z: f/ w/ l) u3 _" ~ if A_i=A_leave then send to die
- j+ y+ _$ e6 W: p2 M* q else inc A_i by 10 [: E- v4 k( N: U* y" l6 ^
end( C, B3 N- t) U7 J6 e7 P' W! Z
end1 O! S. @/ [0 o. ~* R4 ?
2 v9 ?' V4 G) fbegin P_pick2 arriving
3 H l8 x$ G! n2 O$ W3 @ set A_i to 11
$ ^" N1 _9 P6 L& u move into Q_induct2/ U# I4 O! m, @( R) ?4 \- `
move into pickaisle.induct2 V- w, q( N2 q( Z% |
while A_i<=30 do begin8 ~0 U& ]8 X, r& z- N
travel to pickaisle.con(A_i)
" ?, I' H' ?7 b/ U b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* w/ p( l) r) L r* C% [
else wait for 10 sec
& I5 |: f) v# v) A0 A" k: X if A_i=A_leave then send to die
$ ^! G% h4 _$ j O* ~ else inc A_i by 1' v- w- Y6 t( T( V6 ~6 m/ Y0 e, a
end
( Y! u. @3 j8 J R0 W) t. oend$ G- S. J; O4 p- q: J$ L
' c5 V# o3 J" ~3 dbegin P_pick3 arriving
A1 d3 Q+ s5 q, o. t set A_i to 21* B( C" k' J4 v$ E. X* o" {6 k
move into Q_induct30 o; |2 I( n+ {" W% J: p
move into pickaisle.induct3
3 {+ B1 m6 @/ D8 i while A_i<=30 do begin0 C7 _ @1 a6 |/ i& u/ R
travel to pickaisle.con(A_i)5 s; s! M& i6 l* j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 M' S3 v! q. ~' ` else wait for 10 sec O$ G z3 o h( H: [
if A_i=A_leave then send to die
* V& S& y% ~5 v/ B2 N" s, b1 S else inc A_i by 15 M6 E0 ^6 A+ e- n' u: t; \
end3 E* F. j0 l5 A( _
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,其它按你的 ...
|