public abstract class AbstractAggregationSelector extends Object implements IAggregationSelector
ResultsOfTrial
, aggregation is essentially a three-step process:
1) Select the sub-population and generation of interest: this means to select
a BasicResults
object from the lists in ResultsOfTrial
. This
is handled by an ISubPopulationSelector
.
2) Select the variable of interest from the BasicResults
object, i.e.
which aspect of the given sub-population's results are of interest (e.g. the
year-end numbers of males). The result of this selection is a matrix. This is
handled by an IOutputVariableSelector
.
3) The actual aggregation of the matrices to some result; this is the only
aspect that cannot be re-used and has to be implemented for any kind of
aggregation. This is handled by a sub-class of
AbstractAggregationSelector
.BasicResults
,
ResultsOfTrial
Modifier and Type | Field and Description |
---|---|
protected double[][] |
aggregation
The aggregated data.
|
Constructor and Description |
---|
AbstractAggregationSelector(p3j.experiment.results.IOutputVariableSelector outputVarSelector,
p3j.experiment.results.ISubPopulationSelector subPopSelector,
int generationForSelection)
Instantiates a new abstract aggregation selector.
|
Modifier and Type | Method and Description |
---|---|
protected double[][] |
cutOffUnused(double[][] aggregatedData,
int numOfLines)
Cuts off unused lines in data.
|
protected static AbstractAggregationSelector[] |
getCopy(AbstractAggregationSelector[] selArray)
Gets a copy of an array.
|
protected String |
getFileName()
Gets the file name.
|
protected double[][] |
reorderResults(List<Integer> indexOrdering,
double[][] orderedResults)
Reorders results according to list of indices.
|
protected Matrix2D |
select(ResultsOfTrial resultsOfTrial)
Select the result of interest.
|
protected double[] |
sumPerElement(List<double[]> additionArrays,
List<double[]> subtractionArrays)
Sum to array by element-wise adding all array in the first list to one
another, and then subtracting all arrays in the second list.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
consider, finish, init
public AbstractAggregationSelector(p3j.experiment.results.IOutputVariableSelector outputVarSelector, p3j.experiment.results.ISubPopulationSelector subPopSelector, int generationForSelection)
outputVarSelector
- the results selectorsubPopSelector
- the trial selectorgenerationForSelection
- the generation for selectionprotected Matrix2D select(ResultsOfTrial resultsOfTrial)
resultsOfTrial
- the results of trialprotected String getFileName()
protected double[][] reorderResults(List<Integer> indexOrdering, double[][] orderedResults)
indexOrdering
- the index orderingorderedResults
- the ordered resultsprotected double[][] cutOffUnused(double[][] aggregatedData, int numOfLines)
aggregatedData
- the aggregationnumOfLines
- the sizeprotected static AbstractAggregationSelector[] getCopy(AbstractAggregationSelector[] selArray)
selArray
- the array of selectorsprotected double[] sumPerElement(List<double[]> additionArrays, List<double[]> subtractionArrays)
additionArrays
- the addition arrayssubtractionArrays
- the subtraction arraysCopyright © 2013. All Rights Reserved.