p3j.simulation.calculation.deterministic
Class AbstractPopulation<P extends BasicParameters,R extends BasicResults>

java.lang.Object
  extended by p3j.simulation.calculation.deterministic.AbstractPopulation<P,R>
Type Parameters:
P - the parameter class
R - the result class
Direct Known Subclasses:
MigChildPopulation, MigPopulation, NativePopulation

public abstract class AbstractPopulation<P extends BasicParameters,R extends BasicResults>
extends Object

Base class for population calculations. This method does not conform to ESCA-JAVA0138, but the methods that have more than 5 parameters are very short and therefore still easy to understand. Created on July 22, 2006

Author:
Christina Bohk, Roland Ewald

Field Summary
static double FORCE_MORT_INTERVAL
          Distribution of deaths in half years of an entire single age year.
 
Constructor Summary
AbstractPopulation()
           
 
Method Summary
protected static void calculateByMult(int startAge, int endAge, int year, Matrix2D target, Matrix2D source, Matrix2D mult)
          Calculates target matrix by multiplying source and the field from the multiplication matrix at the same age and year position.
protected static void calculateByMultMin1(int startAge, int endAge, int year, Matrix2D target, Matrix2D source, Matrix2D mult)
          Calculates target matrix by multiplying source and the field from the multiplication matrix that correspond to the year and age (column and row) above/before (- 1).
abstract  R calculatePopulation(P parameters)
          Calculate population.
protected static void calculateRestOfMeanPopulation(Matrix2D target, Matrix2D endPopulation, Matrix2D p2, Matrix2D survO100, Matrix2D liveBirthProp, int year, double numberOfChilds, int maxAge)
          Calculates the first and the last age group of the mean population.
protected static void calculateSurvivalProbabilities(BasicParameters parameters, BasicResults results)
          Calculate survival probabilities for both halves of the year.
protected static void getFirstHalfyearSurvProb(Matrix2D target, Matrix2D deathProbInfant1half, Matrix2D mortality, int numOfYears, int maxAge)
          Calculates survival probabilities for the first half of a year.
protected static double getNumOfChilds(Matrix2D meanFemalePop, Matrix2D fertility, int year)
          Calculates number of children in current year.
protected static void getSecondHalfyearSurvProb(Matrix2D target, Matrix2D deathProbInfant1half, Matrix2D mortality, int numOfYears, int maxAge)
          Calculates survival probabilities for the second half of a year.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORCE_MORT_INTERVAL

public static final double FORCE_MORT_INTERVAL
Distribution of deaths in half years of an entire single age year. First half of deaths die in first and the other half die in last half year if set to 0.5.

See Also:
Constant Field Values
Constructor Detail

AbstractPopulation

public AbstractPopulation()
Method Detail

calculatePopulation

public abstract R calculatePopulation(P parameters)
Calculate population.

Parameters:
parameters - the parameters requires to population calculation
Returns:
results the results of the calculation

getFirstHalfyearSurvProb

protected static void getFirstHalfyearSurvProb(Matrix2D target,
                                               Matrix2D deathProbInfant1half,
                                               Matrix2D mortality,
                                               int numOfYears,
                                               int maxAge)
Calculates survival probabilities for the first half of a year.

Parameters:
target - matrix to store results in
deathProbInfant1half - death probabilities of infants within the first 6 months
mortality - mortality matrix
numOfYears - number of years to be calculated
maxAge - the maximum age

getSecondHalfyearSurvProb

protected static void getSecondHalfyearSurvProb(Matrix2D target,
                                                Matrix2D deathProbInfant1half,
                                                Matrix2D mortality,
                                                int numOfYears,
                                                int maxAge)
Calculates survival probabilities for the second half of a year.

Parameters:
target - matrix to store results in
deathProbInfant1half - death probabilities of infants within the first 6 months
mortality - mortality matrix
numOfYears - number of years to be calculated
maxAge - the maximum age

calculateSurvivalProbabilities

protected static void calculateSurvivalProbabilities(BasicParameters parameters,
                                                     BasicResults results)
Calculate survival probabilities for both halves of the year.

Parameters:
parameters - the parameters
results - the results

calculateByMultMin1

protected static void calculateByMultMin1(int startAge,
                                          int endAge,
                                          int year,
                                          Matrix2D target,
                                          Matrix2D source,
                                          Matrix2D mult)
Calculates target matrix by multiplying source and the field from the multiplication matrix that correspond to the year and age (column and row) above/before (- 1).

Parameters:
startAge - start age
endAge - end age
year - current year
target - target matrix
source - source matrix
mult - multiplication matrix

calculateByMult

protected static void calculateByMult(int startAge,
                                      int endAge,
                                      int year,
                                      Matrix2D target,
                                      Matrix2D source,
                                      Matrix2D mult)
Calculates target matrix by multiplying source and the field from the multiplication matrix at the same age and year position.

Parameters:
startAge - start age
endAge - end age
year - current year
target - target matrix
source - source matrix
mult - multiplication matrix

getNumOfChilds

protected static double getNumOfChilds(Matrix2D meanFemalePop,
                                       Matrix2D fertility,
                                       int year)
Calculates number of children in current year.

Parameters:
meanFemalePop - mean female population
fertility - fertility
year - current year
Returns:
number of children in current year

calculateRestOfMeanPopulation

protected static void calculateRestOfMeanPopulation(Matrix2D target,
                                                    Matrix2D endPopulation,
                                                    Matrix2D p2,
                                                    Matrix2D survO100,
                                                    Matrix2D liveBirthProp,
                                                    int year,
                                                    double numberOfChilds,
                                                    int maxAge)
Calculates the first and the last age group of the mean population.

Parameters:
target - mean population matrix
endPopulation - end population matrix
p2 - P_2 matrix (survival probabilities of infants in second half-year of their first year)
survO100 - survival probabilities of the over-100-years-olds
liveBirthProp - proportions of live births belonging to this sex
year - current year
numberOfChilds - (overall) number of children
maxAge - the maximal age


Copyright © 2012. All Rights Reserved.