Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void backup(SMANode node, SearchableGraph map, OpenQueue open){
- if(completed(node, map, open) && node.parent != null){
- double lowestFcost = Double.POSITIVE_INFINITY;
- //find lowest fcost of Successors
- for(String link : map.getLinks(node.label)){
- double childFcost = node.cost +
- map.getPathCost(node.label,link) +
- map.getHeuristic(link);
- if(childFcost < lowestFcost){
- lowestFcost = childFcost;
- }
- }
- if(node.fcost != lowestFcost){
- node.fcost = lowestFcost;
- backup(node.parent, map, open);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement