MongoDBExporter
class MongoDBExporter<T, P : Position<P>> @JvmOverloads constructor(val uri: String, val dbName: String = DEFAULT_DATABASE, val interval: Double = DEFAULT_INTERVAL, appendTime: Boolean = false) : AbstractExporter<T, P> (source)
Exports data to a MongoDB instance.
Type Parameters
T
the concentration type
P
the position type
Constructors
Properties
Link copied to clipboard
The name of the collection related to the current simulation in execution.
Link copied to clipboard
The list of bound data extractors.
Link copied to clipboard
the sampling time, defaults to AbstractExporter.DEFAULT_INTERVAL
Functions
Link copied to clipboard
Assign the list of dataExtractors to the selected Exporter.
Link copied to clipboard
Link copied to clipboard
open override fun exportData(environment: Environment<T, P>, reaction: Actionable<T>?, time: Time, step: Long)
Delegates the concrete implementation of this method to his subclasses.
Link copied to clipboard
Prepare the export environment. This method is called only once upon simulation initialization.
Link copied to clipboard
override fun update(environment: Environment<T, P>, reaction: Actionable<T>?, time: Time, step: Long)
Every step of the simulation check if is time to export data depending on the sampling interval. Converts the division of the current time and the interval to Long in order to export data only when the difference between steps is as big as the sampling interval.