Algoritmos Heurísticos de Cobertura de Arcos
Algoritmos Heurísticos de Cobertura de Arcos
Algoritmos Heurísticos de Cobertura de Arcos
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
egin<br />
AssignFile(Re<strong>de</strong>,ArqNome);<br />
Reset(Re<strong>de</strong>);<br />
Readln(Re<strong>de</strong>);<br />
For II:=1 To M Do<br />
Begin<br />
Readln(Re<strong>de</strong>,a,Link,Noi,I,J,Nof,I1,J1,d,Freq1,Freq2);<br />
If Link=0<br />
Then OrientaAresta(Freq1,Freq2,J*CompArco,I*CompArco,J1*CompArco,I1*CompArco,PaintBox1)<br />
else Freq1:=Freq1-1;<br />
NumCopias:= Freq1+Freq2;<br />
If NumCopias >0 Then<br />
For k := 1 to NumCopias do<br />
begin<br />
AchaCoordCopiak(k,J*CompArco,I*CompArco,J1*CompArco,I1*CompArco,xc1,yc1,xc2,yc2);<br />
CriaCopia(Freq1,Freq2,xc1,yc1,xc2,yc2,PaintBox1);<br />
end;<br />
End;<br />
CloseFile(Re<strong>de</strong>);<br />
end;<br />
Procedure MovimentaArco(Or<strong>de</strong>m,x1,y1,x2,y2:Integer;PaintBox1:TPaintBox);<br />
// Cria movimento num link tipo arco<br />
var i,xs,ys,xt,yt,dx,dy,LargSeta: Integer;<br />
ponto1x,ponto2x,ponto3x,ponto1y,ponto2y,ponto3y:Integer;<br />
begin<br />
PaintBox1.Canvas.Pen.Width:=PenaDiag + 1;<br />
PaintBox1.Canvas.Pen.Color:=clBlue;<br />
If Or<strong>de</strong>m=3 Then PaintBox1.Canvas.Pen.Color:=ClRed;<br />
If Or<strong>de</strong>m=2 Then PaintBox1.Canvas.Pen.Color:=ClYellow;<br />
If Or<strong>de</strong>m=1 Then PaintBox1.Canvas.Pen.Color:=clMaroon;<br />
If ((x1 = x2) or (y1 = y2)) and (BotaoAcionado0)<br />
Then PaintBox1.Canvas.Pen.Width:=PenaNormal+2;<br />
xs:=x1;<br />
ys:=y1;<br />
PaintBox1.Canvas.MoveTo(xs,ys);<br />
For i:= 1 to 20 do<br />
begin<br />
//xt:=Round((x2-x1)*0.05)+xs;<br />
//yt:=Round((y2-y1)*0.05)+ys;<br />
xt:=Round((x2-x1)*0.05*i)+x1;<br />
yt:=Round((y2-y1)*0.05*i)+y1;<br />
If ((abs(x2-xt)