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>
- 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
.
-
-
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 ofthis
ADS node.@Nullable S
getHypothesisState()
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 N
getParent()
Returns the parent node ofthis
node.@Nullable I
getSymbol()
Returns the input symbol associated with this ADS node.default N
getTarget(N edge)
Retrieves, for a given edge, its target node.default VisualizationHelper<N,N>
getVisualizationHelper()
Returns theVisualizationHelper
that contains information for displaying this graph.boolean
isLeaf()
A utility method indicating whetherthis
node represents a leaf of an ADS (and therefore referencing a hypothesis state) or an inner node (and therefore referencing an input symbol).void
setHypothesisState(S state)
SeegetHypothesisState()
.void
setParent(N parent)
void
setSymbol(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:
null
ifthis
is 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 ofthis
node.- Returns:
- The parent node of
this
ADS node. May benull
, ifthis
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 theSimpleGraph.getNodes()
implementation where a concrete type forRecursiveADSNode
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 ofthis
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 interfaceGraph<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 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:SimpleGraph
Returns theVisualizationHelper
that contains information for displaying this graph.- Specified by:
getVisualizationHelper
in interfaceGraph<S,I>
- Specified by:
getVisualizationHelper
in interfaceSimpleGraph<S>
- Returns:
- the visualization helper
-
isLeaf
boolean isLeaf()
A utility method indicating whetherthis
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
ifthis
is a leaf of an ADS,false
otherwise.
-
getHypothesisState
@Nullable S getHypothesisState()
Returns the hypothesis state associated with this ADS node.- Returns:
null
ifthis
is 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()
).
-
-