Class PostComposedSignalDiscretizer

java.lang.Object
net.maswag.falcaun.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

public class PostComposedSignalDiscretizer extends Object implements SignalDiscretizer
SignalDiscretizer post-composed with an SULMapper.

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>
  • Field Details

  • Constructor Details

  • Method Details

    • mapInput

      public List<Double> mapInput(String s)
      Description copied from interface: SignalDiscretizer
      Maps an abstract input string to a concrete list of double values.
      Specified by:
      mapInput in interface Mapper<String,String,List<Double>,IOSignalPiece<List<Double>>>
      Specified by:
      mapInput in interface SignalDiscretizer
      Parameters:
      s - The abstract input string to map.
      Returns:
      The concrete list of double values corresponding to the input string.
    • mapOutput

      public String mapOutput(IOSignalPiece<List<Double>> concreteIO)
      Maps a concrete IOSignalPiece to an abstract output string.
      Specified by:
      mapOutput in interface Mapper<String,String,List<Double>,IOSignalPiece<List<Double>>>
      Specified by:
      mapOutput in interface SignalDiscretizer
      Parameters:
      concreteIO - The concrete IOSignalPiece to map.
      Returns:
      The abstract output string corresponding to the concrete output.
    • mapConcrete

      public List<Double> mapConcrete(IOSignalPiece<List<Double>> concreteIO)
      Maps a concrete IOSignalPiece to a list of concrete output values.
      Specified by:
      mapConcrete in interface SignalDiscretizer
      Parameters:
      concreteIO - The concrete IOSignalPiece to map.
      Returns:
      The list of concrete output values.
    • constructAbstractAlphabet

      public net.automatalib.alphabet.Alphabet<String> constructAbstractAlphabet()
      Constructs an abstract alphabet from the input mappings.
      Specified by:
      constructAbstractAlphabet in interface SignalDiscretizer
      Returns:
      The abstract alphabet.
    • constructConcreteAlphabet

      public net.automatalib.alphabet.Alphabet<List<Double>> constructConcreteAlphabet()
      Constructs a concrete alphabet from the input mappings.
      Specified by:
      constructConcreteAlphabet in interface SignalDiscretizer
      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

      protected void setDiscretizer(ComponentWiseSignalDiscretizer discretizer)
      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

      protected void setPostMapper(SULMapper<String,String,String,String> postMapper)
      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