-
- All Implemented Interfaces:
-
it.unibo.alchemist.loader.export.Exporter
public final class MongoDBExporter<T extends Object, P extends Position<P>> extends AbstractExporter<T, P>
Exports data provided by a list of it.unibo.alchemist.loader.export.Extractors on a MongoDB instance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
MongoDBExporter.Companion
-
Constructor Summary
Constructors Constructor Description MongoDBExporter(String uri, String dbName, Double interval, Boolean appendTime)
MongoDBExporter(String uri, String dbName, Double interval)
MongoDBExporter(String uri, String dbName)
MongoDBExporter(String uri)
-
Method Summary
Modifier and Type Method Description final String
getCollectionName()
The name of the collection related to the current simulation in execution. final Unit
setCollectionName(String collectionName)
final String
getUri()
final String
getDbName()
final Double
getInterval()
final List<Extractor<?>>
getDataExtractors()
The List of Extractor used to export simulations data. final Unit
setDataExtractors(List<Extractor<?>> dataExtractors)
Unit
setup(Environment<T, P> environment)
Prepare the export environment. Unit
exportData(Environment<T, P> environment, Reaction<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
-
MongoDBExporter
MongoDBExporter(String uri, String dbName, Double interval, Boolean appendTime)
- Parameters:
uri
- the connection URI of the database instance.dbName
- the name the database to export data to.interval
- the sampling time, defaults to AbstractExporter.DEFAULT_INTERVAL.appendTime
- if true it will always generate a new Mongo document, false to overwrite.
-
MongoDBExporter
MongoDBExporter(String uri, String dbName, Double interval)
- Parameters:
uri
- the connection URI of the database instance.dbName
- the name the database to export data to.interval
- the sampling time, defaults to AbstractExporter.DEFAULT_INTERVAL.
-
MongoDBExporter
MongoDBExporter(String uri, String dbName)
- Parameters:
uri
- the connection URI of the database instance.dbName
- the name the database to export data to.
-
MongoDBExporter
MongoDBExporter(String uri)
- Parameters:
uri
- the connection URI of the database instance.
-
-
Method Detail
-
getCollectionName
final String getCollectionName()
The name of the collection related to the current simulation in execution.
-
setCollectionName
final Unit setCollectionName(String collectionName)
-
getInterval
final Double getInterval()
-
getDataExtractors
final List<Extractor<?>> getDataExtractors()
The List of Extractor used to export simulations data.
-
setDataExtractors
final Unit setDataExtractors(List<Extractor<?>> dataExtractors)
-
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, Reaction<T> reaction, Time time, Long step)
Delegates the concrete implementation of this method to his subclasses.
-
-
-
-