Interface Extractor

  • All Implemented Interfaces:

    
    public interface Extractor<E extends Object>
    
                        

    An object that is able to extract numeric informations from an Alchemist {@link Environment}, given the current {@link it.unibo.alchemist.core.Simulation} {@link Time}, the last {@link Reaction} executed and the current simulation step.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • extractData

         abstract <T extends Any> Map<String, E> extractData(Environment<T, ?> environment, Actionable<T> reaction, Time time, Long step)

        Extracts properties from an environment. The returned map must either:

        • contain a single element,

        • have the keys matching columnNames, or

        • be iterable in predictable order (namely, implement SortedMap or extend one of LinkedHashMap or ConcurrentLinkedHashMap).

        Parameters:
        environment -
        the {@link Environment}
        reaction -
        the last executed {@link Reaction}
        time -
        the current {@link Time}
        step -
        the simulation step
        Returns:

        the extracted properties with their names. The returned map must either: - contain a single element, - have the keys matching columnNames, or - be iterable in predictable order (namely, implement SortedMap or extend LinkedHashMap).

      • extractDataAsText

         <T extends Any> Map<String, String> extractDataAsText(Environment<T, ?> environment, Actionable<T> reaction, Time time, Long step)

        Same as extractData, but specifically meant for textual outputs. Captures E to String conversions. The default implementation just runs a toString() conversion ver extractData's return value's values.

        Parameters:
        environment -
        the {@link Environment}
        reaction -
        the last executed {@link Reaction}
        time -
        the current {@link Time}
        step -
        the simulation step
        Returns:

        the extracted properties in textual format with their names.