new labelstar
This commit is contained in:
parent
734fa38388
commit
64b2a4818a
2 changed files with 6 additions and 9 deletions
|
@ -60,16 +60,17 @@ public class Label implements Comparable<Label>{
|
||||||
this.marque = true;
|
this.marque = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Setter Pour Cout et Perer */
|
/* Setter Pour Cout et Pere */
|
||||||
public void setNouveauChemin(Arc arcPere, double coutRealise){
|
public void setNouveauChemin(Arc arcPere, double coutRealise){
|
||||||
this.pere = arcPere;
|
this.pere = arcPere;
|
||||||
this.coutRealise = coutRealise;
|
this.coutRealise = coutRealise;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getTotalCost() {
|
public double getTotalCost() {
|
||||||
return this.coutRealise + ;
|
return this.coutRealise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compare the ID of this node with the ID of the given node.
|
* Compare the ID of this node with the ID of the given node.
|
||||||
*
|
*
|
||||||
|
|
|
@ -9,8 +9,6 @@ public class LabelStar extends Label {
|
||||||
|
|
||||||
/* ATTRIBUT */
|
/* ATTRIBUT */
|
||||||
|
|
||||||
private double totalCost ;
|
|
||||||
|
|
||||||
private double estimationCostDest ;
|
private double estimationCostDest ;
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,20 +16,18 @@ public class LabelStar extends Label {
|
||||||
|
|
||||||
public LabelStar(Node sommetCourant, Node Dest) {
|
public LabelStar(Node sommetCourant, Node Dest) {
|
||||||
super(sommetCourant) ;
|
super(sommetCourant) ;
|
||||||
this.totalCost = 0.0 ;
|
|
||||||
this.estimationCostDest = sommetCourant.getPoint().distanceTo(Dest.getPoint());
|
this.estimationCostDest = sommetCourant.getPoint().distanceTo(Dest.getPoint());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* METHODES */
|
/* METHODES */
|
||||||
|
|
||||||
public void calculTotalCost() {
|
public double getEstimation() {
|
||||||
totalCost = this.getCoutRealise() + this.estimationCostDest ;
|
return this.estimationCostDest ;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getTotalCost() {
|
public double getTotalCost() {
|
||||||
return this.totalCost ;
|
return this.getCoutRealise() + this.estimationCostDest ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue