Package repast.simphony.data2
Class TickCountDataSource
- java.lang.Object
-
- repast.simphony.data2.TickCountDataSource
-
- All Implemented Interfaces:
AggregateDataSource
,DataSource
,NonAggregateDataSource
public class TickCountDataSource extends Object implements AggregateDataSource, NonAggregateDataSource
DataSource that returns the current tick count.- Author:
- Nick Collier
-
-
Constructor Summary
Constructors Constructor Description TickCountDataSource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Double
get(Iterable<?> objs, int size)
Gets the data using the specified iterable.Double
get(Object obj)
Gets data given the specified object.Class<Double>
getDataType()
Gets the type of data produced by this DataSource.String
getId()
Gets the unique id of this DataSource.Class<?>
getSourceType()
Gets the type of the object that this DataSource can retreive data from.void
reset()
Resets this AggregateDataSource prior to the next get call.void
resetSchedule(ISchedule schedule)
Resets the schedule in this TickCountDataSource to the specified schedule.
-
-
-
Field Detail
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
resetSchedule
public void resetSchedule(ISchedule schedule)
Resets the schedule in this TickCountDataSource to the specified schedule.- Parameters:
schedule
- the new schedule
-
getSourceType
public Class<?> getSourceType()
Description copied from interface:DataSource
Gets the type of the object that this DataSource can retreive data from.- Specified by:
getSourceType
in interfaceDataSource
- Returns:
- the type of the object that this DataSource can retreive data from.
-
getId
public String getId()
Description copied from interface:DataSource
Gets the unique id of this DataSource. The id should be unique across the DataSet that this source is added to.- Specified by:
getId
in interfaceDataSource
- Returns:
- the unique id of this DataSource.
-
getDataType
public Class<Double> getDataType()
Description copied from interface:DataSource
Gets the type of data produced by this DataSource.- Specified by:
getDataType
in interfaceDataSource
- Returns:
- the type of data produced by this DataSource.
-
get
public Double get(Object obj)
Description copied from interface:NonAggregateDataSource
Gets data given the specified object.- Specified by:
get
in interfaceNonAggregateDataSource
- Parameters:
obj
- an object to get the data from- Returns:
- the retrieved data.
-
get
public Double get(Iterable<?> objs, int size)
Description copied from interface:AggregateDataSource
Gets the data using the specified iterable.- Specified by:
get
in interfaceAggregateDataSource
- Parameters:
objs
- the iterable over objects to use in getting the datasize
- the number of objects in the iterable- Returns:
- the data using the specified iterable.
-
reset
public void reset()
Description copied from interface:AggregateDataSource
Resets this AggregateDataSource prior to the next get call.- Specified by:
reset
in interfaceAggregateDataSource
-
-