wyvern.kernel.monsters
Class AStarSearch.Node

java.lang.Object
  extended bywyvern.kernel.monsters.AStarSearch.Node
Enclosing class:
AStarSearch

public final class AStarSearch.Node
extends java.lang.Object

A node in the search graph.


Field Summary
 double cost_
           
 int depth_
           
 double f_
           
 double heuristic_
           
 Point loc_
           
 AStarSearch.Node parent_
           
 int px_
           
 int py_
           
 Commandable target_
           
 int x_
           
 int y_
           
 
Constructor Summary
AStarSearch.Node(int nodex, int nodey)
          Constructs a new Node for the specified location.
 
Method Summary
 void clear()
          Clears all the fields back to their defaults.
 void computeCost()
          Looks in the map to see what the actual base cost for this node is.
 void computeHeuristic()
          Computes the estimated distance to the goal node.
 java.lang.String toString()
          Prints debugging string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

x_

public int x_

y_

public int y_

loc_

public Point loc_

cost_

public double cost_

heuristic_

public double heuristic_

f_

public double f_

parent_

public AStarSearch.Node parent_

target_

public Commandable target_

px_

public int px_

py_

public int py_

depth_

public int depth_
Constructor Detail

AStarSearch.Node

public AStarSearch.Node(int nodex,
                        int nodey)
Constructs a new Node for the specified location.

Method Detail

clear

public void clear()
Clears all the fields back to their defaults.


toString

public java.lang.String toString()
Prints debugging string.


computeHeuristic

public void computeHeuristic()
Computes the estimated distance to the goal node. One useful side effect of this method: it stores the player closest to this node in the node's "player" field. Makes it easy to check if it's a goal node.


computeCost

public void computeCost()
Looks in the map to see what the actual base cost for this node is. Only called if it's the first time we've created a node for this location during this search.