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
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,DataSetBuilder<?>> protected List<AbstractDataSetManager.ScheduledDataSet> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDataSet(DataSet dataSet, ScheduleParameters scheduleParams, boolean atEnd) Adds a DataSet to this DataSetManager.voidaddDataSetBuilder(DataSetBuilder<?> builder) Adds a DataSetBuilder to this DataSetManager.voidClears all the DataSetBuilder-s from this DataSetManager.voidClears this data set manager of any added datasets.voidflush()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.voidpaused()Invoked when the current run has been paused.voidRemoves the specified DataSetBuilder.voidInvoked when the current run has been restarted after a pause.voidNotifies this DataSetManager that an individual run has ended.voidrunStarted(RunState runState, Object contextId, Parameters parameters) Notifies this DataSetManager that an individual run has started.voidstarted()Invoked when the current run has been started.voidstopped()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, waitMethods 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:DataSetManagerRemoves the specified DataSetBuilder.- Specified by:
removeDataSetbuilderin interfaceDataSetManager- Parameters:
id- the id of the DataSetBuilder to remove.
-
clearDataSetBuilders
public void clearDataSetBuilders()Description copied from interface:DataSetManagerClears all the DataSetBuilder-s from this DataSetManager.- Specified by:
clearDataSetBuildersin interfaceDataSetManager
-
getBatchRunDataSource
Gets the BatchRunDataSource that this manager will auto update with the current run number.- Specified by:
getBatchRunDataSourcein interfaceDataSetManager- Returns:
- the BatchRunDataSource that this manager will auto update with the current run number.
-
getTickCountDataSource
Description copied from interface:DataSetManagerGets the default data source for returning the tick count.- Specified by:
getTickCountDataSourcein interfaceDataSetManager- Returns:
- the default data source for returning the tick count.
-
getRandomSeedDataSource
Description copied from interface:DataSetManagerGets the default data source for returning the current random seed.- Specified by:
getRandomSeedDataSourcein interfaceDataSetManager- Returns:
- the default data source for returning the current random seed.
-
addDataSet
Description copied from interface:DataSetManagerAdds a DataSet to this DataSetManager.- Specified by:
addDataSetin 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:
flushin interfaceDataSetManager
-
clearDataSets
public void clearDataSets()Clears this data set manager of any added datasets. -
runStarted
Description copied from interface:DataSetManagerNotifies this DataSetManager that an individual run has started.- Specified by:
runStartedin interfaceDataSetManager- Parameters:
runState- the current RunState -- run number etc can be retrieved from thatparameters- the current model parameters
-
runEnded
Description copied from interface:DataSetManagerNotifies this DataSetManager that an individual run has ended.- Specified by:
runEndedin interfaceDataSetManager- Parameters:
runState- the RunState of the run that just ended.
-
addDataSetBuilder
Description copied from interface:DataSetManagerAdds a DataSetBuilder to this DataSetManager.- Specified by:
addDataSetBuilderin interfaceDataSetManager
-
getDataSetBuilder
Description copied from interface:DataSetManagerGets the named DataSetBuilder.- Specified by:
getDataSetBuilderin interfaceDataSetManager- Returns:
- the named DataSetBuilder.
-
stopped
public void stopped()Description copied from interface:RunListenerInvoked when the current run has been stopped.- Specified by:
stoppedin interfaceRunListener
-
paused
public void paused()Description copied from interface:RunListenerInvoked when the current run has been paused.- Specified by:
pausedin interfaceRunListener
-
started
public void started()Description copied from interface:RunListenerInvoked when the current run has been started.- Specified by:
startedin interfaceRunListener
-
restarted
public void restarted()Description copied from interface:RunListenerInvoked when the current run has been restarted after a pause.- Specified by:
restartedin interfaceRunListener
-