Class CSVExporter
-
- All Implemented Interfaces:
-
it.unibo.alchemist.boundary.Exporter
public final class CSVExporter<T extends Object, P extends Position<P>> extends AbstractExporter<T, P>
Writes on file data provided by a number of {@link Extractor}s. Produces a CSV with '#' as comment character.e
-
-
Field Summary
Fields Modifier and Type Field Description private final Double
interval
private final String
exportPath
private final String
fileExtension
private final List<Extractor<?>>
dataExtractors
-
Constructor Summary
Constructors Constructor Description CSVExporter(String fileNameRoot, Double interval, String exportPath, String fileExtension, Boolean appendTime)
CSVExporter(String fileNameRoot, Double interval, String exportPath, String fileExtension)
CSVExporter(String fileNameRoot, Double interval, String exportPath)
CSVExporter(String fileNameRoot, Double interval)
CSVExporter(String fileNameRoot)
CSVExporter()
-
Method Summary
Modifier and Type Method Description final Double
getInterval()
final String
getExportPath()
final String
getFileExtension()
Unit
setup(Environment<T, P> environment)
Prepare the export environment. Unit
exportData(Environment<T, P> environment, Actionable<T> reaction, Time time, Long step)
Delegates the concrete implementation of this method to his subclasses. Unit
close(Environment<T, P> environment, Time time, Long step)
Close the export environment. -
-
Constructor Detail
-
CSVExporter
CSVExporter(String fileNameRoot, Double interval, String exportPath, String fileExtension, Boolean appendTime)
- Parameters:
fileNameRoot
- the starting name of the file to export data to.interval
- the sampling time, defaults to AbstractExporter.DEFAULT_INTERVAL.exportPath
- if no path is specified it will generate the file inside a temporary folder.fileExtension
- the extension for the exported files, by default 'csv'appendTime
- if true it will always generate a new file, false to overwrite.
-
CSVExporter
CSVExporter(String fileNameRoot, Double interval, String exportPath, String fileExtension)
- Parameters:
fileNameRoot
- the starting name of the file to export data to.interval
- the sampling time, defaults to AbstractExporter.DEFAULT_INTERVAL.exportPath
- if no path is specified it will generate the file inside a temporary folder.fileExtension
- the extension for the exported files, by default 'csv'
-
CSVExporter
CSVExporter(String fileNameRoot, Double interval, String exportPath)
- Parameters:
fileNameRoot
- the starting name of the file to export data to.interval
- the sampling time, defaults to AbstractExporter.DEFAULT_INTERVAL.exportPath
- if no path is specified it will generate the file inside a temporary folder.
-
CSVExporter
CSVExporter(String fileNameRoot, Double interval)
- Parameters:
fileNameRoot
- the starting name of the file to export data to.interval
- the sampling time, defaults to AbstractExporter.DEFAULT_INTERVAL.
-
CSVExporter
CSVExporter(String fileNameRoot)
- Parameters:
fileNameRoot
- the starting name of the file to export data to.
-
CSVExporter
CSVExporter()
-
-
Method Detail
-
getInterval
final Double getInterval()
-
getExportPath
final String getExportPath()
-
getFileExtension
final String getFileExtension()
-
setup
Unit setup(Environment<T, P> environment)
Prepare the export environment. This method is called only once upon simulation initialization.
-
exportData
Unit exportData(Environment<T, P> environment, Actionable<T> reaction, Time time, Long step)
Delegates the concrete implementation of this method to his subclasses.
-
-
-
-