p3j.experiment.results
Class ChooseAgesForSingleYearSelector

java.lang.Object
  extended by p3j.experiment.results.AbstractAggregationSelector
      extended by p3j.experiment.results.ChooseAgesForSingleYearSelector
All Implemented Interfaces:
IAggregationSelector
Direct Known Subclasses:
MergeSubPopChooseAgesSingleYearSelector

public class ChooseAgesForSingleYearSelector
extends AbstractAggregationSelector

Selectors of this type select data from a particular year across all trials. The leave the age groups untouched; the aggregated data can, e.g., be used to create population pyramids.

Author:
Christina Bohk, Roland Ewald

Field Summary
 
Fields inherited from class p3j.experiment.results.AbstractAggregationSelector
aggregation
 
Constructor Summary
ChooseAgesForSingleYearSelector(p3j.experiment.results.IOutputVariableSelector resultsSelector, p3j.experiment.results.ISubPopulationSelector trialSelector, int generationForSelection, int yearForSelection)
          Instantiates a new choose ages for single year selector.
 
Method Summary
 void consider(int trialCount, ResultsOfTrial result)
          Called to consider a single result.
 void finish(File destinationDir, List<Integer> indexOrdering, ResultExport resultExport)
          Finishing the aggregation.
protected  String getFileName()
          Gets the file name.
 int getNumberOfAgeClasses()
           
protected  String getPrefix()
           
 int getYear()
           
 void init(int numOfTrials, int numOfYears, int numOfAgeClasses)
          Initialize the number of age classes etc.
 void setNumberOfAgeClasses(int numberOfAgeClasses)
           
 
Methods inherited from class p3j.experiment.results.AbstractAggregationSelector
cutOffUnused, getCopy, reorderResults, select, sumPerElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChooseAgesForSingleYearSelector

public ChooseAgesForSingleYearSelector(p3j.experiment.results.IOutputVariableSelector resultsSelector,
                                       p3j.experiment.results.ISubPopulationSelector trialSelector,
                                       int generationForSelection,
                                       int yearForSelection)
Instantiates a new choose ages for single year selector.

Parameters:
resultsSelector - the results selector
trialSelector - the trial selector
generationForSelection - the generation for selection
yearForSelection - the year for selection
Method Detail

init

public void init(int numOfTrials,
                 int numOfYears,
                 int numOfAgeClasses)
Description copied from interface: IAggregationSelector
Initialize the number of age classes etc.

Parameters:
numOfTrials - the number of trials
numOfYears - the number of years
numOfAgeClasses - the number of age classes

consider

public void consider(int trialCount,
                     ResultsOfTrial result)
Description copied from interface: IAggregationSelector
Called to consider a single result.

Parameters:
trialCount - the trial count (i.e. index)
result - the result

finish

public void finish(File destinationDir,
                   List<Integer> indexOrdering,
                   ResultExport resultExport)
            throws IOException
Description copied from interface: IAggregationSelector
Finishing the aggregation. Called after all relevant results have been considered, use this to write results.

Parameters:
destinationDir - the destination dir
indexOrdering - the index ordering
resultExport - the result export
Throws:
IOException - Signals that an I/O exception has occurred.

getFileName

protected String getFileName()
Description copied from class: AbstractAggregationSelector
Gets the file name.

Overrides:
getFileName in class AbstractAggregationSelector
Returns:
the file name

getPrefix

protected final String getPrefix()

getNumberOfAgeClasses

public int getNumberOfAgeClasses()

setNumberOfAgeClasses

public void setNumberOfAgeClasses(int numberOfAgeClasses)

getYear

public int getYear()


Copyright © 2012. All Rights Reserved.