Package repast.simphony.data2
Interface DataSetManager
-
- All Known Implementing Classes:
AbstractDataSetManager
,BatchRunDataSetManager
,SingleRunDataSetManager
public interface DataSetManager
Interface for classes that manage the lifecycle of DataSets.- Author:
- Nick Collier
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addDataSet(DataSet dataSet, ScheduleParameters scheduleParams, boolean atEnd)
Adds a DataSet to this DataSetManager.void
addDataSetBuilder(DataSetBuilder<?> builder)
Adds a DataSetBuilder to this DataSetManager.void
batchEnded()
Notifies this DataSetManager that the set of batch runs has ended.void
batchStarted()
Notifies this DataSetManager that the set of batch runs has started.void
clearDataSetBuilders()
Clears all the DataSetBuilder-s from this DataSetManager.void
flush()
Notifies the DataSets managed by this DataSetManager to tell their DataSinks to flush any buffered data.BatchRunDataSource
getBatchRunDataSource()
Gets the default data source for returning the current batch run number, or null if not currently in batch run mode.DataSetBuilder<?>
getDataSetBuilder(String id)
Gets the named DataSetBuilder.RandomSeedDataSource
getRandomSeedDataSource()
Gets the default data source for returning the current random seed.TickCountDataSource
getTickCountDataSource()
Gets the default data source for returning the tick count.boolean
isBatch()
Gets whether or not this is a batch run.void
removeDataSetbuilder(String id)
Removes the specified DataSetBuilder.void
runEnded(RunState runState, Object contextId)
Notifies this DataSetManager that an individual run has ended.void
runStarted(RunState runState, Object contextId, Parameters parameters)
Notifies this DataSetManager that an individual run has started.
-
-
-
Method Detail
-
getTickCountDataSource
TickCountDataSource getTickCountDataSource()
Gets the default data source for returning the tick count.- Returns:
- the default data source for returning the tick count.
-
getRandomSeedDataSource
RandomSeedDataSource getRandomSeedDataSource()
Gets the default data source for returning the current random seed.- Returns:
- the default data source for returning the current random seed.
-
getBatchRunDataSource
BatchRunDataSource getBatchRunDataSource()
Gets the default data source for returning the current batch run number, or null if not currently in batch run mode.- Returns:
- the default data source for returning the current batch run number, or null if not currently in batch run mode.
-
flush
void flush()
Notifies the DataSets managed by this DataSetManager to tell their DataSinks to flush any buffered data.
-
addDataSet
void addDataSet(DataSet dataSet, ScheduleParameters scheduleParams, boolean atEnd)
Adds a DataSet to this DataSetManager.- Parameters:
dataSet
- the DataSet to addscheduleParams
- the scheduling info for recording this datasetwhether
- or not to record the data at the end of the sim
-
batchStarted
void batchStarted()
Notifies this DataSetManager that the set of batch runs has started.
-
batchEnded
void batchEnded()
Notifies this DataSetManager that the set of batch runs has ended.
-
runStarted
void runStarted(RunState runState, Object contextId, Parameters parameters)
Notifies this DataSetManager that an individual run has started.- Parameters:
runState
- the current RunState -- run number etc can be retrieved from thatparameters
- the current model parameters
-
runEnded
void runEnded(RunState runState, Object contextId)
Notifies this DataSetManager that an individual run has ended.- Parameters:
runState
- the RunState of the run that just ended.
-
isBatch
boolean isBatch()
Gets whether or not this is a batch run.- Returns:
- true if this is batch run otherwise false.
-
addDataSetBuilder
void addDataSetBuilder(DataSetBuilder<?> builder)
Adds a DataSetBuilder to this DataSetManager.- Parameters:
builder
-
-
removeDataSetbuilder
void removeDataSetbuilder(String id)
Removes the specified DataSetBuilder.- Parameters:
id
- the id of the DataSetBuilder to remove.
-
clearDataSetBuilders
void clearDataSetBuilders()
Clears all the DataSetBuilder-s from this DataSetManager.
-
getDataSetBuilder
DataSetBuilder<?> getDataSetBuilder(String id)
Gets the named DataSetBuilder.- Parameters:
id
-- Returns:
- the named DataSetBuilder.
-
-