|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectp3j.experiment.results.AbstractAggregationSelector
public abstract class AbstractAggregationSelector
An abstract class containing functionality all aggregation selectors may
share. The basic idea here is that, for the given structure in
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
.
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.
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.
BasicResults
,
ResultsOfTrial
Field Summary | |
---|---|
protected double[][] |
aggregation
The aggregated data. |
Constructor Summary | |
---|---|
AbstractAggregationSelector(p3j.experiment.results.IOutputVariableSelector resultsSelector,
p3j.experiment.results.ISubPopulationSelector trialSelector,
int generationForSelection)
Instantiates a new abstract aggregation selector. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface p3j.experiment.results.IAggregationSelector |
---|
consider, finish, init |
Field Detail |
---|
protected double[][] aggregation
Constructor Detail |
---|
public AbstractAggregationSelector(p3j.experiment.results.IOutputVariableSelector resultsSelector, p3j.experiment.results.ISubPopulationSelector trialSelector, int generationForSelection)
resultsSelector
- the results selectortrialSelector
- the trial selectorgenerationForSelection
- the generation for selectionMethod Detail |
---|
protected Matrix2D select(ResultsOfTrial resultsOfTrial)
resultsOfTrial
- the results of trial
protected String getFileName()
protected double[][] reorderResults(List<Integer> indexOrdering, double[][] orderedResults)
indexOrdering
- the index orderingorderedResults
- the ordered results
protected double[][] cutOffUnused(double[][] aggregatedData, int numOfLines)
aggregatedData
- the aggregationnumOfLines
- the size
protected static AbstractAggregationSelector[] getCopy(AbstractAggregationSelector[] selArray)
selArray
- the array of selectors
protected double[] sumPerElement(List<double[]> additionArrays, List<double[]> subtractionArrays)
additionArrays
- the addition arrayssubtractionArrays
- the subtraction arrays
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |