Package repast.simphony.data2
Class AbstractDataSetManager
java.lang.Object
repast.simphony.data2.AbstractDataSetManager
- All Implemented Interfaces:
DataSetManager
,RunListener
- Direct Known Subclasses:
BatchRunDataSetManager
,SingleRunDataSetManager
Abstract implementation of a DataSetManager. This does scheduling and data
collection on the master context.
- Author:
- Nick Collier
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
protected static class
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<String,
DataSetBuilder<?>> protected List<AbstractDataSetManager.ScheduledDataSet>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDataSet
(DataSet dataSet, ScheduleParameters scheduleParams, boolean atEnd) Adds a DataSet to this DataSetManager.void
addDataSetBuilder
(DataSetBuilder<?> builder) Adds a DataSetBuilder to this DataSetManager.void
Clears all the DataSetBuilder-s from this DataSetManager.void
Clears this data set manager of any added datasets.void
flush()
Notifies the DataSets managed by this DataSetManager to tell their DataSinks to flush any buffered data.Gets the BatchRunDataSource that this manager will auto update with the current run number.Gets the named DataSetBuilder.Gets the default data source for returning the current random seed.Gets the default data source for returning the tick count.void
paused()
Invoked when the current run has been paused.void
Removes the specified DataSetBuilder.void
Invoked when the current run has been restarted after a pause.void
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.void
started()
Invoked when the current run has been started.void
stopped()
Invoked when the current run has been stopped.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface repast.simphony.data2.DataSetManager
batchEnded, batchStarted, isBatch
-
Field Details
-
builders
-
dataSets
-
-
Constructor Details
-
AbstractDataSetManager
public AbstractDataSetManager()
-
-
Method Details
-
removeDataSetbuilder
Description copied from interface:DataSetManager
Removes the specified DataSetBuilder.- Specified by:
removeDataSetbuilder
in interfaceDataSetManager
- Parameters:
id
- the id of the DataSetBuilder to remove.
-
clearDataSetBuilders
public void clearDataSetBuilders()Description copied from interface:DataSetManager
Clears all the DataSetBuilder-s from this DataSetManager.- Specified by:
clearDataSetBuilders
in interfaceDataSetManager
-
getBatchRunDataSource
Gets the BatchRunDataSource that this manager will auto update with the current run number.- Specified by:
getBatchRunDataSource
in interfaceDataSetManager
- Returns:
- the BatchRunDataSource that this manager will auto update with the current run number.
-
getTickCountDataSource
Description copied from interface:DataSetManager
Gets the default data source for returning the tick count.- Specified by:
getTickCountDataSource
in interfaceDataSetManager
- Returns:
- the default data source for returning the tick count.
-
getRandomSeedDataSource
Description copied from interface:DataSetManager
Gets the default data source for returning the current random seed.- Specified by:
getRandomSeedDataSource
in interfaceDataSetManager
- Returns:
- the default data source for returning the current random seed.
-
addDataSet
Description copied from interface:DataSetManager
Adds a DataSet to this DataSetManager.- Specified by:
addDataSet
in interfaceDataSetManager
- Parameters:
dataSet
- the DataSet to addscheduleParams
- the scheduling info for recording this dataset
-
flush
public void flush()Notifies the DataSets managed by this DataSetManager to tell their DataSinks to flush any buffered data.- Specified by:
flush
in interfaceDataSetManager
-
clearDataSets
public void clearDataSets()Clears this data set manager of any added datasets. -
runStarted
Description copied from interface:DataSetManager
Notifies this DataSetManager that an individual run has started.- Specified by:
runStarted
in interfaceDataSetManager
- Parameters:
runState
- the current RunState -- run number etc can be retrieved from thatparameters
- the current model parameters
-
runEnded
Description copied from interface:DataSetManager
Notifies this DataSetManager that an individual run has ended.- Specified by:
runEnded
in interfaceDataSetManager
- Parameters:
runState
- the RunState of the run that just ended.
-
addDataSetBuilder
Description copied from interface:DataSetManager
Adds a DataSetBuilder to this DataSetManager.- Specified by:
addDataSetBuilder
in interfaceDataSetManager
-
getDataSetBuilder
Description copied from interface:DataSetManager
Gets the named DataSetBuilder.- Specified by:
getDataSetBuilder
in interfaceDataSetManager
- Returns:
- the named DataSetBuilder.
-
stopped
public void stopped()Description copied from interface:RunListener
Invoked when the current run has been stopped.- Specified by:
stopped
in interfaceRunListener
-
paused
public void paused()Description copied from interface:RunListener
Invoked when the current run has been paused.- Specified by:
paused
in interfaceRunListener
-
started
public void started()Description copied from interface:RunListener
Invoked when the current run has been started.- Specified by:
started
in interfaceRunListener
-
restarted
public void restarted()Description copied from interface:RunListener
Invoked when the current run has been restarted after a pause.- Specified by:
restarted
in interfaceRunListener
-