org.jscience.computing.ai
Interface Navigable

All Known Implementing Classes:
AStarMap, StandardMap2D

public interface Navigable

A simple interface to allow pathfinders like the A algorithm to navigate through the environment.


Method Summary
 int createNodeID(Pathfinder.Node node)
          Generate a unique ID for a given node.
 double getCost(Pathfinder.Node n1, Pathfinder.Node n2)
          Return the cost to travel from node 1 to node 2.
 double getDistance(Pathfinder.Node n1, Pathfinder.Node n2)
          Return the distance between the node 1 and node 2.
 boolean isValid(Pathfinder.Node node)
          Determines whether the given node is valid.
 

Method Detail

isValid

boolean isValid(Pathfinder.Node node)
Determines whether the given node is valid.

Parameters:
node - the node.
Returns:
the validity of the node.

getCost

double getCost(Pathfinder.Node n1,
               Pathfinder.Node n2)
Return the cost to travel from node 1 to node 2.

Parameters:
n1 - the first node.
n2 - the second node.
Returns:
the cost required to travel.

getDistance

double getDistance(Pathfinder.Node n1,
                   Pathfinder.Node n2)
Return the distance between the node 1 and node 2. Note that "distance" is not always in terms of Manhattan or Eucledian distances.

Parameters:
n1 - the first node.
n2 - the second node.
Returns:
the distance between the two nodes.

createNodeID

int createNodeID(Pathfinder.Node node)
Generate a unique ID for a given node. Note that the ID must be tied to its properties, such as positional information. Nodes with the same information should be assigned the same ID.

Parameters:
node - the node.
Returns:
the node's ID.