public class

ADStarForward.Iterator

extends Object
implements Iterator<E>
java.lang.Object
   ↳ es.usc.citius.hipster.algorithm.ADStarForward.Iterator

Class Overview

Internal iterator that implements all the logic of the A* search

Summary

Fields
protected final N extends ADStarNode<A, S, C extends Comparable<C>, N> beginNode
protected Map<S, N extends ADStarNode<A, S, C extends Comparable<C>, N>> closed
protected final Collection<N extends ADStarNode<A, S, C extends Comparable<C>, N>> goalNodes
protected Map<S, N extends ADStarNode<A, S, C extends Comparable<C>, N>> incons
protected Map<S, N extends ADStarNode<A, S, C extends Comparable<C>, N>> open
protected Queue<N extends ADStarNode<A, S, C extends Comparable<C>, N>> queue
protected Iterable<Transition<A, S>> transitionsChanged
Protected Constructors
ADStarForward.Iterator()
Public Methods
Map<S, N> getClosed()
Get the internal map used by the algorithm to keep the relations between explored states and nodes.
Map<S, N> getIncons()
Map<S, N> getOpen()
AD* uses the OPEN queue to order the most promising nodes to be expanded by the algorithm.
boolean hasNext()
As the algorithm is executed iteratively refreshing the changed relations between nodes, this method will return always true.
N next()
void remove()
Removing is not supported.
Protected Methods
void insertOpen(N node)
Inserts a node in the open queue.
N takePromising()
Retrieves the most promising node from the open collection, or null if it is empty.
void updateQueues(N node)
Updates the membership of the node to the algorithm queues.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.util.Iterator

Fields

protected final N extends ADStarNode<A, S, C extends Comparable<C>, N> beginNode

protected Map<S, N extends ADStarNode<A, S, C extends Comparable<C>, N>> closed

protected final Collection<N extends ADStarNode<A, S, C extends Comparable<C>, N>> goalNodes

protected Map<S, N extends ADStarNode<A, S, C extends Comparable<C>, N>> incons

protected Map<S, N extends ADStarNode<A, S, C extends Comparable<C>, N>> open

protected Queue<N extends ADStarNode<A, S, C extends Comparable<C>, N>> queue

protected Iterable<Transition<A, S>> transitionsChanged

Protected Constructors

protected ADStarForward.Iterator ()

Public Methods

public Map<S, N> getClosed ()

Get the internal map used by the algorithm to keep the relations between explored states and nodes. Modifications to the map can alter the normal function of the algorithm.

Returns
  • closed map with the explored nodes and states

public Map<S, N> getIncons ()

public Map<S, N> getOpen ()

AD* uses the OPEN queue to order the most promising nodes to be expanded by the algorithm. This method retrieves the original map (not a copy) that contains the pairs of

Returns
  • open map with the unexplored nodes and states.

public boolean hasNext ()

As the algorithm is executed iteratively refreshing the changed relations between nodes, this method will return always true.

Returns
  • always true

public N next ()

public void remove ()

Removing is not supported.

Protected Methods

protected void insertOpen (N node)

Inserts a node in the open queue.

Parameters
node instance of node to add

protected N takePromising ()

Retrieves the most promising node from the open collection, or null if it is empty.

Returns
  • most promising node

protected void updateQueues (N node)

Updates the membership of the node to the algorithm queues.

Parameters
node instance of node