Package org.goplanit.output.formatter
Class FileOutputFormatter
- java.lang.Object
-
- org.goplanit.output.formatter.BaseOutputFormatter
-
- org.goplanit.output.formatter.FileOutputFormatter
-
- All Implemented Interfaces:
OutputFormatter
- Direct Known Subclasses:
CsvFileOutputFormatter
public abstract class FileOutputFormatter extends BaseOutputFormatter
Common methods used by output formatters which write data to physical files- Author:
- gman6028
-
-
Field Summary
-
Fields inherited from class org.goplanit.output.formatter.BaseOutputFormatter
id, initialCostsLocation, outputKeyProperties, outputTimeUnit, outputTypeKeysLocked, outputTypes, outputTypeValuesLocked, outputValueProperties
-
Fields inherited from interface org.goplanit.output.formatter.OutputFormatter
MEMORY_OUTPUT_FORMATTER, NOT_SPECIFIED, PLANIT_OUTPUT_FORMATTER
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FileOutputFormatter(IdGroupingToken groupId)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
generateOutputFileName(String outputDirectory, String nameRoot, String nameExtension, TimePeriod timePeriod, OutputType outputType, long runId)
Generates the name of an output file.protected String
generateOutputFileName(String outputDirectory, String nameRoot, String nameExtension, TimePeriod timePeriod, OutputType outputType, long runId, int iteration)
Generates the name of an output file.-
Methods inherited from class org.goplanit.output.formatter.BaseOutputFormatter
getId, lockOutputProperties, persist, writeGeneralResultsForCurrentTimePeriod, writeLinkResultsForCurrentTimePeriod, writeOdResultsForCurrentTimePeriod, writePathResultsForCurrentTimePeriod, writeSimulationResultsForCurrentTimePeriod
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.goplanit.output.formatter.OutputFormatter
canHandleMultipleIterations, finaliseAfterSimulation, initialiseBeforeSimulation
-
-
-
-
Constructor Detail
-
FileOutputFormatter
protected FileOutputFormatter(IdGroupingToken groupId)
Constructor- Parameters:
groupId
- , contiguous id generation within this group for instances of this class
-
-
Method Detail
-
generateOutputFileName
protected String generateOutputFileName(String outputDirectory, String nameRoot, String nameExtension, TimePeriod timePeriod, OutputType outputType, long runId, int iteration) throws PlanItException
Generates the name of an output file. All output files have no spaces in them.- Parameters:
outputDirectory
- location output files are to be writtennameRoot
- root name of the output filesnameExtension
- extension of the output filestimePeriod
- the time periodoutputType
- the OutputType of the outputrunId
- the id of the traffic assignment runiteration
- current iteration- Returns:
- the name of the output file
- Throws:
PlanItException
- thrown if the output directory cannot be opened
-
generateOutputFileName
protected String generateOutputFileName(String outputDirectory, String nameRoot, String nameExtension, TimePeriod timePeriod, OutputType outputType, long runId) throws PlanItException
Generates the name of an output file.- Parameters:
outputDirectory
- location output files are to be writtennameRoot
- root name of the output filesnameExtension
- extension of the output filestimePeriod
- timePeriodoutputType
- the OutputType of the outputrunId
- the id of the traffic assignment run- Returns:
- the name of the output file
- Throws:
PlanItException
- thrown if the output directory cannot be opened
-
-