Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Movement implements Comparable
- {
- public Node node;
- public int movementCost;
- private int heuristicCost;
- public Movement(Node node, int movementCost, int heuristicCost)
- {
- this.node = node;
- this.movementCost = movementCost;
- this.heuristicCost = heuristicCost;
- }
- public int getTotalCost()
- {
- return movementCost + heuristicCost;
- }
- public int compareTo(Object o)
- {
- Movement cNode = (Movement) o;
- return new Integer(getTotalCost()).compareTo(cNode.getTotalCost());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement