Class AbstractExporter

  • All Implemented Interfaces:
    it.unibo.alchemist.loader.export.Exporter

    
    public abstract class AbstractExporter<T extends Object, P extends Position<P>>
     implements Exporter<T, P>
                        

    Abstract implementation of a Exporter.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final List<Extractor<?>> getDataExtractors() The List of Extractor used to export simulations data.
      final Unit bindDataExtractors(List<Extractor<?>> dataExtractors) Assign the list of dataExtractors to the selected Exporter.
      final Unit bindVariables(Map<String, ?> variables) Assign the map of variables to the selected Exporter.
      final Unit update(Environment<T, P> environment, Actionable<T> reaction, Time time, Long step) Every step of the simulation check if is time to export data depending on the sampling interval.
      abstract Unit exportData(Environment<T, P> environment, Actionable<T> reaction, Time time, Long step) Delegates the concrete implementation of this method to his subclasses.
      • Methods inherited from class it.unibo.alchemist.loader.export.Exporter

        close, setup
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractExporter

        AbstractExporter(Double samplingInterval)
        Parameters:
        samplingInterval - the sampling time, defaults to DEFAULT_INTERVAL.
    • Method Detail

      • update

         final Unit update(Environment<T, P> environment, Actionable<T> reaction, Time time, Long step)

        Every step of the simulation check if is time to export data depending on the sampling interval. Converts the division of the current time and the interval to Long in order to export data only when the difference between steps is as big as the sampling interval.

      • exportData

         abstract Unit exportData(Environment<T, P> environment, Actionable<T> reaction, Time time, Long step)

        Delegates the concrete implementation of this method to his subclasses.