|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.population.PopulationType uk.ac.leeds.ccg.andyt.projects.genesis.society.demography.GENESIS_Population
public class GENESIS_Population
A class for storing population count statistics. The statistics are stored in
two ways. They are stored as a TreeMaps, one for female counts, another for
male counts where the keys are GENESIS_AgeBound instances and values are
BigDecimal instances. It is designed that they are also read into and
exported from the
super.genderedAgeBoundPopulation
which contains Lists of the
data. In general the data is manipulated and altered via the TreeMaps.
Instantiated objects can be serialised for swapping, but in general, before
exporting data to a XML file, the
super.genderedAgeBoundPopulation
are updated from the TreeMaps.
Field Summary | |
---|---|
java.util.TreeMap<GENESIS_AgeBound,java.math.BigDecimal> |
_FemaleAgeBoundPopulationCount_TreeMap
Female GENESIS_Population Key Integer are Age in Years Value Long are counts, this could be the number of people of an ageBound at a given time or an aggregate over a period (e.g. |
GENESIS_Environment |
_GENESIS_Environment
|
java.util.TreeMap<GENESIS_AgeBound,java.math.BigDecimal> |
_MaleAgeBoundPopulationCount_TreeMap
Male GENESIS_Population Key Integer are Age in Years Value Long are counts, this could be the number of people of an ageBound at a given time or an aggregate over a period (e.g. |
Fields inherited from class uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.population.PopulationType |
---|
genderedAgeBoundPopulation |
Constructor Summary | |
---|---|
GENESIS_Population()
|
|
GENESIS_Population(GENESIS_Environment a_GENESIS_Environment)
|
|
GENESIS_Population(GENESIS_Environment a_GENESIS_Environment,
java.io.File population_File)
By default the population multiplicand is equal to one. |
|
GENESIS_Population(GENESIS_Environment a_GENESIS_Environment,
java.io.File population_File,
java.math.BigDecimal multiplicand)
By default assume that the data is supplied in single years of ageBound. |
|
GENESIS_Population(GENESIS_Environment a_GENESIS_Environment,
java.io.File population_File,
java.math.BigDecimal multiplicand,
boolean singleYearsOfAge)
By default an even spread of population within ageBound ranges is assumed. |
|
GENESIS_Population(GENESIS_Environment a_GENESIS_Environment,
uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.population.PopulationType a_PopulationType)
|
|
GENESIS_Population(GENESIS_Population a_Population)
|
Method Summary | |
---|---|
void |
add(java.math.BigDecimal valueToAdd)
Adds valueToAdd to all age gender counts in this |
void |
addPopulation(GENESIS_Population populationToAdd)
Adds population from populationToAdd |
static java.util.TreeMap<java.lang.String,GENESIS_Population> |
aggregateSubregion(java.util.TreeMap<java.lang.String,GENESIS_Population> theOAPops,
java.util.TreeMap<java.lang.String,java.lang.String> subregionToAggregateRegionLookup,
GENESIS_Environment aGENESIS_Environment)
|
void |
divide(java.math.BigDecimal value,
int decimalPlaces,
java.math.RoundingMode roundingMode)
Divide all age gender counts by value value expected to be non-zero |
GENESIS_Population |
divideByPopulation(GENESIS_Population populationToDivideBy,
int decimalPlaces,
java.math.RoundingMode roundingMode)
divideByPopulation assumes same population structure. |
static java.lang.Object[] |
getAggregateGENESIS_Population(GENESIS_Population pop,
java.lang.Long minAgeInYears,
java.lang.Long maxAgeInYears)
Aggregates and returns a new GENESIS_Population using GENESIS_AgeBound.getAgeMin() for aggregation. |
static java.lang.Object[] |
getAggregateGENESIS_Population(GENESIS_Population pop,
java.lang.Long minAgeInYears,
java.lang.Long maxAgeInYears,
java.lang.Long ageIncrement,
GENESIS_Environment a_GENESIS_Environment)
Warning! This is not a general implementation that examines the ageMax of AgeBounds. |
java.lang.Object[] |
getAggregateGENESIS_Population(java.lang.Long minAge,
java.lang.Long maxAge)
Aggregates and returns a new GENESIS_Population using GENESIS_AgeBound.getAgeMin() for aggregation. |
java.math.BigDecimal |
getFemalePopulation(GENESIS_AgeBound ageBound)
|
java.math.BigDecimal |
getFemalePopulationNullAllowed(GENESIS_AgeBound ageBound)
|
java.math.BigDecimal |
getFemalePopulationSum(long startAgeInYears,
long endAgeInYears)
Returns the sum of female population from ages start Age up to endAge inclusive. |
java.math.BigDecimal |
getFemalePopulationTotal()
Returns the sum of female population from getMinAgeYearsFemale() to getMaxAgeYearsFemale() inclusive. |
uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.GenderedAgeBoundPopulation |
getGenderedAgeBoundPopulation()
Initialises genderedAgeBoundPopulation if it is null using CommonFactory.newGenderedAgeBoundPopulation() and returns a reference to it. |
java.util.logging.Logger |
getLogger()
|
java.math.BigDecimal |
getMalePopulation(GENESIS_AgeBound ageBound)
|
java.math.BigDecimal |
getMalePopulationNullAllowed(GENESIS_AgeBound ageBound)
|
java.math.BigDecimal |
getMalePopulationSum(long startAgeInYears,
long endAgeInYears)
Returns the sum of male population from ages start Age up to endAge inclusive. |
java.math.BigDecimal |
getMalePopulationTotal()
Returns the sum of male population from getMinAgeYearsMale() to getMaxAgeYearsMale() inclusive. |
java.lang.Long |
getMaxAgeInYearsWithPositivePopulation()
|
java.lang.Long |
getMaxAgeInYearsWithPositivePopulation(java.util.List<uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.AgeBoundPopulation> l)
|
java.lang.Long |
getMaxAgeInYearsWithPositivePopulationFemale()
|
java.lang.Long |
getMaxAgeInYearsWithPositivePopulationMale()
|
java.lang.Long |
getMaxAgeYears()
|
java.lang.Long |
getMaxAgeYearsFemale()
|
java.lang.Long |
getMaxAgeYearsMale()
|
java.math.BigDecimal |
getMaxPopulationInAnyAgeBound()
|
java.math.BigDecimal |
getMaxPopulationInAnyAgeBound(java.util.TreeMap<GENESIS_AgeBound,java.math.BigDecimal> pop)
|
java.math.BigDecimal |
getMaxPopulationInAnyAgeBoundFemale()
|
java.math.BigDecimal |
getMaxPopulationInAnyAgeBoundMale()
|
java.lang.Long |
getMinAgeInYearsWithPositivePopulation()
|
java.lang.Long |
getMinAgeInYearsWithPositivePopulation(java.util.List<uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.AgeBoundPopulation> l)
|
java.lang.Long |
getMinAgeInYearsWithPositivePopulationFemale()
|
java.lang.Long |
getMinAgeInYearsWithPositivePopulationMale()
|
java.lang.Long |
getMinAgeYears()
|
java.lang.Long |
getMinAgeYearsFemale()
|
java.lang.Long |
getMinAgeYearsMale()
|
static java.math.BigDecimal |
getPopulationSum(java.lang.Long startAgeInYears,
java.lang.Long endAgeInYears,
java.util.TreeMap<GENESIS_AgeBound,java.math.BigDecimal> pop)
Returns the sum of population values from pop. |
java.math.BigDecimal |
getPopulationTotal()
Returns the sum total population. |
void |
init()
|
static void |
initPop(int gender,
long minimumAgeInYears,
long maximumAgeInYears,
GENESIS_Population pop,
uk.ac.leeds.ccg.andyt.projects.moses.io.CAS001DataRecord aCAS001DataRecord)
|
static java.util.TreeMap<java.lang.String,GENESIS_Population> |
loadOAPopulations(java.io.File theMOSESWorkspace,
java.io.File theGENESISWorkspace,
java.lang.String areaCode)
|
static void |
main(java.lang.String[] args)
|
void |
multiply(java.math.BigDecimal value)
Multiplies all age gender counts by value |
static void |
run(java.lang.String[] args,
java.io.File directory)
|
void |
runCensusData(java.lang.String[] args)
|
void |
runCensusDataTest(java.lang.String[] args)
|
void |
runCSVToXML(java.lang.String[] args)
|
void |
subtractPopulation(GENESIS_Population populationToSubtract)
Adds population from populationToAdd |
java.lang.String |
toString()
|
void |
updateGenderedAgePopulation()
updates genderAgePopulation using _FemaleAgeBoundPopulationCount_TreeMap and _MaleAgeBoundPopulationCount_TreeMap |
static void |
updateGenderedAgePopulation(java.util.TreeMap<java.lang.String,GENESIS_Population> pops)
updates genderAgePopulation using _FemaleAgeBoundPopulationCount_TreeMap and _MaleAgeBoundPopulationCount_TreeMap |
static void |
writeLUTsForOAToMSOAHashMap()
|
static void |
writeLUTsForOAToMSOATreeMap()
|
void |
writeToCSV(java.io.File a_File)
|
void |
writeToImage(java.util.concurrent.ExecutorService executorService,
java.io.File outfile,
java.lang.String format,
java.lang.String title,
int dataWidth,
int dataHeight,
java.lang.String xAxisLabel,
java.lang.String yAxisLabel,
boolean drawOriginLinesOnPlot,
int decimalPlacePrecisionForCalculations,
int significantDigits,
java.math.RoundingMode roundingMode,
int startAgeOfEndYearInterval)
|
void |
writeToXML(java.io.File a_File)
|
Methods inherited from class uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.population.PopulationType |
---|
setGenderedAgeBoundPopulation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public transient GENESIS_Environment _GENESIS_Environment
public java.util.TreeMap<GENESIS_AgeBound,java.math.BigDecimal> _FemaleAgeBoundPopulationCount_TreeMap
public java.util.TreeMap<GENESIS_AgeBound,java.math.BigDecimal> _MaleAgeBoundPopulationCount_TreeMap
Constructor Detail |
---|
public GENESIS_Population()
public GENESIS_Population(GENESIS_Population a_Population)
public GENESIS_Population(GENESIS_Environment a_GENESIS_Environment, uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.population.PopulationType a_PopulationType)
public GENESIS_Population(GENESIS_Environment a_GENESIS_Environment, java.io.File population_File)
public GENESIS_Population(GENESIS_Environment a_GENESIS_Environment, java.io.File population_File, java.math.BigDecimal multiplicand)
a_GENESIS_Environment
- population_File
- multiplicand
- A number greater than zero used to scale up or down
the population as read from population_Filepublic GENESIS_Population(GENESIS_Environment a_GENESIS_Environment, java.io.File population_File, java.math.BigDecimal multiplicand, boolean singleYearsOfAge)
a_GENESIS_Environment
- population_File
- multiplicand
- A number greater than zero used to scale up or down
the population as read from population_Filepublic GENESIS_Population(GENESIS_Environment a_GENESIS_Environment)
Method Detail |
---|
public final void init()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
public void runCSVToXML(java.lang.String[] args)
public static void writeLUTsForOAToMSOAHashMap()
public static void writeLUTsForOAToMSOATreeMap()
public void runCensusData(java.lang.String[] args)
public void runCensusDataTest(java.lang.String[] args)
public void writeToImage(java.util.concurrent.ExecutorService executorService, java.io.File outfile, java.lang.String format, java.lang.String title, int dataWidth, int dataHeight, java.lang.String xAxisLabel, java.lang.String yAxisLabel, boolean drawOriginLinesOnPlot, int decimalPlacePrecisionForCalculations, int significantDigits, java.math.RoundingMode roundingMode, int startAgeOfEndYearInterval)
public static java.util.TreeMap<java.lang.String,GENESIS_Population> loadOAPopulations(java.io.File theMOSESWorkspace, java.io.File theGENESISWorkspace, java.lang.String areaCode)
public static void initPop(int gender, long minimumAgeInYears, long maximumAgeInYears, GENESIS_Population pop, uk.ac.leeds.ccg.andyt.projects.moses.io.CAS001DataRecord aCAS001DataRecord)
public static void run(java.lang.String[] args, java.io.File directory)
public static java.util.TreeMap<java.lang.String,GENESIS_Population> aggregateSubregion(java.util.TreeMap<java.lang.String,GENESIS_Population> theOAPops, java.util.TreeMap<java.lang.String,java.lang.String> subregionToAggregateRegionLookup, GENESIS_Environment aGENESIS_Environment)
public void addPopulation(GENESIS_Population populationToAdd)
public void subtractPopulation(GENESIS_Population populationToSubtract)
public void add(java.math.BigDecimal valueToAdd)
public void multiply(java.math.BigDecimal value)
public void divide(java.math.BigDecimal value, int decimalPlaces, java.math.RoundingMode roundingMode)
public GENESIS_Population divideByPopulation(GENESIS_Population populationToDivideBy, int decimalPlaces, java.math.RoundingMode roundingMode)
public final uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.GenderedAgeBoundPopulation getGenderedAgeBoundPopulation()
getGenderedAgeBoundPopulation
in class uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.population.PopulationType
public final void updateGenderedAgePopulation()
public static void updateGenderedAgePopulation(java.util.TreeMap<java.lang.String,GENESIS_Population> pops)
public java.math.BigDecimal getFemalePopulationSum(long startAgeInYears, long endAgeInYears)
startAge
- endAge
-
public java.math.BigDecimal getFemalePopulationTotal()
public java.math.BigDecimal getMalePopulationSum(long startAgeInYears, long endAgeInYears)
startAge
- endAge
-
public java.math.BigDecimal getMalePopulationTotal()
public java.math.BigDecimal getPopulationTotal()
public static java.math.BigDecimal getPopulationSum(java.lang.Long startAgeInYears, java.lang.Long endAgeInYears, java.util.TreeMap<GENESIS_AgeBound,java.math.BigDecimal> pop)
public java.math.BigDecimal getFemalePopulation(GENESIS_AgeBound ageBound)
public java.math.BigDecimal getFemalePopulationNullAllowed(GENESIS_AgeBound ageBound)
public java.math.BigDecimal getMalePopulation(GENESIS_AgeBound ageBound)
public java.math.BigDecimal getMalePopulationNullAllowed(GENESIS_AgeBound ageBound)
public java.math.BigDecimal getMaxPopulationInAnyAgeBound()
pop
-
public java.math.BigDecimal getMaxPopulationInAnyAgeBoundFemale()
pop
-
public java.math.BigDecimal getMaxPopulationInAnyAgeBoundMale()
pop
-
public java.math.BigDecimal getMaxPopulationInAnyAgeBound(java.util.TreeMap<GENESIS_AgeBound,java.math.BigDecimal> pop)
pop
-
public java.lang.Long getMinAgeYearsFemale()
public java.lang.Long getMaxAgeYearsFemale()
public java.lang.Long getMinAgeYearsMale()
public java.lang.Long getMaxAgeYearsMale()
public java.lang.Long getMinAgeYears()
public java.lang.Long getMaxAgeYears()
public java.lang.Long getMinAgeInYearsWithPositivePopulation()
public java.lang.Long getMaxAgeInYearsWithPositivePopulation()
public java.lang.Long getMinAgeInYearsWithPositivePopulationFemale()
public java.lang.Long getMinAgeInYearsWithPositivePopulationMale()
public java.lang.Long getMinAgeInYearsWithPositivePopulation(java.util.List<uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.AgeBoundPopulation> l)
public java.lang.Long getMaxAgeInYearsWithPositivePopulationFemale()
public java.lang.Long getMaxAgeInYearsWithPositivePopulationMale()
public java.lang.Long getMaxAgeInYearsWithPositivePopulation(java.util.List<uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.common.AgeBoundPopulation> l)
public void writeToXML(java.io.File a_File)
public void writeToCSV(java.io.File a_File)
public java.lang.Object[] getAggregateGENESIS_Population(java.lang.Long minAge, java.lang.Long maxAge)
minAge
- The value for which any GENESIS_AgeBound.getAgeMin() in the
population TreeMaps are aggregated to if they are less than or equal to.maxAge
- The value for which any GENESIS_AgeBound.getAgeMin() in the
population TreeMaps are aggregated to if they are greater than or equal
to.
public static java.lang.Object[] getAggregateGENESIS_Population(GENESIS_Population pop, java.lang.Long minAgeInYears, java.lang.Long maxAgeInYears)
minAgeInYears
- The value for which any GENESIS_AgeBound.getAgeMin()
in the population TreeMaps are aggregated to if they are less than or
equal to.maxAgeInYears
- The value for which any GENESIS_AgeBound.getAgeMin()
in the population TreeMaps are aggregated to if they are greater than or
equal to.
public static java.lang.Object[] getAggregateGENESIS_Population(GENESIS_Population pop, java.lang.Long minAgeInYears, java.lang.Long maxAgeInYears, java.lang.Long ageIncrement, GENESIS_Environment a_GENESIS_Environment)
minAge
- The value below which any GENESIS_AgeBound.getAgeMin() in
pop TreeMaps are aggregated to if less than or equal to.maxAge
- The value above which any GENESIS_AgeBound.getAgeMin() in
pop TreeMaps are aggregated to if greater than or equal to.
public java.util.logging.Logger getLogger()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |