Version Fonctionnelle : Ajout de Label.java

This commit is contained in:
Paul Faure 2020-03-27 18:09:59 +01:00
parent e6be4aabac
commit 2822c7ad72

View file

@ -0,0 +1,43 @@
package org.insa.graphs.algorithm.shortestpath;
import org.insa.graphs.model.Node;
import org.insa.graphs.model.Arc;
public class Label {
private Node sommetCourant;
private boolean marque;
private double cout;
private Arc pere;
public Label(Node init_Node) {
this.sommetCourant = init_Node;
this.marque = false;
this.cout = Double.POSITIVE_INFINITY;
this.pere = null;
}
public Node getSommetCourant() {
return this.sommetCourant;
}
public boolean isMarque() {
return this.marque;
}
public double getCost() {
return this.cout;
}
public Arc getPere() {
return this.pere;
}
public void actualiser(double cout, Arc pere) {
this.cout = cout;
this.pere = pere;
}
public void marquer() {
this.marque = true;
}
}