Package repast.simphony.data2
Class AggregateDSCreator
- java.lang.Object
-
- repast.simphony.data2.AggregateDSCreator
-
public class AggregateDSCreator extends Object
Creates aggregate DataSources. The data sources produced by this creator are share a common statistical object such that calling get on one of these is a record for all of them, until reset is called. Consequently, these assume that the collection passed will not change between calls to get.- Author:
- Nick Collier
-
-
Constructor Summary
Constructors Constructor Description AggregateDSCreator(NonAggregateDataSource source)
Creates a builder that will create aggregate data sources using the specified DataSource as the source for the non-aggregate data that will then be aggegated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AggregateDataSource
createCountSource(String id)
Convenience method for creating a count data source that will return all the objects of a particular type.AggregateDataSource
createDataSource(String id, AggregateOp type)
Creates an AggregateDataSource of the specified type with the specified id.AggregateDataSource
createGeoMeanSource(String id)
Creates an aggregate data source that will get the geometric mean of the collection of objects passed into it.AggregateDataSource
createMaxSource(String id)
Creates an aggregate data source that will get the max of the collection of objects passed into it.AggregateDataSource
createMeanSource(String id)
Creates an aggregate data source that will get the mean of the collection of objects passed into it.AggregateDataSource
createMinSource(String id)
Creates an aggregate data source that will get the min of the collection of objects passed into it.AggregateDataSource
createSecondMomentSource(String id)
Creates an aggregate data source that will get the second moment of the collection of objects passed into it.AggregateDataSource
createStdDevSource(String id)
Creates an aggregate data source that will get the standard deviation of the collection of objects passed into it.AggregateDataSource
createSumLogsSource(String id)
Creates an aggregate data source that will get the sum of the logs of the collection of objects passed into it.AggregateDataSource
createSumSource(String id)
Creates an aggregate data source that will sum across the collection of objects passed into it.AggregateDataSource
createSumSquaresSource(String id)
Creates an aggregate data source that will get the sum of the squares of the collection of objects passed into it.AggregateDataSource
createVarianceSource(String id)
Creates an aggregate data source that will get the variance of the collection of objects passed into it.
-
-
-
Constructor Detail
-
AggregateDSCreator
public AggregateDSCreator(NonAggregateDataSource source)
Creates a builder that will create aggregate data sources using the specified DataSource as the source for the non-aggregate data that will then be aggegated.- Parameters:
source
- the source for the non-aggregate data that will then be aggegated
-
-
Method Detail
-
createSumSource
public AggregateDataSource createSumSource(String id)
Creates an aggregate data source that will sum across the collection of objects passed into it. The id should be unique across the DataSet that this source is added to.- Parameters:
id
- the unique id of the data source.- Returns:
- an aggregate data source that will sum across the collection of objects passed into it.
-
createMeanSource
public AggregateDataSource createMeanSource(String id)
Creates an aggregate data source that will get the mean of the collection of objects passed into it. The id should be unique across the DataSet that this source is added to.- Parameters:
id
- the unique id of the data source.- Returns:
- an aggregate data source that will get the mean of the collection of objects passed into it.
-
createMinSource
public AggregateDataSource createMinSource(String id)
Creates an aggregate data source that will get the min of the collection of objects passed into it. The id should be unique across the DataSet that this source is added to.- Parameters:
id
- the unique id of the data source.- Returns:
- an aggregate data source that will get the min the collection of objects passed into it.
-
createMaxSource
public AggregateDataSource createMaxSource(String id)
Creates an aggregate data source that will get the max of the collection of objects passed into it. The id should be unique across the DataSet that this source is added to.- Parameters:
id
- the unique id of the data source.- Returns:
- an aggregate data source that will get the max the collection of objects passed into it.
-
createStdDevSource
public AggregateDataSource createStdDevSource(String id)
Creates an aggregate data source that will get the standard deviation of the collection of objects passed into it. The id should be unique across the DataSet that this source is added to.- Parameters:
id
- the unique id of the data source.- Returns:
- an aggregate data source that will get the std dev the collection of objects passed into it.
-
createSumLogsSource
public AggregateDataSource createSumLogsSource(String id)
Creates an aggregate data source that will get the sum of the logs of the collection of objects passed into it. The id should be unique across the DataSet that this source is added to.- Parameters:
id
- the unique id of the data source.- Returns:
- an aggregate data source that will get the sum of the logs the collection of objects passed into it.
-
createSumSquaresSource
public AggregateDataSource createSumSquaresSource(String id)
Creates an aggregate data source that will get the sum of the squares of the collection of objects passed into it. The id should be unique across the DataSet that this source is added to.- Parameters:
id
- the unique id of the data source.- Returns:
- an aggregate data source that will get the sum of the squares the collection of objects passed into it.
-
createVarianceSource
public AggregateDataSource createVarianceSource(String id)
Creates an aggregate data source that will get the variance of the collection of objects passed into it. The id should be unique across the DataSet that this source is added to.- Parameters:
id
- the unique id of the data source.- Returns:
- an aggregate data source that will get the variance the collection of objects passed into it.
-
createGeoMeanSource
public AggregateDataSource createGeoMeanSource(String id)
Creates an aggregate data source that will get the geometric mean of the collection of objects passed into it. The id should be unique across the DataSet that this source is added to.- Parameters:
id
- the unique id of the data source.- Returns:
- an aggregate data source that will get the geometric mean the collection of objects passed into it.
-
createSecondMomentSource
public AggregateDataSource createSecondMomentSource(String id)
Creates an aggregate data source that will get the second moment of the collection of objects passed into it. The id should be unique across the DataSet that this source is added to.- Parameters:
id
- the unique id of the data source.- Returns:
- an aggregate data source that will get the second moment the collection of objects passed into it.
-
createCountSource
public AggregateDataSource createCountSource(String id)
Convenience method for creating a count data source that will return all the objects of a particular type.- Parameters:
id
- the unique id of the data source- Returns:
- the created count data source
-
createDataSource
public AggregateDataSource createDataSource(String id, AggregateOp type)
Creates an AggregateDataSource of the specified type with the specified id.- Parameters:
id
-type
-- Returns:
- the created AggregateDataSource.
-
-