uk.ac.leeds.ccg.andyt.projects.genesis.process
Class GENESIS_DemographicModel

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.projects.genesis.process.Abstract_GENESIS_Model
      extended by uk.ac.leeds.ccg.andyt.projects.genesis.process.Abstract_GENESIS_DemographicModel
          extended by uk.ac.leeds.ccg.andyt.projects.genesis.process.GENESIS_DemographicModel
All Implemented Interfaces:
java.io.Serializable

public class GENESIS_DemographicModel
extends Abstract_GENESIS_DemographicModel
implements java.io.Serializable

A class for running a basic demographic simulation model as specified. The model is essentially aspatial in that it only deals with the processes of conception, miscarriage, birth and death. It does not deal with migration from one sub-region to another. It inputs age specific birth counts, age specific miscarriage rates and age and gender specific death counts. These are converted into mortality and fertility rates given the initial population. Conception is only maternally specified, paternal relationships are not handled. The initial population can be specified in age and gender counts, or it may be the output from a previous simulation of this kind. The model ticks with a daily time step and at each tick, death, miscarriage, pregnancy and birth are stochastically determined using probabilities and pseudo random tests. The model outputs statistics annually and is designed to run for a single year although there is scope for running for multiple years. There are options for continuing a simulation run. One option is to inputs check-pointed instances of the pseudo random sequence objects. With this option it is possible to run a simulation in a single 10 year step to produce a simulated results that is the same as running say one 5 year simulation followed by another 5 year simulation. Another option is to reset the pseudo random sequence objects and use an input argument to determine the pseudo random sequence used. This allows for a variety of results to be created. With pseudo random sequence resetting on an annual basis it should also be possible to produce identical results for multiple year runs done either in one process or in multiple processes. The implementation is designed to scale to large populations and will swap collections of people during execution as needed.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class uk.ac.leeds.ccg.andyt.projects.genesis.process.Abstract_GENESIS_DemographicModel
_Demographics, _initial_Demographics, _InitialBirthCount_File, _InitialDeathCount_File, _InitialFertilityRate_File, _InitialMiscarriageRate_File, _InitialMortalityRate_File, _InitialPopulation_File, _LivingFemaleIDs, _LivingMaleIDs, _NearlyDuePregnantFemaleIDs, _NotPregnantFemaleIDs, _PregnantFemaleIDs, _regionIDs, _RunID, _SeedDirectory_File, _Years
 
Fields inherited from class uk.ac.leeds.ccg.andyt.projects.genesis.process.Abstract_GENESIS_Model
_Directory, _GENESIS_AgentCollectionManager, _GENESIS_Environment, _HandleOutOfMemoryError, _ImageExporter, _InitialRandomSeed, _Input_Parameter_File, _NextRandomSeed, _RandomArray, _RandomSeed, _RandomSeedIncrement, _ResultDataDirectory_File, executorService
 
Constructor Summary
GENESIS_DemographicModel()
          GENESIS_Environment reference
GENESIS_DemographicModel(java.io.File thisFile)
           
GENESIS_DemographicModel(GENESIS_DemographicModel a_Demographic_Aspatial_1)
           
GENESIS_DemographicModel(GENESIS_Environment a_GENESIS_Environment)
           
 
Method Summary
 GENESIS_Female getNewInitialisedFemale(GENESIS_AgeBound ageBound, java.lang.String birthSubregionID, java.lang.String thisSubregionID, java.util.TreeSet<java.lang.Long> subregionLivingFemaleIDs, java.util.TreeSet<java.lang.Long> subregionNotPregnantFemaleIDs)
          Creates and returns a new GENESIS_Female.
 GENESIS_Female getNewInitialisedFemale(GENESIS_AgeBound ageBound, java.util.TreeSet<java.lang.Long> subregionLivingFemaleIDs, java.util.TreeSet<java.lang.Long> subregionNotPregnantFemaleIDs)
          Creates and returns a new GENESIS_Female.
 GENESIS_Male getNewInitialisedMale(GENESIS_AgeBound ageBound, java.lang.String birthSubregionID, java.lang.String thisSubregionID, java.util.TreeSet<java.lang.Long> subregionLivingMaleIDs)
          Creates and returns a new GENESIS_Male.
 GENESIS_Male getNewInitialisedMale(GENESIS_AgeBound ageBound, java.util.TreeSet<java.lang.Long> subregionLivingMaleIDs)
          Creates and returns a new GENESIS_Male.
 GENESIS_Age getRandomAge(GENESIS_AgeBound ageBound)
          Used for initialising a time of birth.
 java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> getSingleYearsOfAgePopulations(java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> inputPopulation, GENESIS_Time a_Time)
           
protected  java.util.TreeSet<java.lang.Long> getSubregionIDs(java.util.TreeMap<java.lang.String,java.util.TreeSet<java.lang.Long>> regionIDMap, java.util.TreeSet<java.lang.Long> subregionIDs, java.lang.String subregionID)
           
 void init_Demographics()
          Initialises _Demographics.
 void initCollections(java.lang.String underscore)
           
 int initialisePregnancies()
          If at the start of the simulations there is no data about pregnancies this method can be used to initialise pregnancies so that due dates are spread out and in the first tick of a simulation then births may be due.
 void initialiseSubregionPopulations(java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> singleYearAgeRegionPopulation)
          From the single year age population counts initialise the individuals giving each a date of birth and for females evaluating pregnancy status.
 void initLookUpMSOAfromOAHashMap(java.lang.String fileSeparator)
          CASDataHandler aCASDataHandler = new CASDataHandler(); theOAtoMSOALookup = aCASDataHandler.get_LookUpMSOAfromOAHashMap(); Generic_StaticIO.writeObject(theOAtoMSOALookup,inputFile)
static void main(java.lang.String[] args)
          This method wraps the entire process: It sets up logs, calls run(args), then after completion, it flushes the logs and returns.
 java.lang.String run(java.lang.Long randomSeed_Long, uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.parameters.ParametersType parameters, java.lang.String fileSeparator, boolean grid)
           
static void run(java.lang.String[] args, boolean grid)
           
 void run0()
           
 java.util.HashSet<java.util.concurrent.Future> simulate(int years)
          Dynamically simulates a population over time.
 java.lang.Object[] simulateBirth(GENESIS_Female a_Female, long a_Female_ID, GENESIS_Population localPopulation, java.util.TreeSet<java.lang.Long> pregnantFemaleIDs, java.util.TreeSet<java.lang.Long> nearlyDuePregnantFemaleIDs, java.util.TreeSet<java.lang.Long> notPregnantFemaleIDs)
           
 boolean simulateDeath(GENESIS_Mortality mortality, GENESIS_Female a_Female, java.lang.Long a_Female_ID, GENESIS_FemaleCollection a_FemaleCollection, java.lang.Long a_Collection_ID, GENESIS_AgeBound ageBound, GENESIS_Population subregionPopulation, GENESIS_Population regionTotalPopulation, java.util.TreeSet<java.lang.Long> pregnantFemaleIDs, java.util.TreeSet<java.lang.Long> nearlyDuePregnantFemaleIDs, java.util.TreeSet<java.lang.Long> notPregnantFemaleIDs)
           
 boolean simulateDeath(GENESIS_Mortality mortality, GENESIS_Male a_Male, java.lang.Long a_Male_ID, GENESIS_MaleCollection a_MaleCollection, java.lang.Long a_Collection_ID, GENESIS_AgeBound ageBound, GENESIS_Population subregionPopulation, GENESIS_Population regionTotalPopulation)
           
 long simulateImmigrationToStudyRegion(GENESIS_Migration migration, java.lang.String regionID, java.util.TreeMap<java.lang.String,java.util.TreeSet<java.lang.Long>> regionLivingFemaleIDs, java.util.TreeMap<java.lang.String,java.util.TreeSet<java.lang.Long>> regionNotPregnantFemaleIDs, java.util.TreeMap<java.lang.String,java.util.TreeSet<java.lang.Long>> regionLivingMaleIDs)
           
 long simulateInMigrationFromRestOfUK(GENESIS_Migration migration, java.lang.String regionID, java.util.TreeMap<java.lang.String,java.util.TreeSet<java.lang.Long>> regionLivingFemaleIDs, java.util.TreeMap<java.lang.String,java.util.TreeSet<java.lang.Long>> regionNotPregnantFemaleIDs, java.util.TreeMap<java.lang.String,java.util.TreeSet<java.lang.Long>> regionLivingMaleIDs)
           
 boolean simulateMiscarriage(java.lang.String regionID, GENESIS_Female a_Female, long a_Female_ID, GENESIS_AgeBound ageBound, java.util.TreeSet<java.lang.Long> pregnantFemaleIDs, java.util.TreeSet<java.lang.Long> nearlyDuePregantFemaleIDs, java.util.TreeSet<java.lang.Long> notPregantFemaleIDs)
          This should only get called if a_Female is known to be pregnant.
 boolean simulateMiscarriageNoRemoval(java.lang.String regionID, GENESIS_Female a_Female, long a_Female_ID, GENESIS_AgeBound ageBound)
          This should only get called if a_Female is known to be pregnant.
 boolean simulateOutMigration(GENESIS_Migration migration, GENESIS_Female a_Female, java.lang.Long a_Female_ID, GENESIS_FemaleCollection a_FemaleCollection, java.lang.Long a_Collection_ID, GENESIS_AgeBound ageBound)
           
 boolean simulateOutMigration(GENESIS_Migration migration, GENESIS_Male a_Male, java.lang.Long a_Male_ID, GENESIS_MaleCollection a_MaleCollection, java.lang.Long a_Collection_ID, GENESIS_AgeBound ageBound)
           
 boolean simulatePregnancy(GENESIS_Fertility fertility, GENESIS_Female a_Female, long a_Female_ID, java.util.TreeSet<java.lang.Long> pregnantFemaleIDs, java.util.TreeSet<java.lang.Long> notPregnantFemaleIDs)
           
 void updateNearlyDuePregnantFemaleIDs()
          Deprecated. 
 void updateSubregionNearlyDuePregnantFemaleIDs(GENESIS_Female a_Female, long a_Female_ID, java.util.TreeSet<java.lang.Long> nearlyDuePregantFemaleIDs_HashSet)
           
protected  void writeOutDeadCollectionNotAlreadyStoredOnFile()
          Write out: _GENESIS_AgentCollectionManager._DeadFemaleCollection; _GENESIS_AgentCollectionManager._DeadMaleCollection; _GENESIS_AgentCollectionManager._DeadFemaleCollection_HashMap; _GENESIS_AgentCollectionManager._DeadMaleCollection_HashMap.
 void writeOutEstimatedFertility(java.io.File resultMetadataDirectory_File)
           
 void writeOutEstimatedMortality(java.io.File resultMetadataDirectory_File)
           
 void writeOutInputPopulations(java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> inputPopulation, java.io.File resultMetadataDirectory_File)
           
protected  void writeOutLivingCollectionNotAlreadyStoredOnFile()
          Writes out Living Collections that are not already stored on File from: _GENESIS_AgentCollectionManager._LivingFemaleCollection_HashMap; and, _GENESIS_AgentCollectionManager._LivingMaleCollection_HashMap.
protected  void writeOutLivingCollectionNotAlreadyStoredOnFile(boolean handleOutOfMemoryError)
          Writes out Living Collections that are not already stored on File from: _GENESIS_AgentCollectionManager._LivingFemaleCollection_HashMap; and, _GENESIS_AgentCollectionManager._LivingMaleCollection_HashMap.
 void writeOutStartPopulations(java.io.File resultMetadataDirectory_File)
           
 
Methods inherited from class uk.ac.leeds.ccg.andyt.projects.genesis.process.Abstract_GENESIS_DemographicModel
get_Demographics, get_Fertility, get_Migration, get_Mortality, get_Years, init_Environment, initialiseBirthCount_File, initialiseDeathCount_File, initialiseFertilityRate_File, initialiseMiscarriageRate_File, initialiseMortalityRate_File, initialisePopulation_File
 
Methods inherited from class uk.ac.leeds.ccg.andyt.projects.genesis.process.Abstract_GENESIS_Model
get_NextRandom, get_NextRandomSeed, get_Random, get_RandomArray, get_RandomArray, get_RandomArrayMinLength, getExecutorService, getFileThatExists, getLogger, init_RandomArrayMinLength, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GENESIS_DemographicModel

public GENESIS_DemographicModel()
GENESIS_Environment reference


GENESIS_DemographicModel

public GENESIS_DemographicModel(GENESIS_Environment a_GENESIS_Environment)

GENESIS_DemographicModel

public GENESIS_DemographicModel(GENESIS_DemographicModel a_Demographic_Aspatial_1)

GENESIS_DemographicModel

public GENESIS_DemographicModel(java.io.File thisFile)
Method Detail

main

public static void main(java.lang.String[] args)
This method wraps the entire process: It sets up logs, calls run(args), then after completion, it flushes the logs and returns.

Parameters:
args - There are two expected arguments: args[0] long (psuedo random sequence seed). A negative value is for continuing a simulation run by loading the state of the pseudo random seed sequences of a continuation run. If a continuation run is not being performed the program will exit in error. args[1] String (workspace File path)

run

public static void run(java.lang.String[] args,
                       boolean grid)
Parameters:
args - There are two expected arguments: args[0] long (psuedo random sequence seed). A negative value is for continuing a simulation. A continued simulation is run by loading check pointed serialised Random instances in such a way that another result can be generated in a single step at a later date without resetting Random seeds at arbitrary steps. If a continuation run is not being performed the program will exit in error. args[1] String (workspace File path)
args -

run

public java.lang.String run(java.lang.Long randomSeed_Long,
                            uk.ac.leeds.ccg.andyt.projects.genesis.io.schema.parameters.ParametersType parameters,
                            java.lang.String fileSeparator,
                            boolean grid)
Parameters:
randomSeed_Long -
parameters_File -
a_Parameters -
Returns:

run0

public void run0()

writeOutDeadCollectionNotAlreadyStoredOnFile

protected void writeOutDeadCollectionNotAlreadyStoredOnFile()
Write out: _GENESIS_AgentCollectionManager._DeadFemaleCollection; _GENESIS_AgentCollectionManager._DeadMaleCollection; _GENESIS_AgentCollectionManager._DeadFemaleCollection_HashMap; _GENESIS_AgentCollectionManager._DeadMaleCollection_HashMap.


writeOutLivingCollectionNotAlreadyStoredOnFile

protected void writeOutLivingCollectionNotAlreadyStoredOnFile(boolean handleOutOfMemoryError)
Writes out Living Collections that are not already stored on File from: _GENESIS_AgentCollectionManager._LivingFemaleCollection_HashMap; and, _GENESIS_AgentCollectionManager._LivingMaleCollection_HashMap.


writeOutLivingCollectionNotAlreadyStoredOnFile

protected void writeOutLivingCollectionNotAlreadyStoredOnFile()
Writes out Living Collections that are not already stored on File from: _GENESIS_AgentCollectionManager._LivingFemaleCollection_HashMap; and, _GENESIS_AgentCollectionManager._LivingMaleCollection_HashMap.


initCollections

public void initCollections(java.lang.String underscore)

init_Demographics

public void init_Demographics()
Initialises _Demographics. _Demographics._Population are loaded from existing GENESIS_FemaleCollections and GENESIS_MaleCollections


getSingleYearsOfAgePopulations

public java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> getSingleYearsOfAgePopulations(java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> inputPopulation,
                                                                                                                                 GENESIS_Time a_Time)
Parameters:
inputPopulation - The population registered to age groups which is not necessarily in single years of age.
a_Time -
Returns:
TreeMap the population in single years of age.

initialiseSubregionPopulations

public void initialiseSubregionPopulations(java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> singleYearAgeRegionPopulation)
From the single year age population counts initialise the individuals giving each a date of birth and for females evaluating pregnancy status. The IDs of individuals are assigned to the appropriate collections. This also initialises _regionIDs TreeSets

Parameters:
singleYearAgeRegionPopulation -

getNewInitialisedFemale

public GENESIS_Female getNewInitialisedFemale(GENESIS_AgeBound ageBound,
                                              java.lang.String birthSubregionID,
                                              java.lang.String thisSubregionID,
                                              java.util.TreeSet<java.lang.Long> subregionLivingFemaleIDs,
                                              java.util.TreeSet<java.lang.Long> subregionNotPregnantFemaleIDs)
Creates and returns a new GENESIS_Female. The result returned has a time of birth initialised within the ageBound. The result.ID is added to subregionLivingFemaleIDs and subregionNotPregnantFemaleIDs. The result._ResidentialSubregionIDs has two values added, firstly birthSubregionID, secondly thisSubregionID.

Parameters:
ageBound -
birthSubregionID -
thisSubregionID -
subregionLivingFemaleIDs -
subregionNotPregnantFemaleIDs -
Returns:

getNewInitialisedFemale

public GENESIS_Female getNewInitialisedFemale(GENESIS_AgeBound ageBound,
                                              java.util.TreeSet<java.lang.Long> subregionLivingFemaleIDs,
                                              java.util.TreeSet<java.lang.Long> subregionNotPregnantFemaleIDs)
Creates and returns a new GENESIS_Female. The result returned has a time of birth initialised within the ageBound. The result.ID is added to subregionLivingFemaleIDs and subregionNotPregnantFemaleIDs.

Parameters:
ageBound -
birthSubregionID -
thisSubregionID -
Returns:

getNewInitialisedMale

public GENESIS_Male getNewInitialisedMale(GENESIS_AgeBound ageBound,
                                          java.lang.String birthSubregionID,
                                          java.lang.String thisSubregionID,
                                          java.util.TreeSet<java.lang.Long> subregionLivingMaleIDs)
Creates and returns a new GENESIS_Male. The result returned has a time of birth initialised within the ageBound. The result.ID is added to subregionLivingMaleIDs. The result._ResidentialSubregionIDs has two values added, firstly birthSubregionID, secondly thisSubregionID.

Parameters:
ageBound -
birthSubregionID -
thisSubregionID -
subregionLivingMaleIDs -
Returns:

getNewInitialisedMale

public GENESIS_Male getNewInitialisedMale(GENESIS_AgeBound ageBound,
                                          java.util.TreeSet<java.lang.Long> subregionLivingMaleIDs)
Creates and returns a new GENESIS_Male. The result returned has a time of birth initialised within the ageBound. The result.ID is added to subregionLivingMaleIDs.

Parameters:
ageBound -
subregionLivingMaleIDs -
Returns:

getRandomAge

public GENESIS_Age getRandomAge(GENESIS_AgeBound ageBound)
Used for initialising a time of birth.

Parameters:
ageBound -
Returns:
GENESIS_age at random from within bounds of ageBound.

writeOutEstimatedFertility

public void writeOutEstimatedFertility(java.io.File resultMetadataDirectory_File)

writeOutEstimatedMortality

public void writeOutEstimatedMortality(java.io.File resultMetadataDirectory_File)

writeOutInputPopulations

public void writeOutInputPopulations(java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> inputPopulation,
                                     java.io.File resultMetadataDirectory_File)

writeOutStartPopulations

public void writeOutStartPopulations(java.io.File resultMetadataDirectory_File)

simulate

public java.util.HashSet<java.util.concurrent.Future> simulate(int years)
Dynamically simulates a population over time. We go through the entire population multiple times for the number of years input. We evaluate every person on a daily basis. Each day we check a persons age and look up the daily mortality probability for someone of their age and gender. We then perform a stochastic pseudo random test which determines if they survive or die. For females we also check pregnancy status and if they are pregnant and due then they give birth, otherwise, we stochastically determine if they experience a miscarriage. If they are not pregnant we stochastically simulate if they become pregnant. Various aggregate counts are kept and reported on an annual basis.

Parameters:
_Demographics -
_Years - The number of years over which the simulation occurs

getSubregionIDs

protected java.util.TreeSet<java.lang.Long> getSubregionIDs(java.util.TreeMap<java.lang.String,java.util.TreeSet<java.lang.Long>> regionIDMap,
                                                            java.util.TreeSet<java.lang.Long> subregionIDs,
                                                            java.lang.String subregionID)
Parameters:
regionIDMap -
subregionIDs -
subregionID -
Returns:

simulateDeath

public boolean simulateDeath(GENESIS_Mortality mortality,
                             GENESIS_Female a_Female,
                             java.lang.Long a_Female_ID,
                             GENESIS_FemaleCollection a_FemaleCollection,
                             java.lang.Long a_Collection_ID,
                             GENESIS_AgeBound ageBound,
                             GENESIS_Population subregionPopulation,
                             GENESIS_Population regionTotalPopulation,
                             java.util.TreeSet<java.lang.Long> pregnantFemaleIDs,
                             java.util.TreeSet<java.lang.Long> nearlyDuePregnantFemaleIDs,
                             java.util.TreeSet<java.lang.Long> notPregnantFemaleIDs)
Parameters:
a_Female -
a_Female_ID -
a_FemaleCollection -
age -
Returns:
true if there is a death

simulateDeath

public boolean simulateDeath(GENESIS_Mortality mortality,
                             GENESIS_Male a_Male,
                             java.lang.Long a_Male_ID,
                             GENESIS_MaleCollection a_MaleCollection,
                             java.lang.Long a_Collection_ID,
                             GENESIS_AgeBound ageBound,
                             GENESIS_Population subregionPopulation,
                             GENESIS_Population regionTotalPopulation)

simulateOutMigration

public boolean simulateOutMigration(GENESIS_Migration migration,
                                    GENESIS_Female a_Female,
                                    java.lang.Long a_Female_ID,
                                    GENESIS_FemaleCollection a_FemaleCollection,
                                    java.lang.Long a_Collection_ID,
                                    GENESIS_AgeBound ageBound)

simulateOutMigration

public boolean simulateOutMigration(GENESIS_Migration migration,
                                    GENESIS_Male a_Male,
                                    java.lang.Long a_Male_ID,
                                    GENESIS_MaleCollection a_MaleCollection,
                                    java.lang.Long a_Collection_ID,
                                    GENESIS_AgeBound ageBound)

simulateInMigrationFromRestOfUK

public long simulateInMigrationFromRestOfUK(GENESIS_Migration migration,
                                            java.lang.String regionID,
                                            java.util.TreeMap<java.lang.String,java.util.TreeSet<java.lang.Long>> regionLivingFemaleIDs,
                                            java.util.TreeMap<java.lang.String,java.util.TreeSet<java.lang.Long>> regionNotPregnantFemaleIDs,
                                            java.util.TreeMap<java.lang.String,java.util.TreeSet<java.lang.Long>> regionLivingMaleIDs)

simulateImmigrationToStudyRegion

public long simulateImmigrationToStudyRegion(GENESIS_Migration migration,
                                             java.lang.String regionID,
                                             java.util.TreeMap<java.lang.String,java.util.TreeSet<java.lang.Long>> regionLivingFemaleIDs,
                                             java.util.TreeMap<java.lang.String,java.util.TreeSet<java.lang.Long>> regionNotPregnantFemaleIDs,
                                             java.util.TreeMap<java.lang.String,java.util.TreeSet<java.lang.Long>> regionLivingMaleIDs)

simulateBirth

public java.lang.Object[] simulateBirth(GENESIS_Female a_Female,
                                        long a_Female_ID,
                                        GENESIS_Population localPopulation,
                                        java.util.TreeSet<java.lang.Long> pregnantFemaleIDs,
                                        java.util.TreeSet<java.lang.Long> nearlyDuePregnantFemaleIDs,
                                        java.util.TreeSet<java.lang.Long> notPregnantFemaleIDs)
Parameters:
a_Female -
a_Female_ID -
a_FemaleCollection -
age -
Returns:
GENESIS_Person[] of babies if there are births and null otherwise

updateSubregionNearlyDuePregnantFemaleIDs

public void updateSubregionNearlyDuePregnantFemaleIDs(GENESIS_Female a_Female,
                                                      long a_Female_ID,
                                                      java.util.TreeSet<java.lang.Long> nearlyDuePregantFemaleIDs_HashSet)

updateNearlyDuePregnantFemaleIDs

@Deprecated
public void updateNearlyDuePregnantFemaleIDs()
Deprecated. 


simulatePregnancy

public boolean simulatePregnancy(GENESIS_Fertility fertility,
                                 GENESIS_Female a_Female,
                                 long a_Female_ID,
                                 java.util.TreeSet<java.lang.Long> pregnantFemaleIDs,
                                 java.util.TreeSet<java.lang.Long> notPregnantFemaleIDs)
Parameters:
a_Female -
a_Female_ID -
a_FemaleCollection -
age -
Returns:
true if pregnancy occurs

simulateMiscarriage

public boolean simulateMiscarriage(java.lang.String regionID,
                                   GENESIS_Female a_Female,
                                   long a_Female_ID,
                                   GENESIS_AgeBound ageBound,
                                   java.util.TreeSet<java.lang.Long> pregnantFemaleIDs,
                                   java.util.TreeSet<java.lang.Long> nearlyDuePregantFemaleIDs,
                                   java.util.TreeSet<java.lang.Long> notPregantFemaleIDs)
This should only get called if a_Female is known to be pregnant. If a miscarriage is simulated then the method returns true having first: removed a_Female_ID from _PregnantFemaleIDs and _NearlyDuePregnantFemaleIDs (should it also have been in there); and added a_Female_ID to _NotPregnantFemaleIDs.

Parameters:
a_Female -
a_Female_ID -
ageBound -
Returns:

simulateMiscarriageNoRemoval

public boolean simulateMiscarriageNoRemoval(java.lang.String regionID,
                                            GENESIS_Female a_Female,
                                            long a_Female_ID,
                                            GENESIS_AgeBound ageBound)
This should only get called if a_Female is known to be pregnant.

Parameters:
a_Female -
a_Female_ID -
ageBound -
Returns:

initialisePregnancies

public int initialisePregnancies()
If at the start of the simulations there is no data about pregnancies this method can be used to initialise pregnancies so that due dates are spread out and in the first tick of a simulation then births may be due.


initLookUpMSOAfromOAHashMap

public void initLookUpMSOAfromOAHashMap(java.lang.String fileSeparator)
CASDataHandler aCASDataHandler = new CASDataHandler(); theOAtoMSOALookup = aCASDataHandler.get_LookUpMSOAfromOAHashMap(); Generic_StaticIO.writeObject(theOAtoMSOALookup,inputFile)