Package net.automatalib.graph.ads
Interface RecursiveADSNode<S,I,O,N extends RecursiveADSNode<S,I,O,N>>
-
- Type Parameters:
S- (hypothesis) state typeI- input alphabet typeO- output alphabet typeN- 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>
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
Graphinterface 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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.automatalib.graph.Graph
Graph.IntAbstraction<E>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Map<O,N>getChildren()Returns a mapping to the child nodes ofthisADS node.@Nullable SgetHypothesisState()Returns the hypothesis state associated with this ADS node.default Collection<N>getNodesForRoot(N root)A utility method to collect all nodes of a subtree specified by the given root node.default Collection<N>getOutgoingEdges(N node)Retrieves, for a given node, the (finite) collection of all outgoing edges.@Nullable NgetParent()Returns the parent node ofthisnode.@Nullable IgetSymbol()Returns the input symbol associated with this ADS node.default NgetTarget(N edge)Retrieves, for a given edge, its target node.default VisualizationHelper<N,N>getVisualizationHelper()Returns theVisualizationHelperthat contains information for displaying this graph.booleanisLeaf()A utility method indicating whetherthisnode represents a leaf of an ADS (and therefore referencing a hypothesis state) or an inner node (and therefore referencing an input symbol).voidsetHypothesisState(S state)SeegetHypothesisState().voidsetParent(N parent)voidsetSymbol(I symbol)SeegetSymbol().-
Methods inherited from interface net.automatalib.graph.Graph
getAdjacentNodes, getOutgoingEdgesIterator
-
Methods inherited from interface net.automatalib.graph.IndefiniteGraph
getAdjacentNodesIterator, getEdgesBetween
-
Methods inherited from interface net.automatalib.graph.IndefiniteSimpleGraph
createDynamicNodeMapping, createStaticNodeMapping, isConnected
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface net.automatalib.graph.SimpleGraph
getNodes, iterator, nodeIDs, size
-
-
-
-
Method Detail
-
getSymbol
@Pure @Nullable I getSymbol()
Returns the input symbol associated with this ADS node.- Returns:
nullifthisis a leaf node (seeisLeaf()), the associated input symbol otherwise.
-
setSymbol
void setSymbol(I symbol)
SeegetSymbol().- Parameters:
symbol- the input symbol to be associated with this ADS node.- Throws:
UnsupportedOperationException- if trying to set an input symbol on a leaf node (seeisLeaf()).
-
getParent
@Pure @Nullable N getParent()
Returns the parent node ofthisnode.- Returns:
- The parent node of
thisADS node. May benull, ifthisis 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 theSimpleGraph.getNodes()implementation where a concrete type forRecursiveADSNodeis 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 ofthisADS 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:GraphRetrieves, for a given node, the (finite) collection of all outgoing edges.- Specified by:
getOutgoingEdgesin interfaceGraph<S,I>- Parameters:
node- the node- Returns:
- a collection containing the outgoing edges
-
getTarget
default N getTarget(N edge)
Description copied from interface:IndefiniteGraphRetrieves, for a given edge, its target node.- Specified by:
getTargetin interfaceIndefiniteGraph<S,I>- Parameters:
edge- the edge.- Returns:
- the target node of the given edge.
-
getVisualizationHelper
default VisualizationHelper<N,N> getVisualizationHelper()
Description copied from interface:SimpleGraphReturns theVisualizationHelperthat contains information for displaying this graph.- Specified by:
getVisualizationHelperin interfaceGraph<S,I>- Specified by:
getVisualizationHelperin interfaceSimpleGraph<S>- Returns:
- the visualization helper
-
isLeaf
boolean isLeaf()
A utility method indicating whetherthisnode represents a leaf of an ADS (and therefore referencing a hypothesis state) or an inner node (and therefore referencing an input symbol).- Returns:
trueifthisis a leaf of an ADS,falseotherwise.
-
getHypothesisState
@Nullable S getHypothesisState()
Returns the hypothesis state associated with this ADS node.- Returns:
nullifthisis an inner node (seeisLeaf()), the associated hypothesis state otherwise.
-
setHypothesisState
void setHypothesisState(S state)
SeegetHypothesisState().- Parameters:
state- the hypothesis state to be associated with this ADS node.- Throws:
UnsupportedOperationException- if trying to set a hypothesis state on an inner node (seeisLeaf()).
-
-