public class

ADStarNodeExpander

extends Object
implements NodeExpander<A, S, N extends Node<A, S, N>>
java.lang.Object
   ↳ es.usc.citius.hipster.model.function.impl.ADStarNodeExpander<A, S, C extends java.lang.Comparable<C>, N extends es.usc.citius.hipster.model.ADStarNode<A, S, C, N>>

Class Overview

This class is an implementation of NodeExpander for nodes of type ADStarNode. This node expander executes the main function of a node expander: taking as input a node generates the successor nodes using the information of the transition, cost and heuristic functions. This expander, to be used with ADStarForward, also executes the following operations:

    • Obtain a set of iterable nodes from the transitions that changed since the last solution found of AD*
      Update nodes in consistent and inconsistent states
      Store the nodes visited by the algorithm
      Get the predecessors nodes of a current one which were visited by the algorithm
  • Summary

    Public Constructors
    ADStarNodeExpander(SearchComponents<A, S, C> components, NodeFactory<A, S, N> factory, double epsilon)
    Builds a node expander from a search components and a node factory.
    ADStarNodeExpander(TransitionFunction<A, S> successorFunction, TransitionFunction<A, S> predecessorFunction, CostFunction<A, S, C> costFunction, HeuristicFunction<S, C> heuristicFunction, BinaryOperation<C> add, ScalarFunction<C> scale, NodeFactory<A, S, N> nodeFactory, double epsilon)
    Builds a node expander specifying the required components individually.
    Public Methods
    void clearVisited()
    Clears the set of visited nodes.
    Iterable<N> expand(N node)
    Iterable<N> expandTransitionsChanged(S begin, N current, Iterable<Transition<A, S>> transitions)
    Generates an iterable list of nodes, updated as inconsistent after applying the cost changes in the list of transitions passed as parameter.
    Map<S, N> getVisited()
    N makeNode(N from, Transition<A, S> transition)
    Creates a new node from the parent and a transition, calling the node factory.
    void setEpsilon(double epsilon)
    Assign a value to the inflation parameter of the heuristic.
    void setMaxV(N node)
    Assigns the maximum value to V in the current node.
    [Expand]
    Inherited Methods
    From class java.lang.Object
    From interface es.usc.citius.hipster.model.function.NodeExpander

    Public Constructors

    public ADStarNodeExpander (SearchComponents<A, S, C> components, NodeFactory<A, S, N> factory, double epsilon)

    Builds a node expander from a search components and a node factory. A epsilon value (used to inflate the heuristic and obtain solutions anytime) must be specified, being >= 1.

    Parameters
    components search components of the search
    factory node factory
    epsilon heuristic inflation value (>=1)

    public ADStarNodeExpander (TransitionFunction<A, S> successorFunction, TransitionFunction<A, S> predecessorFunction, CostFunction<A, S, C> costFunction, HeuristicFunction<S, C> heuristicFunction, BinaryOperation<C> add, ScalarFunction<C> scale, NodeFactory<A, S, N> nodeFactory, double epsilon)

    Builds a node expander specifying the required components individually. A epsilon value (used to inflate the heuristic and obtain solutions anytime) must be specified, being >= 1.

    Parameters
    successorFunction successor function
    predecessorFunction predecessor function
    costFunction evaluation function
    heuristicFunction heuristic function
    add cost addition function
    scale cost scale function
    nodeFactory node factory
    epsilon heuristic inflation value (>=1)

    Public Methods

    public void clearVisited ()

    Clears the set of visited nodes.

    public Iterable<N> expand (N node)

    public Iterable<N> expandTransitionsChanged (S begin, N current, Iterable<Transition<A, S>> transitions)

    Generates an iterable list of nodes, updated as inconsistent after applying the cost changes in the list of transitions passed as parameter.

    Parameters
    begin beginning state of the search
    current current node of the search
    transitions list of transitions with changed costs
    Returns
    • list of updated nodes

    public Map<S, N> getVisited ()

    Returns
    • map with the states and nodes visited by the algorithm

    public N makeNode (N from, Transition<A, S> transition)

    Creates a new node from the parent and a transition, calling the node factory.

    Parameters
    from parent node
    transition transition between the parent and the new node
    Returns
    • new node created by the node factory

    public void setEpsilon (double epsilon)

    Assign a value to the inflation parameter of the heuristic.

    Parameters
    epsilon new value

    public void setMaxV (N node)

    Assigns the maximum value to V in the current node.

    Parameters
    node ADStarNodeImpl to modify the value of V