11.05.2013 Views

Evaluación de Algoritmos de Ruteamiento Multipunto en Redes de ...

Evaluación de Algoritmos de Ruteamiento Multipunto en Redes de ...

Evaluación de Algoritmos de Ruteamiento Multipunto en Redes de ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

No<strong>de</strong>ListEntry *Entra1;<br />

int NumDestAgreg = 0;<br />

int elmejor;<br />

int fromBC;<br />

int nodosBC;<br />

///<br />

int seg1, seg2;<br />

int ArbolParcialId;<br />

int AdjEvalId;<br />

double contrib = 0.0;<br />

double suma = 0.0;<br />

double invsuma = 0.0;<br />

double *Contribucion;<br />

double *CostMatrixBC;<br />

CostMatrixBC = new double[num*num];<br />

int *<strong>de</strong>s<strong>de</strong>;<br />

<strong>de</strong>s<strong>de</strong> = new int[num];<br />

double *CostLCMatrix;<br />

CostLCMatrix = new double[num];<br />

Contribucion = new double[num];<br />

int i,j;<br />

short *pVisitedBC = new short[num]; // Indicador <strong>de</strong> visitado<br />

short *flagDestin2 = new short [num]; // 1 si es un <strong>de</strong>stino, 0 <strong>en</strong> cualquier otro<br />

caso<br />

short *pAgreg = new short[num]; // Indicador <strong>de</strong> Agregado al Arbol;<br />

//////////<strong>en</strong>d variables /////<br />

//////////////////////////Ahora_BestContribution /////////////////////////////////////<br />

//Inicio Para Marcar a los nodos agregados al arbol<br />

for (int bb = 0; bb < num; bb++) {<br />

pAgreg[bb] = 0; //marca como no agregado a todos los nodos excepto la fu<strong>en</strong>te<br />

if ( bb == source->name() ) {<br />

pAgreg[bb] = 1; //marca a la fu<strong>en</strong>te como agregada<br />

//printf("Fu<strong>en</strong>te : %d \n", bb);<br />

}<br />

}<br />

/////////fin marca nodos agregados<br />

//La fu<strong>en</strong>te es el primer miembro <strong>en</strong> el arbol<br />

No<strong>de</strong>ListEntry *Entra0 = new No<strong>de</strong>ListEntry;<br />

No<strong>de</strong>ListEntry *UltEntra = new No<strong>de</strong>ListEntry; //Ultima <strong>en</strong>trada<br />

Entra0->no<strong>de</strong>Ptr(source);<br />

source->addRoutingEntry(addr, source);<br />

UltEntra = Entra0;<br />

////fin fu<strong>en</strong>te primer miembro <strong>en</strong> el arbol<br />

///////////Marca los Destinos<br />

short *flagDestin = new short [num]; // 1 si es un <strong>de</strong>stino, 0 <strong>en</strong> cualquier otro caso<br />

No<strong>de</strong>ListEntry *Marca;<br />

Marca = group->headm();<br />

while(Marca != NULL) {<br />

flagDestin[Marca->no<strong>de</strong>Ptr()->name()] = 1;<br />

//printf("Miembro : %d\n", Marca->no<strong>de</strong>Ptr()->name());<br />

Marca = Marca->next();<br />

}<br />

///////////fin marca Destinos<br />

///Ahora se va armando el arbol final a partir <strong>de</strong> atachar cada nodo<br />

//adjunto que mejor contribuye al arbol parcial<br />

///Para experim<strong>en</strong>tos <strong>en</strong> don<strong>de</strong> la fu<strong>en</strong>te pue<strong>de</strong> salir como un miembro por<br />

aleatoriedad///<br />

if ( flagDestin[source->name()] == 1 ) {<br />

NumDestAgreg = 1;<br />

//printf("OJO FUENTE ES UN MIEMBRO\n");<br />

105

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!