LabelStar conmencé
This commit is contained in:
parent
e32fb51fa4
commit
39ea623f84
2 changed files with 35 additions and 1 deletions
|
@ -56,10 +56,19 @@
|
|||
{
|
||||
this.currentNode = currentNode;
|
||||
}
|
||||
|
||||
public double getTotalCost()
|
||||
{
|
||||
return this.getCost();
|
||||
}
|
||||
|
||||
public int compareTo(Label label)
|
||||
{
|
||||
return Double.compare(getCost(), label.getCost());
|
||||
int i = Double.compare(this.getTotalCost(), label.getTotalCost());
|
||||
if (i == 0){
|
||||
i = Double.compare(label.getCost(), this.getCost());
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package org.insa.graphs.algorithm.shortestpath;
|
||||
|
||||
import org.insa.graphs.model.*;
|
||||
|
||||
public class LabelStar extends Label {
|
||||
private double CostEstime;
|
||||
|
||||
public LabelStar(Node node){
|
||||
super(node);
|
||||
this.CostEstime = Double.POSITIVE_INFINITY ;
|
||||
}
|
||||
|
||||
public double getCostEstime(){
|
||||
return CostEstime;
|
||||
}
|
||||
|
||||
public void setCostEstime(double CostEstime){
|
||||
this.CostEstime = CostEstime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getTotalCost(){
|
||||
return super.getCost() + getCostEstime();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue