Interface RecursiveADSNode<S,​I,​O,​N extends RecursiveADSNode<S,​I,​O,​N>>

  • Type Parameters:
    S - (hypothesis) state type
    I - input alphabet type
    O - output alphabet type
    N - the concrete node type
    All Superinterfaces:
    FiniteRepresentation, Graph<N,​N>, IndefiniteGraph<N,​N>, IndefiniteSimpleGraph<N>, Iterable<N>, SimpleGraph<N>
    All Known Subinterfaces:
    ADSNode<S,​I,​O>
    All Known Implementing Classes:
    AbstractRecursiveADSLeafNode, AbstractRecursiveADSSymbolNode, ADSLeafNode, ADSSymbolNode

    public interface RecursiveADSNode<S,​I,​O,​N extends RecursiveADSNode<S,​I,​O,​N>>
    extends Graph<N,​N>
    An interface representing a node in an adaptive distinguishing sequence (which essentially forms a decision tree).

    For convenience, this interface extends the Graph interface so that an ADS may be passed easily to e.g. GraphDOT methods.

    This is a utility interface with a recursive generic type parameter to allow for better inheritance with this recursive data structure. Algorithms may use more simplified sub-interfaces such as ADSNode.

    • Method Detail

      • getSymbol

        @Pure
        @Nullable I getSymbol()
        Returns the input symbol associated with this ADS node.
        Returns:
        null if this is a leaf node (see isLeaf()), the associated input symbol otherwise.
      • getParent

        @Pure
        @Nullable N getParent()
        Returns the parent node of this node.
        Returns:
        The parent node of this ADS node. May be null, if this is the root node of an ADS.
      • setParent

        void setParent​(N parent)
      • getNodesForRoot

        default Collection<N> getNodesForRoot​(N root)
        A utility method to collect all nodes of a subtree specified by the given root node. May be used for the SimpleGraph.getNodes() implementation where a concrete type for RecursiveADSNode is needed.
        Parameters:
        root - the node for which all subtree nodes should be collected
        Returns:
        all nodes in the specified subtree, including the root node itself
      • getChildren

        Map<O,​N> getChildren()
        Returns a mapping to the child nodes of this ADS node.
        Returns:
        A mapping from hypothesis outputs to child ADS nodes. May be empty/unmodifiable (for leaf nodes), but never null.
      • getOutgoingEdges

        default Collection<N> getOutgoingEdges​(N node)
        Description copied from interface: Graph
        Retrieves, for a given node, the (finite) collection of all outgoing edges.
        Specified by:
        getOutgoingEdges in interface Graph<S,​I>
        Parameters:
        node - the node
        Returns:
        a collection containing the outgoing edges
      • getTarget

        default N getTarget​(N edge)
        Description copied from interface: IndefiniteGraph
        Retrieves, for a given edge, its target node.
        Specified by:
        getTarget in interface IndefiniteGraph<S,​I>
        Parameters:
        edge - the edge.
        Returns:
        the target node of the given edge.
      • isLeaf

        boolean isLeaf()
        A utility method indicating whether this node represents a leaf of an ADS (and therefore referencing a hypothesis state) or an inner node (and therefore referencing an input symbol).
        Returns:
        true if this is a leaf of an ADS, false otherwise.
      • getHypothesisState

        @Nullable S getHypothesisState()
        Returns the hypothesis state associated with this ADS node.
        Returns:
        null if this is an inner node (see isLeaf()), the associated hypothesis state otherwise.