Maj Label Marie

This commit is contained in:
Marie Brunetto 2023-03-29 16:56:57 +02:00
parent fd94262203
commit 7bc2a1b71d

View file

@ -1,36 +1,38 @@
package org.insa.graphs.algorithm.shortestpath; package org.insa.graphs.algorithm.shortestpath;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import org.insa.graphs.algorithm.AbstractSolution.Status;
import org.insa.graphs.model.Arc; import org.insa.graphs.model.Arc;
import org.insa.graphs.model.Graph;
import org.insa.graphs.model.Node; import org.insa.graphs.model.Node;
import org.insa.graphs.model.Path;
public class Label { public class Label {
/* Sommet associé à ce label (sommet ou numéro de sommet) */ /* Sommet associé à ce label (sommet ou numéro de sommet) */
Node sommetCourant ; protected Node sommetCourant ;
/* Booléen vrai lorque le coût min de ce sommet est définitivement connu par l'algorithme */ /* Booléen vrai lorque le coût min de ce sommet est définitivement connu par l'algorithme */
Boolean marque ; protected boolean marque ;
/* Valeur courante du plus court chemin depuis l'origine vers le sommet */ /* Valeur courante du plus court chemin depuis l'origine vers le sommet */
double coutRealise ; protected double coutRealise ;
/* correspond au sommet précédent sur le chemin correspondant au plus court chemin courant */ /* correspond au sommet précédent sur le chemin correspondant au plus court chemin courant */
Arc pere ; protected Arc pere ;
public Label(Node sommetCourant, Boolean marque, int coutRealise, Arc pere) { public Label(Node sommetCourant) {
this.sommetCourant = sommetCourant ; this.sommetCourant = sommetCourant ;
this.marque = marque ; this.marque = false;
this.coutRealise = coutRealise ; this.coutRealise = -1.0 ;
this.pere = pere ; this.pere = null ;
} }
public void setMarqueTrue() {
this.marque = true;
}
public void setNouveauChemin(Arc arcPere, double coutRealise){
this.pere = arcPere;
this.coutRealise = coutRealise;
}
} }