public class

ADStarNodeImpl

extends AbstractNode<A, S, N extends AbstractNode<A, S, N>>
implements ADStarNode<A, S, C extends Comparable<C>, N extends ADStarNode<A, S, C, N>>
java.lang.Object
   ↳ es.usc.citius.hipster.model.AbstractNode<A, S, N extends es.usc.citius.hipster.model.AbstractNode<A, S, N>>
     ↳ es.usc.citius.hipster.model.impl.ADStarNodeImpl<A, S, C extends java.lang.Comparable<C>>

Class Overview

Interface defining the basic operations for Node to be used with ADStarForward. Contains the declaration of the methods to retrieve te cost elements of the node (G and V) and the definition of the ADStarNodeImpl.Key to compare ADStarNodeImpl elements.

Summary

Fields
protected boolean doUpdate
protected C extends Comparable<C> g
protected Key<C extends Comparable<C>> key
protected C extends Comparable<C> v
[Expand]
Inherited Fields
From class es.usc.citius.hipster.model.AbstractNode
Public Constructors
ADStarNodeImpl(Transition<A, S> transition, ADStarNodeImpl<A, S, C> previousNode, C g, C v, Key<C> k)
Default constructor for ADStarNode.
Public Methods
int compareTo(ADStarNodeImpl<A, S, C> o)
Compares ADSTarNode instances attending to their ADStarNode.Key values.
C getCost()
C getEstimation()
Return the estimated cost to goal state from the current state.
C getG()
Cost from beginning state.
C getScore()
Retrieves the total cost (typically f = g + h) of this node, where g = getCost() and h = getEstimation()
C getV()
Score to goal given as heuristic.
boolean isConsistent()
Returns if the node is in a consistent state or not.
boolean isDoUpdate()
ADStarNodeImpl<A, S, C> previousNode()
Method to retrieve the parent ADStarNode, the same retrieved by getFromState().
void setAction(A action)
void setDoUpdate(boolean doUpdate)
void setG(C g)
void setKey(Key<C> key)
void setPreviousNode(ADStarNodeImpl<A, S, C> parent)
void setState(S state)
void setV(C v)
[Expand]
Inherited Methods
From class es.usc.citius.hipster.model.AbstractNode
From class java.lang.Object
From interface es.usc.citius.hipster.model.ADStarNode
From interface es.usc.citius.hipster.model.CostNode
From interface es.usc.citius.hipster.model.HeuristicNode
From interface es.usc.citius.hipster.model.Node
From interface java.lang.Comparable

Fields

protected boolean doUpdate

protected C extends Comparable<C> g

protected Key<C extends Comparable<C>> key

protected C extends Comparable<C> v

Public Constructors

public ADStarNodeImpl (Transition<A, S> transition, ADStarNodeImpl<A, S, C> previousNode, C g, C v, Key<C> k)

Default constructor for ADStarNode. Requires the transition used to reach the new one and the previous node. The current cost (G), score (V) and key to compare between ADStarNode instances are also required.

Parameters
transition incoming transition
previousNode parent node
g accumulated cost from begin
v score to goal
k key value evaluated over G and V

Public Methods

public int compareTo (ADStarNodeImpl<A, S, C> o)

Compares ADSTarNode instances attending to their ADStarNode.Key values.

Parameters
o ADStarNode instance
Returns
  • usual comparison value

public C getCost ()

public C getEstimation ()

Return the estimated cost to goal state from the current state.

Returns
  • cost estimation.

public C getG ()

Cost from beginning state.

Returns
  • object representing the current cost

public C getScore ()

Retrieves the total cost (typically f = g + h) of this node, where g = getCost() and h = getEstimation()

Returns
  • total cost (f function).

public C getV ()

Score to goal given as heuristic.

Returns
  • object representing the estimated cost to goal

public boolean isConsistent ()

Returns if the node is in a consistent state or not.

Returns
  • v > g

public boolean isDoUpdate ()

public ADStarNodeImpl<A, S, C> previousNode ()

Method to retrieve the parent ADStarNode, the same retrieved by getFromState().

Returns

public void setAction (A action)

public void setDoUpdate (boolean doUpdate)

public void setG (C g)

public void setKey (Key<C> key)

public void setPreviousNode (ADStarNodeImpl<A, S, C> parent)

public void setState (S state)

public void setV (C v)