refactor(shortestPath): move pathCost from Dijkstra to parent class for testing
This commit is contained in:
parent
f62e312156
commit
8e7d933e7a
2 changed files with 6 additions and 6 deletions
|
@ -12,8 +12,6 @@ import org.insa.graphs.model.Path;
|
|||
|
||||
public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
||||
|
||||
private float pathCost;
|
||||
|
||||
public DijkstraAlgorithm(ShortestPathData data) {
|
||||
super(data);
|
||||
}
|
||||
|
@ -146,8 +144,4 @@ public class DijkstraAlgorithm extends ShortestPathAlgorithm {
|
|||
}
|
||||
return solution;
|
||||
}
|
||||
|
||||
public float getCostPath() {
|
||||
return this.pathCost;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@ import org.insa.graphs.model.Node;
|
|||
|
||||
public abstract class ShortestPathAlgorithm extends AbstractAlgorithm<ShortestPathObserver> {
|
||||
|
||||
protected float pathCost;
|
||||
|
||||
protected ShortestPathAlgorithm(ShortestPathData data) {
|
||||
super(data);
|
||||
}
|
||||
|
@ -66,4 +68,8 @@ public abstract class ShortestPathAlgorithm extends AbstractAlgorithm<ShortestPa
|
|||
obs.notifyDestinationReached(node);
|
||||
}
|
||||
}
|
||||
|
||||
public float getCostPath() {
|
||||
return this.pathCost;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue