AStarNode

public class AStarNode implements Comparable<AStarNode>

Note: compareTo and equals are not equivalently implemented equals checks xs and ys, but no other fields

Fields

directionfromprevious

final Direction directionfromprevious

durativesteps

final int durativesteps

g

final int g

hashCode

final int hashCode

value

final int value

x

final int x

y

final int y

Constructors

AStarNode

public AStarNode(int x, int y, int g, int value, AStarNode previous, Direction directionfromprevious)

Create a nonroot node with fields so for backtracking.

Parameters:
  • x
  • y
  • g
  • value
  • previous
  • directionfromprevious

AStarNode

public AStarNode(int x, int y, int g, int value, AStarNode previous, Direction directionfromprevious, int durativesteps)

Create a nonroot node with fields so for backtracking.

Parameters:
  • x
  • y
  • g
  • value
  • previous
  • directionfromprevious
  • durativesteps

AStarNode

public AStarNode(int x, int y, int distfromgoal)

Create a new root node

Parameters:
  • x
  • y
  • distfromgoal

Methods

compareTo

public int compareTo(AStarNode other)

equals

public boolean equals(Object other)

hashCode

public int hashCode()

toString

public String toString()