Merge branch 'master' of https://git.etud.insa-toulouse.fr/brunetto/BEGraphes
This commit is contained in:
커밋
7254b3000e
2개의 변경된 파일과 13개의 추가작업 그리고 43개의 파일을 삭제
|
@ -1,10 +1,5 @@
|
||||||
package org.insa.graphs.algorithm.shortestpath;
|
package org.insa.graphs.algorithm.shortestpath;
|
||||||
|
|
||||||
import org.insa.graphs.algorithm.utils.BinaryHeap;
|
|
||||||
import java.util.ArrayList ;
|
|
||||||
import org.insa.graphs.model.Node;
|
|
||||||
import org.insa.graphs.model.Arc;
|
|
||||||
|
|
||||||
public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
||||||
|
|
||||||
public DijkstraAlgorithm(ShortestPathData data) {
|
public DijkstraAlgorithm(ShortestPathData data) {
|
||||||
|
@ -15,42 +10,7 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
||||||
protected ShortestPathSolution doRun() {
|
protected ShortestPathSolution doRun() {
|
||||||
final ShortestPathData data = getInputData();
|
final ShortestPathData data = getInputData();
|
||||||
ShortestPathSolution solution = null;
|
ShortestPathSolution solution = null;
|
||||||
|
// TODO:
|
||||||
|
|
||||||
int i ;
|
|
||||||
|
|
||||||
/* Taille du graphe */
|
|
||||||
int tailleGraphe = data.getGraph().size() ;
|
|
||||||
|
|
||||||
/* Tableau contenant tous les labels */
|
|
||||||
ArrayList<Label> labelSommets = new ArrayList<Label>() ;
|
|
||||||
|
|
||||||
/* Déclaration du label */
|
|
||||||
Label currentLabel ;
|
|
||||||
|
|
||||||
/* Déclaration du tas */
|
|
||||||
BinaryHeap<Integer> leTas = new BinaryHeap<Integer>() ;
|
|
||||||
|
|
||||||
/* Compte le nombre de sommets marqués */
|
|
||||||
int nbrMarques = 0 ;
|
|
||||||
|
|
||||||
int x ;
|
|
||||||
|
|
||||||
for(i=0;i<tailleGraphe;i++) {
|
|
||||||
/* Initialisation */
|
|
||||||
currentLabel = new Label(data.getGraph().get(i)) ;
|
|
||||||
labelSommets.set(i, currentLabel) ; //On met notre label dans le tableau dédié
|
|
||||||
}
|
|
||||||
|
|
||||||
leTas.insert(data.getOrigin().)
|
|
||||||
|
|
||||||
while (currentLabel.marque = false) {
|
|
||||||
x = leTas.deleteMin() ;
|
|
||||||
for (Arc arc : data.getGraph().getNodes()) {
|
|
||||||
currentLabel = new Label(node) ;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return solution;
|
return solution;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@ package org.insa.graphs.algorithm.shortestpath;
|
||||||
import org.insa.graphs.model.Arc;
|
import org.insa.graphs.model.Arc;
|
||||||
import org.insa.graphs.model.Node;
|
import org.insa.graphs.model.Node;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class Label {
|
public class Label {
|
||||||
|
|
||||||
/* ATTRIBUTS */
|
/* ATTRIBUTS */
|
||||||
|
@ -57,6 +55,18 @@ public class Label {
|
||||||
return this.pere ;
|
return this.pere ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Setter Pour Marque */
|
||||||
|
public void setMarqueTrue() {
|
||||||
|
this.marque = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Setter Pour Cout et Perer */
|
||||||
|
public void setNouveauChemin(Arc arcPere, double coutRealise){
|
||||||
|
this.pere = arcPere;
|
||||||
|
this.coutRealise = coutRealise;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
불러오는 중…
Reference in a new issue