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.
end;<br />
CriaNo(J*CompArco,I*CompArco,PaintBox1);<br />
Procedure DesenhaGrafoSolucaoMapa(ArqMapa,ArqNome,ArqSol: String; PaintBox1: TPaintBox);<br />
// Desenha a solução <strong>de</strong> roteiro, a partir <strong>de</strong> um arquivo<br />
// <strong>de</strong> solução <strong>de</strong> GLS, gerado na UPrincipal<br />
var II,x,y,x1,y1,x2,y2,Freq1,Freq2,Or<strong>de</strong>m:Integer;<br />
a,Link,Noi,I,J,Nof,I1,J1,I2,J2,d,Sentido:Integer;<br />
k,NumCopias,xc1,yc1,xc2,yc2,NumLink,NumLinkCad:Integer;<br />
InicioRota, FimRota: Integer;<br />
Tipo,Simbolo: String[1];<br />
Arq: Array[1..MaxLink] of TLink;<br />
Rota: Array[1..MaxRota] of TRota;<br />
RegTemp: TRota;<br />
No: Array[1..MaxNo] of TNo;<br />
Demora:Real;<br />
begin<br />
CompArco:=1;<br />
Form10.Visible:=true;<br />
Form10.Image1.Visible:=true;<br />
Form10.OpenPictureDialog1.FileName:=ArqMapa;<br />
Form10.Image1.Picture.LoadFromFile(Form10.OpenPictureDialog1.FileName);<br />
Form10.Refresh;<br />
AssignFile(Re<strong>de</strong>,ArqNome); //Arquivo Grafo Transformado<br />
Reset(Re<strong>de</strong>);<br />
Repeat<br />
ReadLn(Re<strong>de</strong>,Simbolo);<br />
Until Simbolo = '$';<br />
Read(Re<strong>de</strong>,M,N,NL,NC,MA,ME);<br />
i:=0;<br />
Repeat<br />
Read(Re<strong>de</strong>,Simbolo); // lendo os nós Inicio e Fim da Rota<br />
i:=i+1;<br />
Until (Simbolo='#') or (i>50);<br />
If Simbolo='#'<br />
then ReadLn(Re<strong>de</strong>,InicioRota,FimRota)<br />
else begin<br />
ReadLn(Re<strong>de</strong>);<br />
InicioRota:=1;<br />
FimRota:=1;<br />
end;<br />
For i:= 1 to N do<br />
begin<br />
No[i].ci:= 0;<br />
No[i].cj:= 0;<br />
end;<br />
For i:= 1 to M do //Carrega vetor Arq <strong>de</strong> links junto<br />
begin //com as coor<strong>de</strong>nadas dos nos<br />
Readln(Re<strong>de</strong>,a,Arq[i].Tipo,Arq[i].Noi,I1,J1,<br />
Arq[i].Nof,I2,J2,d);<br />
Noi:= Arq[i].Noi;<br />
Nof:= Arq[i].Nof;<br />
If No[Noi].ci = 0 Then<br />
begin<br />
No[Noi].ci := I1;<br />
No[Noi].cj := J1;<br />
end;<br />
If No[Nof].ci = 0 Then<br />
begin<br />
No[Nof].ci := I2;<br />
No[Nof].cj := J2;<br />
end;<br />
end;<br />
CloseFile(Re<strong>de</strong>);<br />
170