|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; f& U+ T$ A- m, C' C
" @8 f1 d) {6 F4 C我的问题是,在每个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 W! M- ~0 F) i- E2 G$ w: Q
begin P_read arriving0 z: v8 ^' T0 z# C2 H
while 1=1 do begin* n# X: B# Q$ A, ]( T
read A_tote from "data.txt" with delimiter "\n"
- [4 `: F' K, l% y7 @9 P0 [ read A_time from "data.txt" with delimiter "\n"
1 q: l& Q. D' I; C" {) t read A_leave from "data.txt" with delimiter "\n"
# q5 E5 b7 y }! D. v0 G read A_picks from "data.txt" with delimiter "\n"
3 Z8 U, x9 x' Q- f1 c* {& w! ` set load type to A_tote8 g! Q% c3 D9 }5 ?% d
if A_tote="tote 1" then set A_induct to 1- k2 ^# s3 L! s0 _% |
else if A_tote="tote 2" then set A_induct to 2
1 G0 B) L; M U else set A_induct to 3
. Q( @" p% |1 N4 N) Y! J& s set A_i to 0- L) @8 ]- b8 a/ J# n
clone 1 load to P_induction
: {- `+ ^3 V' p wait for A_time sec2 F( E" Q1 p4 e* w
end
6 d) }# h! }" cend. ]6 y1 y4 U( {. ` z/ L
Y$ d! L* `* ?! z7 j' w/ @4 S3 p
begin P_induction arriving
/ f* @$ d/ v, K- O" ? O) m$ K. {1 [3 z if A_induct=1 then clone 1 load to P_pick14 N( V( r) p# b5 |8 M8 n
else if A_induct=2 then clone 1 load to P_pick2. v% Y' U, A) H) U1 |
else clone 1 load to P_pick3
- [% P5 B) _9 {8 Z4 W1 B( {& y; \* ?end# E# Z9 ^) {# P" B l- h3 ?$ `, c7 x
& \* J4 W$ E( s/ X6 }7 Pbegin P_pick1 arriving! w* N) Y! Z: N* _% j
set A_i to 1
# m: |( q. N" F$ P6 e1 H move into Q_induct19 e+ @6 O4 C2 a9 L$ C
move into pickaisle.induct1: Q) }' r! @: I
while A_i<=30 do begin' {1 w8 a7 @# u. |2 Z6 y$ a/ v- @
travel to pickaisle.con(A_i)6 }0 U _8 a/ C2 W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ ^& Q, k/ v$ w: f. G$ D) p else wait for 10 sec3 p* R- N: A! [4 _
if A_i=A_leave then send to die
' P) s9 d+ _8 @) X/ x else inc A_i by 1+ c7 l n1 u6 l; V+ V1 L
end
' c/ l' a5 m0 r% O5 g- @end
7 ^6 E: c7 O) i+ c. t7 J+ e' ~* ]% a3 z
begin P_pick2 arriving- g0 x$ g4 N. S% X1 c
set A_i to 11
& R+ C" L+ F" I move into Q_induct2/ @6 \7 ?8 [9 Y# N
move into pickaisle.induct2
" ?: I4 g7 ~' r1 w, E& y while A_i<=30 do begin
* T C' P& Q" Y% b travel to pickaisle.con(A_i)
- @5 |/ I; ~! x0 ~$ z4 t) | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 H5 J: C7 W0 O0 ?
else wait for 10 sec: M# p% E, L5 s% a/ w8 q
if A_i=A_leave then send to die
$ M% b+ H0 l+ G2 F else inc A_i by 1
3 v& y4 n1 K0 [9 K& r' L end; t* D9 ~( b9 n; }) G7 K
end
T: u6 d2 l3 u) \/ j" z4 h/ d
' K+ F% F/ O% p- [+ x6 t5 v& ibegin P_pick3 arriving
& D8 F& ~( a) r! j/ M set A_i to 21/ q* D9 a9 x. u" x" l# g* w* w
move into Q_induct3/ _+ o5 b9 V9 U/ Z7 g* ~) L' T
move into pickaisle.induct3' C$ O! h* A+ Y2 Y1 C4 I& ?0 q( h4 [
while A_i<=30 do begin
/ b& Q' L* X3 O, k travel to pickaisle.con(A_i)
0 B( w- ~# Q; s* }) b% S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, v, c" @; O# s! b1 A8 [
else wait for 10 sec9 C. ?' S1 _. ~) S
if A_i=A_leave then send to die, i3 w! e$ X0 j9 ?; I3 J( D- u
else inc A_i by 18 k& } T" N! o+ ~# t
end
$ W* g- ^; Q. T: k9 Z) Hend |
最佳答案
查看完整内容
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,其它按你的 ...
|