- java.lang.Object
-
- net.automatalib.util.minimizer.MinimizationResult<S,L>
-
- Type Parameters:
S
- state typeL
- transition label type
public final class MinimizationResult<S,L> extends Object
The result structure of a minimization process. The result of a minimization process is a partition on the original set of states. This is represented by a collection ofBlock
s containing states that are equivalent and thus can be merged.Since all states in a block are equivalent (and thus especially have the same set of outgoing edge labels), a minimized automaton can be created from this partition by instantiating a state for each block. The edges between those states are created in the following way: For each state/block, an original state is chosen arbitrarily from this block. The edges are created according to the edges of this state, only that they point to the states representing the blocks the respective target states belong to (using
getBlockForState(Object)
).The blocks in the result partition are guaranteed to have contiguous IDs (see
Block.getId()
), starting at 0. This allows an efficient construction of the resulting automaton.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Block<S,L>
getBlockForState(S origState)
Retrieves the block to which a given original state belongs.Collection<Block<S,L>>
getBlocks()
Retrieves all blocks in the final partition.int
getNumBlocks()
Retrieves the number of blocks in the final partition.S
getRepresentative(Block<S,L> block)
Chooses a representative (i.e., an arbitrary element of the set of states) from a block.static <S,L>
Collection<S>getStatesInBlock(Block<S,L> block)
Retrieves all (original) states in a block.
-
-
-
Method Detail
-
getStatesInBlock
public static <S,L> Collection<S> getStatesInBlock(Block<S,L> block)
Retrieves all (original) states in a block.- Type Parameters:
S
- state typeL
- transition label type- Parameters:
block
- the block.- Returns:
- a collection containing all original states in this block.
-
getNumBlocks
public int getNumBlocks()
Retrieves the number of blocks in the final partition.- Returns:
- the number of blocks.
-
getBlocks
public Collection<Block<S,L>> getBlocks()
Retrieves all blocks in the final partition.- Returns:
- the final partition.
-
getRepresentative
public S getRepresentative(Block<S,L> block)
Chooses a representative (i.e., an arbitrary element of the set of states) from a block.- Parameters:
block
- the block.- Returns:
- an arbitrary element of the state set of the given block.
-
-