Class PostComposedSignalDiscretizer
- All Implemented Interfaces:
Mapper<String,,String, List<Double>, IOSignalPiece<List<Double>>> Mapper.SynchronousMapper<String,,String, List<Double>, IOSignalPiece<List<Double>>> SULMapper<String,,String, List<Double>, IOSignalPiece<List<Double>>> SignalDiscretizer
- Direct Known Subclasses:
NumericSULMapperWithSGA
This class allows for the composition of a SignalDiscretizer with another
SULMapper. The discretizer handles the mapping between concrete signals
and abstract input/output strings. The postMapper is applied only to the abstract
output strings produced by the discretizer; it does not affect how concrete inputs are
mapped to abstract inputs.
- Author:
- Masaki Waga <masakiwaga@gmail.com>
-
Nested Class Summary
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedProtected default constructor for PostComposedSignalDiscretizer.PostComposedSignalDiscretizer(ComponentWiseSignalDiscretizer discretizer, SULMapper<String, String, String, String> postMapper) Constructor for PostComposedSignalDiscretizer. -
Method Summary
Modifier and TypeMethodDescriptionnet.automatalib.alphabet.Alphabet<String>Constructs an abstract alphabet from the input mappings.Constructs a concrete alphabet from the input mappings.private voidEnsures that the discretizer is initialized.private voidEnsures that both discretizer and postMapper are initialized.mapConcrete(IOSignalPiece<List<Double>> concreteIO) Maps a concrete IOSignalPiece to a list of concrete output values.Maps an abstract input string to a concrete list of double values.mapOutput(IOSignalPiece<List<Double>> concreteIO) Maps a concrete IOSignalPiece to an abstract output string.protected voidsetDiscretizer(ComponentWiseSignalDiscretizer discretizer) Sets the discretizer for this PostComposedSignalDiscretizer.protected voidSets the postMapper for this PostComposedSignalDiscretizer.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.maswag.falcaun.SignalDiscretizer
getPostOutputMapper, mapInput, mapInputsMethods inherited from interface de.learnlib.sul.SULMapper
canFork, fork, mapUnwrappedException, mapWrappedException
-
Field Details
-
discretizer
-
postMapper
-
-
Constructor Details
-
PostComposedSignalDiscretizer
protected PostComposedSignalDiscretizer()Protected default constructor for PostComposedSignalDiscretizer.This constructor initializes the discretizer and postMapper to
null. It is intended for use by subclasses (such asNumericSULMapperWithSGA) that need to perform custom initialization before setting these fields. Subclasses must callsetDiscretizer(ComponentWiseSignalDiscretizer)andsetPostMapper(SULMapper)to initialize the fields before using any methods that depend on them. External users should usePostComposedSignalDiscretizer(ComponentWiseSignalDiscretizer, SULMapper)instead. -
PostComposedSignalDiscretizer
public PostComposedSignalDiscretizer(ComponentWiseSignalDiscretizer discretizer, SULMapper<String, String, String, String> postMapper) Constructor for PostComposedSignalDiscretizer.- Parameters:
discretizer- The SignalDiscretizer to use for mapping.postMapper- The SULMapper to post-compose with the discretizer.
-
-
Method Details
-
mapInput
Description copied from interface:SignalDiscretizerMaps an abstract input string to a concrete list of double values. -
mapOutput
Maps a concrete IOSignalPiece to an abstract output string. -
mapConcrete
Maps a concrete IOSignalPiece to a list of concrete output values.- Specified by:
mapConcretein interfaceSignalDiscretizer- Parameters:
concreteIO- The concrete IOSignalPiece to map.- Returns:
- The list of concrete output values.
-
constructAbstractAlphabet
Constructs an abstract alphabet from the input mappings.- Specified by:
constructAbstractAlphabetin interfaceSignalDiscretizer- Returns:
- The abstract alphabet.
-
constructConcreteAlphabet
Constructs a concrete alphabet from the input mappings.- Specified by:
constructConcreteAlphabetin interfaceSignalDiscretizer- Returns:
- The concrete alphabet.
-
ensureDiscretizerInitialized
private void ensureDiscretizerInitialized()Ensures that the discretizer is initialized.- Throws:
IllegalStateException- if discretizer is null
-
ensureInitialized
private void ensureInitialized()Ensures that both discretizer and postMapper are initialized.- Throws:
IllegalStateException- if discretizer or postMapper is null
-
setDiscretizer
Sets the discretizer for this PostComposedSignalDiscretizer.This method is protected and intended for use by subclasses that use the protected default constructor. Subclasses must call this method to initialize the discretizer before using any methods that depend on it.
- Parameters:
discretizer- The ComponentWiseSignalDiscretizer to use for mapping.- Throws:
IllegalArgumentException- if discretizer is null
-
setPostMapper
Sets the postMapper for this PostComposedSignalDiscretizer.This method is protected and intended for use by subclasses that use the protected default constructor. Subclasses must call this method to initialize the postMapper before using any methods that depend on it.
- Parameters:
postMapper- The SULMapper to post-compose with the discretizer.- Throws:
IllegalArgumentException- if postMapper is null
-