Interface OutputFormatter

    • Field Detail

      • NOT_SPECIFIED

        static final String NOT_SPECIFIED
        Constant to report that an output value has not been set
        See Also:
        Constant Field Values
      • PLANIT_OUTPUT_FORMATTER

        static final String PLANIT_OUTPUT_FORMATTER
        Default output formatter supported by PLANit from PLANitIO repository
        See Also:
        Constant Field Values
      • MEMORY_OUTPUT_FORMATTER

        static final String MEMORY_OUTPUT_FORMATTER
    • Method Detail

      • getId

        long getId()
        Collect the id of the formatter
        Returns:
        id
      • persist

        void persist​(TimePeriod timePeriod,
                     Set<Mode> modes,
                     OutputConfiguration outputConfiguration,
                     OutputTypeConfiguration outputTypeConfiguration,
                     OutputAdapter outputAdapter)
              throws PlanItException
        Persist the output data based on the passed in configuration and adapter (contained in the configuration)
        Parameters:
        timePeriod - TimePeriod for the assignment to be saved
        modes - Set of modes for the assignment to be saved
        outputConfiguration - output configuration
        outputTypeConfiguration - OutputTypeConfiguration for the assignment to be saved
        outputAdapter - OutputAdapter for the assignment to be saved
        Throws:
        PlanItException - thrown if there is an error
      • initialiseBeforeSimulation

        void initialiseBeforeSimulation​(Map<OutputType,​OutputTypeConfiguration> outputTypeConfigurations,
                                        long runId)
                                 throws PlanItException
        Open resources to store results
        Parameters:
        outputTypeConfigurations - OutputTypeConfigurations for the assignment to be saved
        runId - the id number of the run
        Throws:
        PlanItException - thrown if there is an error
      • finaliseAfterSimulation

        void finaliseAfterSimulation​(Map<OutputType,​OutputTypeConfiguration> outputTypeConfigurations,
                                     OutputAdapter outputAdapter)
                              throws PlanItException
        Close resources to store results
        Parameters:
        outputTypeConfigurations - OutputTypeConfigurations for the assignment to be saved
        outputAdapter - the outputAdapter
        Throws:
        PlanItException - thrown if there is an error
      • canHandleMultipleIterations

        boolean canHandleMultipleIterations()
        Flag to indicate whether an implementation can handle multiple iterations If this returns false, acts as though OutputConfiguration.setPersistOnlyFinalIteration() is set to true
        Returns:
        flag to indicate whether the OutputFormatter can handle multiple iterations