Package org.planit.output.formatter
Interface OutputFormatter
-
- All Known Implementing Classes:
BaseOutputFormatter
,CsvFileOutputFormatter
,FileOutputFormatter
,MemoryOutputFormatter
,PlanItOutputFormatter
public interface OutputFormatter
Interface for persisting output data in a particular format- Author:
- markr
-
-
Field Summary
Fields Modifier and Type Field Description static String
MEMORY_OUTPUT_FORMATTER
static String
NOT_SPECIFIED
Constant to report that an output value has not been setstatic String
PLANIT_OUTPUT_FORMATTER
Default output formatter supported by PLANit from PLANitIO repository
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canHandleMultipleIterations()
Flag to indicate whether an implementation can handle multiple iterations If this returns false, acts as though OutputConfiguration.setPersistOnlyFinalIteration() is set to truevoid
finaliseAfterSimulation(Map<OutputType,OutputTypeConfiguration> outputTypeConfigurations, OutputAdapter outputAdapter)
Close resources to store resultslong
getId()
Collect the id of the formattervoid
initialiseBeforeSimulation(Map<OutputType,OutputTypeConfiguration> outputTypeConfigurations, long runId)
Open resources to store resultsvoid
persist(TimePeriod timePeriod, Set<Mode> modes, OutputConfiguration outputConfiguration, OutputTypeConfiguration outputTypeConfiguration, OutputAdapter outputAdapter)
Persist the output data based on the passed in configuration and adapter (contained in the configuration)
-
-
-
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 savedmodes
- Set of modes for the assignment to be savedoutputConfiguration
- output configurationoutputTypeConfiguration
- OutputTypeConfiguration for the assignment to be savedoutputAdapter
- 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 savedrunId
- 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 savedoutputAdapter
- 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
-
-