Package org.matsim.core.controler
Class OutputDirectoryHierarchy
- java.lang.Object
-
- org.matsim.core.controler.OutputDirectoryHierarchy
-
public final class OutputDirectoryHierarchy extends Object
Represents the directory hierarchy where the MATSim output goes in.- Author:
- dgrether, michaz
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OutputDirectoryHierarchy.OverwriteFileSetting
-
Constructor Summary
Constructors Constructor Description OutputDirectoryHierarchy(String outputPath, String runId, OutputDirectoryHierarchy.OverwriteFileSetting overwriteFiles, boolean createDirectories, ControlerConfigGroup.CompressionType compressionType)
OutputDirectoryHierarchy(String outputPath, String runId, OutputDirectoryHierarchy.OverwriteFileSetting overwriteFiles, ControlerConfigGroup.CompressionType defaultCompressionType)
OutputDirectoryHierarchy(String outputPath, OutputDirectoryHierarchy.OverwriteFileSetting overwriteFiles, ControlerConfigGroup.CompressionType defaultCompressionType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
createIterationDirectory(int iteration)
Creates the path where all iteration-related data should be stored.String
getIterationFilename(int iteration, String filename)
Returns the complete filename to access an iteration-file with the given basename.String
getIterationFilename(int iteration, Controler.DefaultFiles file)
String
getIterationFilename(int iteration, Controler.DefaultFiles file, ControlerConfigGroup.CompressionType compression)
String
getIterationPath(int iteration)
Returns the path to the specified iteration directory.String
getOutputFilename(String filename)
Returns the complete filename to access a file in the output-directory.String
getOutputFilename(Controler.DefaultFiles file)
String
getOutputFilename(Controler.DefaultFiles file, ControlerConfigGroup.CompressionType compression)
String
getOutputPath()
String
getTempPath()
Returns the path to a directory where temporary files can be stored.
-
-
-
Constructor Detail
-
OutputDirectoryHierarchy
public OutputDirectoryHierarchy(String outputPath, OutputDirectoryHierarchy.OverwriteFileSetting overwriteFiles, ControlerConfigGroup.CompressionType defaultCompressionType)
-
OutputDirectoryHierarchy
public OutputDirectoryHierarchy(String outputPath, String runId, OutputDirectoryHierarchy.OverwriteFileSetting overwriteFiles, ControlerConfigGroup.CompressionType defaultCompressionType)
-
OutputDirectoryHierarchy
public OutputDirectoryHierarchy(String outputPath, String runId, OutputDirectoryHierarchy.OverwriteFileSetting overwriteFiles, boolean createDirectories, ControlerConfigGroup.CompressionType compressionType)
- Parameters:
runId
- the runId, may be nulloverwriteFiles
- overwrite existing files instead of crashingoutputPath
- the path to the output directorycreateDirectories
- create the directories or abort if they exist
-
-
Method Detail
-
getTempPath
public final String getTempPath()
Returns the path to a directory where temporary files can be stored.- Returns:
- path to a temp-directory.
-
getIterationPath
public final String getIterationPath(int iteration)
Returns the path to the specified iteration directory. The directory path does not include the trailing '/'.- Parameters:
iteration
- the iteration the path to should be returned- Returns:
- path to the specified iteration directory
-
getIterationFilename
public final String getIterationFilename(int iteration, String filename)
Returns the complete filename to access an iteration-file with the given basename.- Parameters:
filename
- the basename of the file to access- Returns:
- complete path and filename to a file in a iteration directory. if rundId is set then it is prefixed with it
-
getIterationFilename
public final String getIterationFilename(int iteration, Controler.DefaultFiles file)
-
getIterationFilename
public final String getIterationFilename(int iteration, Controler.DefaultFiles file, ControlerConfigGroup.CompressionType compression)
-
getOutputFilename
public final String getOutputFilename(String filename)
Returns the complete filename to access a file in the output-directory.- Parameters:
filename
- the basename of the file to access- Returns:
- complete path and filename to a file, if set prefixed with the runId, in the output-directory
-
getOutputFilename
public final String getOutputFilename(Controler.DefaultFiles file)
-
getOutputFilename
public final String getOutputFilename(Controler.DefaultFiles file, ControlerConfigGroup.CompressionType compression)
-
getOutputPath
public String getOutputPath()
-
createIterationDirectory
public final void createIterationDirectory(int iteration)
Creates the path where all iteration-related data should be stored.
-
-