ajout de setters pour Label et debut de Dijkstra
This commit is contained in:
parent
67d0edeb0d
commit
fefe2d3a62
2 changed files with 26 additions and 5 deletions
|
@ -1,11 +1,7 @@
|
|||
package org.insa.graphs.algorithm.shortestpath;
|
||||
|
||||
import org.insa.graphs.algorithm.AbstractInputData;
|
||||
import org.insa.graphs.algorithm.utils.BinaryHeap;
|
||||
import org.insa.graphs.model.Graph;
|
||||
import org.insa.graphs.model.Node;
|
||||
import org.insa.graphs.model.Arc;
|
||||
import org.insa.graphs.model.Path;
|
||||
|
||||
|
||||
public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
||||
|
@ -31,7 +27,13 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
|||
ShortestPathSolution solution = null;
|
||||
|
||||
// TODO: implement the Dijkstra algorithm
|
||||
// On crée un tableau de label avec un label pour chacun des noeuds :de 0 à N-1
|
||||
Label tableau_label[] = new Label[nbNodes] ;
|
||||
// on commence par mettre tous les label à +inf (soit ici la plus grande valeur possible)
|
||||
for (int i=0;i<nbNodes;i++) {
|
||||
|
||||
}
|
||||
// On met la valeur du label de l'origine à 0
|
||||
// when the algorithm terminates, return the solution that has been found
|
||||
return solution;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,25 @@ public class Label {
|
|||
// arc correspondant au chemin (le plus court car on peut avoir plusieurs arcs) du père vers le sommet courant
|
||||
private Arc arcpere_fils;
|
||||
|
||||
//setter sommet courant
|
||||
public void setsommetcourant (int sommet_courant) {
|
||||
this.sommet_courant = sommet_courant;
|
||||
}
|
||||
//setter marque
|
||||
public void setmarque (boolean marque) {
|
||||
this.marque = marque;
|
||||
}
|
||||
|
||||
//setter cout_realise
|
||||
public void setcoutrealise(int cout_realise) {
|
||||
this.cout_realise = cout_realise;
|
||||
}
|
||||
|
||||
//setter arcpere_fils
|
||||
public void setarcperefils (Arc arcpere_fils) {
|
||||
this.arcpere_fils = arcpere_fils;
|
||||
}
|
||||
|
||||
//getter sommet courant
|
||||
public int getsommetcourant () {
|
||||
return this.sommet_courant;
|
||||
|
@ -25,7 +44,7 @@ public class Label {
|
|||
return this.marque;
|
||||
}
|
||||
|
||||
//getter cout_realise a verifier si c'est la meme chose que cout_realisé
|
||||
//getter cout_realise (a verifier si c'est la meme chose que cout_realisé)
|
||||
public int getCost() {
|
||||
return this.cout_realise;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue