uk.ac.leeds.ccg.andyt.projects.genesis.society.demography
Class GENESIS_Migration

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.projects.genesis.society.demography.GENESIS_Migration
All Implemented Interfaces:
java.io.Serializable

public class GENESIS_Migration
extends java.lang.Object
implements java.io.Serializable

A class for handling migration in simulation model. Migration is done as a staged process. Firstly the out migration probabilities of an individual of a specific age and gender are considered. If the simulation considers that someone will migrate then the district to which they migrate including emigration is decided. With the district decided, another decision is made to reside them within a sub area of the district. Immigration is handled separately. For people immigrating into the model it is decided about how many of each type of person there are immigrating on a time step. Again, in a staged way, first these are assigned a Local Authority District region, then they are assigned a sub area within the district. Return migration is currently not done. Anyone migrating from the model is effectively lost to the world. Anyone immigrating is newly created and their birth date and pregnancy status are initialised.

See Also:
Serialized Form

Field Summary
 GENESIS_Environment _GENESIS_Environment
           
 java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> cumulativeSumRescaledRegionOutMigration
          For those migrating from a region this gives a way to assign the expected region destination (which may be the same).
 java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> cumulativeSumRescaledSubregionInMigration
          For those migrating into a region this gives a way to assign a subregion destination.
 java.util.TreeMap<java.lang.String,GENESIS_Population> immigrationRates
          For storing the daily gender and age specific immigration rates for people immigrating into a specific region.
 java.util.TreeMap<java.lang.String,GENESIS_Population> regionImmigration
          For storing the population immigrating into each region in the study region.
 java.util.TreeMap<java.lang.String,GENESIS_Population> regionInMigration
          For storing the population migrating into each region in the study region.
 java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> regionInMigrationRates
          For storing the daily gender age migration rates for people migrating into a specific region.
 java.util.TreeMap<java.lang.String,GENESIS_Population> regionInternalMigration
          For storing the population immigrating into each region in the study region.
 java.util.TreeMap<java.lang.String,GENESIS_Population> regionOutMigration
          For storing the population migrating out from each region in the study region.
 java.util.TreeMap<java.lang.String,GENESIS_Population> regionOutMigrationRates
          For storing the daily gender age migration rates for people moving from a specific region (internal migration included).
 java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> regionToRegionMigration
          For storing the population migrating from each region to each region.
static java.lang.String RestOfTheWorld_String
           
static java.lang.String RestOfUK_String
           
 java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> subregionInMigration
          For storing the population migrating into each subregion in a region.
 java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> subregionInternalInMigration
          For storing the population migrating internally within each region.
 java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> subregionInternalOutMigration
          For storing the population migrating internally within each region.
 java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> subregionOutMigration
          For storing the population migrating out of each subregion in a region.
 
Constructor Summary
GENESIS_Migration()
           
GENESIS_Migration(GENESIS_Environment a_GENESIS_Environment)
           
GENESIS_Migration(GENESIS_Environment a_GENESIS_Environment, GENESIS_Migration a_GENESIS_Migration)
           
 
Method Summary
protected  void addToPop(GENESIS_Population population, java.lang.String[] fields, GENESIS_AgeBound ageBoundZeroToSixteen, GENESIS_AgeBound ageBoundSixteenToPension, GENESIS_AgeBound ageBoundPensionPlus)
           
 GENESIS_Population getDailyImmigrationRate(java.lang.String regionID)
           
 GENESIS_Population getDailyInMigrationRate(java.lang.String regionID)
           
 java.math.BigDecimal getDailyInternalMigrationRate(GENESIS_Female female, GENESIS_AgeBound ageBound, java.math.BigDecimal pop, int decimalPlaces, java.math.RoundingMode roundingMode)
           
 java.math.BigDecimal getDailyInternalMigrationRate(GENESIS_Male male, GENESIS_AgeBound ageBound, java.math.BigDecimal pop, int decimalPlaces, java.math.RoundingMode roundingMode)
           
 java.math.BigDecimal getDailyOutMigrationProbability(GENESIS_Female female, GENESIS_AgeBound ageBound)
           
 java.math.BigDecimal getDailyOutMigrationProbability(GENESIS_Male male, GENESIS_AgeBound ageBound)
           
 java.lang.String getInternalMigrationSubregionDestinationFromRestOfUKFemale(GENESIS_AgeBound ageBound, java.lang.String destinationRegionID, int decimalPlaces, java.util.Random random)
          For migration to a region in the study region from the rest of the UK.
 java.lang.String getInternalMigrationSubregionDestinationFromRestOfUKMale(GENESIS_AgeBound ageBound, java.lang.String destinationRegionID, int decimalPlaces, java.util.Random random)
          For migration to a region in the study region from the rest of the UK.
 java.lang.String getInternalMigrationSubregionDestinationFromRestOfWorldFemale(GENESIS_AgeBound ageBound, java.lang.String destinationRegionID, int decimalPlaces, java.util.Random random)
           
 java.lang.String getInternalMigrationSubregionDestinationFromRestOfWorldMale(GENESIS_AgeBound ageBound, java.lang.String destinationRegionID, int decimalPlaces, java.util.Random random)
           
 java.lang.String getInternalMigrationSubregionDestinationFromStudyRegion(GENESIS_Female female, java.lang.String destinationRegionID, int decimalPlaces, java.util.Random random)
          For in migration to the region given by destinationRegionID, this method returns a subregionID for the subregion that the female is assigned as migrating to.
 java.lang.String getInternalMigrationSubregionDestinationFromStudyRegion(GENESIS_Male male, java.lang.String destinationRegionID, int decimalPlaces, java.util.Random random)
          For internal migration within the study region.
 java.lang.String getInternalMigrationSubregionDestinationFromStudyRegionFemale(GENESIS_AgeBound ageBound, java.lang.String destinationRegionID, int decimalPlaces, java.util.Random random)
          For in migration to the region given by destinationRegionID, this method returns a subregionID for the subregion that a female with an age in the given ageBound is assigned as migrating to.
 java.lang.String getInternalMigrationSubregionDestinationFromStudyRegionMale(GENESIS_AgeBound ageBound, java.lang.String destinationRegionID, int decimalPlaces, java.util.Random random)
          For internal migration within the study region.
 java.lang.String getOutMigrationRegionDestination(GENESIS_Female female, java.lang.String originRegionID, int decimalPlaces, java.util.Random random)
          Untested
 java.lang.String getOutMigrationRegionDestination(GENESIS_Male male, java.lang.String originRegionID, int decimalPlaces, java.util.Random random)
          Untested
 void init()
          The keys are LAD areaIDs, the values are a TreeMap with keys being specific Gender_Age
 java.lang.Object[] loadLUT(java.io.File directory, java.lang.String filename)
           
static void main(java.lang.String[] args)
           
 void processCounts(java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> population, java.math.BigDecimal migrationFactor, java.math.BigDecimal migrationMinimum)
          For converting counts to daily probabilities and rates.
 void readRegionMigrationData(java.io.File directory, java.lang.String filename)
          read LAD migration data
 void readSubregionMigrationData(java.io.File directory, java.lang.String filename)
          Output Area migration data 223059,95ZZ160008,223018,95ZZ100007,3,0,3,0,0,0,3,0,3,0,0,0 OriginZoneID, OriginZoneCode, DestinationZoneID, DestinationZoneCode, 12 Fields: 1 = Total all ages; 2 = Total male; 3 = Total female; 4 = Total age 0-15; 5 = Male 0-15; 6 = Female 0-15; 7 = Total 16-PensionableAge; 8 = Male 16-PensionableAge; 9 = Female 16-PensionableAge; 10 = Total PensionableAge+; 11 = Male PensionableAge+; 12 = Female PensionableAge+
 void rescale(java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> map, int decimalPlaces, java.math.RoundingMode roundingMode)
           
 void run()
           
 void runFormatData()
          "Origin geography: UK interaction data districts 2001","Destination geography: UK interaction data districts 2001" "Geography",,"Interaction data",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Origins","Destinations","2001 SMS Level 1",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "UK interaction data districts 2001","UK interaction data districts 2001","[Table 1; Cell 1] Total;","[Table 1; Cell 2] Total;Sex Male","[Table 1; Cell 3] Total;Sex Female","[Table 1; Cell 4] Age 0;","[Table 1; Cell 5] Age 0;Sex Male","[Table 1; Cell 6] Age 0;Sex Female","[Table 1; Cell 7] Age 1-2;","[Table 1; Cell 8] Age 1-2;Sex Male","[Table 1; Cell 9] Age 1-2;Sex Female","[Table 1; Cell 10] Age 3-4;","[Table 1; Cell 11] Age 3-4;Sex Male","[Table 1; Cell 12] Age 3-4;Sex Female","[Table 1; Cell 13] Age 5-9;","[Table 1; Cell 14] Age 5-9;Sex Male","[Table 1; Cell 15] Age 5-9;Sex Female","[Table 1; Cell 16] Age 10-11;","[Table 1; Cell 17] Age 10-11;Sex Male","[Table 1; Cell 18] Age 10-11;Sex Female","[Table 1; Cell 19] Age 12-14;","[Table 1; Cell 20] Age 12-14;Sex Male","[Table 1; Cell 21] Age 12-14;Sex Female","[Table 1; Cell 22] Age 15;","[Table 1; Cell 23] Age 15;Sex Male","[Table 1; Cell 24] Age 15;Sex Female","[Table 1; Cell 25] Age 16-17;","[Table 1; Cell 26] Age 16-17;Sex Male","[Table 1; Cell 27] Age 16-17;Sex Female","[Table 1; Cell 28] Age 18-19;","[Table 1; Cell 29] Age 18-19;Sex Male","[Table 1; Cell 30] Age 18-19;Sex Female","[Table 1; Cell 31] Age 20-24;","[Table 1; Cell 32] Age 20-24;Sex Male","[Table 1; Cell 33] Age 20-24;Sex Female","[Table 1; Cell 34] Age 25-29;","[Table 1; Cell 35] Age 25-29;Sex Male","[Table 1; Cell 36] Age 25-29;Sex Female","[Table 1; Cell 37] Age 30-34;","[Table 1; Cell 38] Age 30-34;Sex Male","[Table 1; Cell 39] Age 30-34;Sex Female","[Table 1; Cell 40] Age 35-39;","[Table 1; Cell 41] Age 35-39;Sex Male","[Table 1; Cell 42] Age 35-39;Sex Female","[Table 1; Cell 43] Age 40-44;","[Table 1; Cell 44] Age 40-44;Sex Male","[Table 1; Cell 45] Age 40-44;Sex Female","[Table 1; Cell 46] Age 45-49;","[Table 1; Cell 47] Age 45-49;Sex Male","[Table 1; Cell 48] Age 45-49;Sex Female","[Table 1; Cell 49] Age 50-54;","[Table 1; Cell 50] Age 50-54;Sex Male","[Table 1; Cell 51] Age 50-54;Sex Female","[Table 1; Cell 52] Age 55-59;","[Table 1; Cell 53] Age 55-59;Sex Male","[Table 1; Cell 54] Age 55-59;Sex Female","[Table 1; Cell 55] Age 60-64;","[Table 1; Cell 56] Age 60-64;Sex Male","[Table 1; Cell 57] Age 60-64;Sex Female","[Table 1; Cell 58] Age 65-69;","[Table 1; Cell 59] Age 65-69;Sex Male","[Table 1; Cell 60] Age 65-69;Sex Female","[Table 1; Cell 61] Age 70-74;","[Table 1; Cell 62] Age 70-74;Sex Male","[Table 1; Cell 63] Age 70-74;Sex Female","[Table 1; Cell 64] Age 75-79;","[Table 1; Cell 65] Age 75-79;Sex Male","[Table 1; Cell 66] Age 75-79;Sex Female","[Table 1; Cell 67] Age 80-84;","[Table 1; Cell 68] Age 80-84;Sex Male","[Table 1; Cell 69] Age 80-84;Sex Female","[Table 1; Cell 70] Age 85-89;","[Table 1; Cell 71] Age 85-89;Sex Male","[Table 1; Cell 72] Age 85-89;Sex Female","[Table 1; Cell 73] Age 90+;","[Table 1; Cell 74] Age 90+;Sex Male","[Table 1; Cell 75] Age 90+;Sex Female" "City of London","City of London",154,71,83,0,0,0,7,3,4,0,0,0,4,0,4,3,3,0,0,0,0,0,0,0,0,0,0,3,3,0,15,9,6,23,7,16,16,7,9,18,7,11,18,12,6,13,4,9,19,10,9,3,3,0,6,3,3,0,0,0,3,0,3,3,0,3,0,0,0,0,0,0,0,0,0 Need a LUT for District Name to LAD Code
 void runTest()
           
 void updateCountsForStudyRegions(java.util.Set<java.lang.String> regionIDs, int decimalPlaces, java.math.RoundingMode roundingMode)
          Aggregates counts to sum all counts from the rest of the UK.
protected  void writeAndUpdateCounts(java.lang.String name, java.lang.String originRegionID, java.lang.String destinationRegionID, GENESIS_Population pop)
           
protected  void writeAndUpdateCounts(java.lang.String name, java.lang.String originRegionID, java.lang.String destinationRegionID, java.lang.String originSubregionID, java.lang.String destinationSubregionID, GENESIS_Population counts)
           
protected  void writeAndUpdateRates(java.lang.String name, java.lang.String originRegionID, java.lang.String destinationRegionID, GENESIS_Population counts, GENESIS_Population rates)
           
 void writeRegionCountSummaries(java.lang.String originRegionID, java.lang.String destinationRegionID)
           
 void writeRegionRateSummaries(java.lang.String originRegionID, java.lang.String destinationRegionID)
           
 void writeSubregionCountSummaries(java.lang.String originRegionID, java.lang.String destinationRegionID, java.lang.String originSubregionID, java.lang.String destinationSubregionID)
           
 void writeSubregionRateSummaries(java.lang.String originRegionID, java.lang.String destinationRegionID, java.lang.String originSubregionID, java.lang.String destinationSubregionID)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_GENESIS_Environment

public transient GENESIS_Environment _GENESIS_Environment

RestOfUK_String

public static final java.lang.String RestOfUK_String
See Also:
Constant Field Values

RestOfTheWorld_String

public static final java.lang.String RestOfTheWorld_String
See Also:
Constant Field Values

regionToRegionMigration

public java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> regionToRegionMigration
For storing the population migrating from each region to each region. The keys are destination region regionIDs, the value keys are origin region regionIDs.


regionInMigration

public java.util.TreeMap<java.lang.String,GENESIS_Population> regionInMigration
For storing the population migrating into each region in the study region. The keys are regionIDs, the values are population counts. The count include internal migration as stored in regionInternalMigration


regionOutMigration

public java.util.TreeMap<java.lang.String,GENESIS_Population> regionOutMigration
For storing the population migrating out from each region in the study region. Currently, there is no data for emigration. The keys are regionIDs, the values are population counts.


regionInternalMigration

public java.util.TreeMap<java.lang.String,GENESIS_Population> regionInternalMigration
For storing the population immigrating into each region in the study region. The keys are regionIDs, the values are population counts.


regionImmigration

public java.util.TreeMap<java.lang.String,GENESIS_Population> regionImmigration
For storing the population immigrating into each region in the study region. The keys are regionIDs, the values are population counts.


subregionInMigration

public java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> subregionInMigration
For storing the population migrating into each subregion in a region. The keys are destination region regionIDs, value keys are subregion destination subregionIDs, value values are population counts.


subregionOutMigration

public java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> subregionOutMigration
For storing the population migrating out of each subregion in a region. The keys are origin region regionIDs, value keys are subregion origin subregionIDs, value values are population counts.


subregionInternalInMigration

public java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> subregionInternalInMigration
For storing the population migrating internally within each region. The keys are origin/destination region regionIDs, value keys are subregion destination subregionIDs, value values are population counts.


subregionInternalOutMigration

public java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> subregionInternalOutMigration
For storing the population migrating internally within each region. The keys are origin/destination region regionIDs, value keys are subregion origin subregionIDs, value values are population counts.


regionInMigrationRates

public java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> regionInMigrationRates
For storing the daily gender age migration rates for people migrating into a specific region. The keys are the regionIDs for the destination regions. The keys of the values are the origin region IDs where the migrants have migrated from. The rates are derived from regionToRegionMigration but only include rates for destination regions within the study region.


regionOutMigrationRates

public java.util.TreeMap<java.lang.String,GENESIS_Population> regionOutMigrationRates
For storing the daily gender age migration rates for people moving from a specific region (internal migration included). The keys are regionIDs, the values are probabilities specified by gender and age.


immigrationRates

public java.util.TreeMap<java.lang.String,GENESIS_Population> immigrationRates
For storing the daily gender and age specific immigration rates for people immigrating into a specific region. The keys are destination region regionIDs, the values are population counts.


cumulativeSumRescaledRegionOutMigration

public java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> cumulativeSumRescaledRegionOutMigration
For those migrating from a region this gives a way to assign the expected region destination (which may be the same). Keys are origin region region IDs. Value keys are region destination regionIDs, value values are the cumulative sum rescaled populations.


cumulativeSumRescaledSubregionInMigration

public java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> cumulativeSumRescaledSubregionInMigration
For those migrating into a region this gives a way to assign a subregion destination. Keys are destination region region IDs. Value keys are subregion destination subregionIDs, value values are the cumulative sum rescaled populations.

Constructor Detail

GENESIS_Migration

public GENESIS_Migration()

GENESIS_Migration

public GENESIS_Migration(GENESIS_Environment a_GENESIS_Environment)

GENESIS_Migration

public GENESIS_Migration(GENESIS_Environment a_GENESIS_Environment,
                         GENESIS_Migration a_GENESIS_Migration)
Method Detail

init

public final void init()
The keys are LAD areaIDs, the values are a TreeMap with keys being specific Gender_Age


main

public static void main(java.lang.String[] args)

run

public void run()

runTest

public void runTest()

runFormatData

public void runFormatData()
"Origin geography: UK interaction data districts 2001","Destination geography: UK interaction data districts 2001" "Geography",,"Interaction data",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "Origins","Destinations","2001 SMS Level 1",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, "UK interaction data districts 2001","UK interaction data districts 2001","[Table 1; Cell 1] Total;","[Table 1; Cell 2] Total;Sex Male","[Table 1; Cell 3] Total;Sex Female","[Table 1; Cell 4] Age 0;","[Table 1; Cell 5] Age 0;Sex Male","[Table 1; Cell 6] Age 0;Sex Female","[Table 1; Cell 7] Age 1-2;","[Table 1; Cell 8] Age 1-2;Sex Male","[Table 1; Cell 9] Age 1-2;Sex Female","[Table 1; Cell 10] Age 3-4;","[Table 1; Cell 11] Age 3-4;Sex Male","[Table 1; Cell 12] Age 3-4;Sex Female","[Table 1; Cell 13] Age 5-9;","[Table 1; Cell 14] Age 5-9;Sex Male","[Table 1; Cell 15] Age 5-9;Sex Female","[Table 1; Cell 16] Age 10-11;","[Table 1; Cell 17] Age 10-11;Sex Male","[Table 1; Cell 18] Age 10-11;Sex Female","[Table 1; Cell 19] Age 12-14;","[Table 1; Cell 20] Age 12-14;Sex Male","[Table 1; Cell 21] Age 12-14;Sex Female","[Table 1; Cell 22] Age 15;","[Table 1; Cell 23] Age 15;Sex Male","[Table 1; Cell 24] Age 15;Sex Female","[Table 1; Cell 25] Age 16-17;","[Table 1; Cell 26] Age 16-17;Sex Male","[Table 1; Cell 27] Age 16-17;Sex Female","[Table 1; Cell 28] Age 18-19;","[Table 1; Cell 29] Age 18-19;Sex Male","[Table 1; Cell 30] Age 18-19;Sex Female","[Table 1; Cell 31] Age 20-24;","[Table 1; Cell 32] Age 20-24;Sex Male","[Table 1; Cell 33] Age 20-24;Sex Female","[Table 1; Cell 34] Age 25-29;","[Table 1; Cell 35] Age 25-29;Sex Male","[Table 1; Cell 36] Age 25-29;Sex Female","[Table 1; Cell 37] Age 30-34;","[Table 1; Cell 38] Age 30-34;Sex Male","[Table 1; Cell 39] Age 30-34;Sex Female","[Table 1; Cell 40] Age 35-39;","[Table 1; Cell 41] Age 35-39;Sex Male","[Table 1; Cell 42] Age 35-39;Sex Female","[Table 1; Cell 43] Age 40-44;","[Table 1; Cell 44] Age 40-44;Sex Male","[Table 1; Cell 45] Age 40-44;Sex Female","[Table 1; Cell 46] Age 45-49;","[Table 1; Cell 47] Age 45-49;Sex Male","[Table 1; Cell 48] Age 45-49;Sex Female","[Table 1; Cell 49] Age 50-54;","[Table 1; Cell 50] Age 50-54;Sex Male","[Table 1; Cell 51] Age 50-54;Sex Female","[Table 1; Cell 52] Age 55-59;","[Table 1; Cell 53] Age 55-59;Sex Male","[Table 1; Cell 54] Age 55-59;Sex Female","[Table 1; Cell 55] Age 60-64;","[Table 1; Cell 56] Age 60-64;Sex Male","[Table 1; Cell 57] Age 60-64;Sex Female","[Table 1; Cell 58] Age 65-69;","[Table 1; Cell 59] Age 65-69;Sex Male","[Table 1; Cell 60] Age 65-69;Sex Female","[Table 1; Cell 61] Age 70-74;","[Table 1; Cell 62] Age 70-74;Sex Male","[Table 1; Cell 63] Age 70-74;Sex Female","[Table 1; Cell 64] Age 75-79;","[Table 1; Cell 65] Age 75-79;Sex Male","[Table 1; Cell 66] Age 75-79;Sex Female","[Table 1; Cell 67] Age 80-84;","[Table 1; Cell 68] Age 80-84;Sex Male","[Table 1; Cell 69] Age 80-84;Sex Female","[Table 1; Cell 70] Age 85-89;","[Table 1; Cell 71] Age 85-89;Sex Male","[Table 1; Cell 72] Age 85-89;Sex Female","[Table 1; Cell 73] Age 90+;","[Table 1; Cell 74] Age 90+;Sex Male","[Table 1; Cell 75] Age 90+;Sex Female" "City of London","City of London",154,71,83,0,0,0,7,3,4,0,0,0,4,0,4,3,3,0,0,0,0,0,0,0,0,0,0,3,3,0,15,9,6,23,7,16,16,7,9,18,7,11,18,12,6,13,4,9,19,10,9,3,3,0,6,3,3,0,0,0,3,0,3,3,0,3,0,0,0,0,0,0,0,0,0 Need a LUT for District Name to LAD Code


writeRegionRateSummaries

public void writeRegionRateSummaries(java.lang.String originRegionID,
                                     java.lang.String destinationRegionID)

writeSubregionRateSummaries

public void writeSubregionRateSummaries(java.lang.String originRegionID,
                                        java.lang.String destinationRegionID,
                                        java.lang.String originSubregionID,
                                        java.lang.String destinationSubregionID)

writeRegionCountSummaries

public void writeRegionCountSummaries(java.lang.String originRegionID,
                                      java.lang.String destinationRegionID)

writeAndUpdateCounts

protected void writeAndUpdateCounts(java.lang.String name,
                                    java.lang.String originRegionID,
                                    java.lang.String destinationRegionID,
                                    GENESIS_Population pop)

writeAndUpdateRates

protected void writeAndUpdateRates(java.lang.String name,
                                   java.lang.String originRegionID,
                                   java.lang.String destinationRegionID,
                                   GENESIS_Population counts,
                                   GENESIS_Population rates)

writeAndUpdateCounts

protected void writeAndUpdateCounts(java.lang.String name,
                                    java.lang.String originRegionID,
                                    java.lang.String destinationRegionID,
                                    java.lang.String originSubregionID,
                                    java.lang.String destinationSubregionID,
                                    GENESIS_Population counts)

writeSubregionCountSummaries

public void writeSubregionCountSummaries(java.lang.String originRegionID,
                                         java.lang.String destinationRegionID,
                                         java.lang.String originSubregionID,
                                         java.lang.String destinationSubregionID)

loadLUT

public java.lang.Object[] loadLUT(java.io.File directory,
                                  java.lang.String filename)

readRegionMigrationData

public void readRegionMigrationData(java.io.File directory,
                                    java.lang.String filename)
read LAD migration data

Parameters:
directory -
filename -
nameToCodeLUT -

readSubregionMigrationData

public void readSubregionMigrationData(java.io.File directory,
                                       java.lang.String filename)
Output Area migration data 223059,95ZZ160008,223018,95ZZ100007,3,0,3,0,0,0,3,0,3,0,0,0 OriginZoneID, OriginZoneCode, DestinationZoneID, DestinationZoneCode, 12 Fields: 1 = Total all ages; 2 = Total male; 3 = Total female; 4 = Total age 0-15; 5 = Male 0-15; 6 = Female 0-15; 7 = Total 16-PensionableAge; 8 = Male 16-PensionableAge; 9 = Female 16-PensionableAge; 10 = Total PensionableAge+; 11 = Male PensionableAge+; 12 = Female PensionableAge+

Parameters:
directory -
filename -
nameToCodeLUT -

addToPop

protected void addToPop(GENESIS_Population population,
                        java.lang.String[] fields,
                        GENESIS_AgeBound ageBoundZeroToSixteen,
                        GENESIS_AgeBound ageBoundSixteenToPension,
                        GENESIS_AgeBound ageBoundPensionPlus)

processCounts

public void processCounts(java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> population,
                          java.math.BigDecimal migrationFactor,
                          java.math.BigDecimal migrationMinimum)
For converting counts to daily probabilities and rates. There are several types of rates/probabilities. For each subregion there are: 1) out migration probabilities for migration within all regions in the study region; 2) out migration probabilities for migration to all other regions in the UK; 3) in migration rates for regionImmigration; 4) in migration rates for migration from other regions of the UK outwith the study region. For each region there are: 1) out migration probabilities for migration within all regions in the study and to all other regions in the UK grouped together; 2) in migration rates from all other regions in the UK grouped together; 3) regionImmigration rates.

Parameters:
population -
migrationFactor - A number by which all inter regional migration counts are multiplied before being added to migrationMinimum in calculating migration destination probabilities.
migrationMinimum -

updateCountsForStudyRegions

public void updateCountsForStudyRegions(java.util.Set<java.lang.String> regionIDs,
                                        int decimalPlaces,
                                        java.math.RoundingMode roundingMode)
Aggregates counts to sum all counts from the rest of the UK.

Parameters:
population -
rescale -

rescale

public void rescale(java.util.TreeMap<java.lang.String,java.util.TreeMap<java.lang.String,GENESIS_Population>> map,
                    int decimalPlaces,
                    java.math.RoundingMode roundingMode)

getOutMigrationRegionDestination

public java.lang.String getOutMigrationRegionDestination(GENESIS_Female female,
                                                         java.lang.String originRegionID,
                                                         int decimalPlaces,
                                                         java.util.Random random)
Untested

Parameters:
originRegionID -
Returns:

getInternalMigrationSubregionDestinationFromStudyRegion

public java.lang.String getInternalMigrationSubregionDestinationFromStudyRegion(GENESIS_Female female,
                                                                                java.lang.String destinationRegionID,
                                                                                int decimalPlaces,
                                                                                java.util.Random random)
For in migration to the region given by destinationRegionID, this method returns a subregionID for the subregion that the female is assigned as migrating to.

Parameters:
female -
destinationRegionID -
decimalPlaces -
random -
Returns:

getInternalMigrationSubregionDestinationFromStudyRegionFemale

public java.lang.String getInternalMigrationSubregionDestinationFromStudyRegionFemale(GENESIS_AgeBound ageBound,
                                                                                      java.lang.String destinationRegionID,
                                                                                      int decimalPlaces,
                                                                                      java.util.Random random)
For in migration to the region given by destinationRegionID, this method returns a subregionID for the subregion that a female with an age in the given ageBound is assigned as migrating to.

Parameters:
ageBound -
destinationRegionID -
decimalPlaces -
random -
Returns:

getInternalMigrationSubregionDestinationFromStudyRegion

public java.lang.String getInternalMigrationSubregionDestinationFromStudyRegion(GENESIS_Male male,
                                                                                java.lang.String destinationRegionID,
                                                                                int decimalPlaces,
                                                                                java.util.Random random)
For internal migration within the study region. The destination region is given by destinationRegionID. This method returns a subregionID for the assigned subregion that a female with an age in the given ageBound is migrating to.

Parameters:
male -
destinationRegionID -
decimalPlaces -
random -
Returns:

getInternalMigrationSubregionDestinationFromStudyRegionMale

public java.lang.String getInternalMigrationSubregionDestinationFromStudyRegionMale(GENESIS_AgeBound ageBound,
                                                                                    java.lang.String destinationRegionID,
                                                                                    int decimalPlaces,
                                                                                    java.util.Random random)
For internal migration within the study region. The destination region is given by destinationRegionID. This method returns a subregionID for the assigned subregion that a male with an age in the given ageBound is migrating to.

Parameters:
ageInYears -
ageBound -
destinationRegionID -
decimalPlaces -
random -
Returns:

getInternalMigrationSubregionDestinationFromRestOfWorldFemale

public java.lang.String getInternalMigrationSubregionDestinationFromRestOfWorldFemale(GENESIS_AgeBound ageBound,
                                                                                      java.lang.String destinationRegionID,
                                                                                      int decimalPlaces,
                                                                                      java.util.Random random)

getInternalMigrationSubregionDestinationFromRestOfWorldMale

public java.lang.String getInternalMigrationSubregionDestinationFromRestOfWorldMale(GENESIS_AgeBound ageBound,
                                                                                    java.lang.String destinationRegionID,
                                                                                    int decimalPlaces,
                                                                                    java.util.Random random)

getInternalMigrationSubregionDestinationFromRestOfUKFemale

public java.lang.String getInternalMigrationSubregionDestinationFromRestOfUKFemale(GENESIS_AgeBound ageBound,
                                                                                   java.lang.String destinationRegionID,
                                                                                   int decimalPlaces,
                                                                                   java.util.Random random)
For migration to a region in the study region from the rest of the UK. The destination region is given by destinationRegionID. This method returns a subregionID allocation which the person is assigned as migrating to.

Parameters:
female -
destinationRegionID -
decimalPlaces -
random -
Returns:

getInternalMigrationSubregionDestinationFromRestOfUKMale

public java.lang.String getInternalMigrationSubregionDestinationFromRestOfUKMale(GENESIS_AgeBound ageBound,
                                                                                 java.lang.String destinationRegionID,
                                                                                 int decimalPlaces,
                                                                                 java.util.Random random)
For migration to a region in the study region from the rest of the UK. The destination region is given by destinationRegionID. This method returns a subregionID allocation which the person is assigned as migrating to.

Parameters:
male -
destinationRegionID -
decimalPlaces -
random -
Returns:

getOutMigrationRegionDestination

public java.lang.String getOutMigrationRegionDestination(GENESIS_Male male,
                                                         java.lang.String originRegionID,
                                                         int decimalPlaces,
                                                         java.util.Random random)
Untested

Parameters:
originRegionID -
Returns:

getDailyOutMigrationProbability

public java.math.BigDecimal getDailyOutMigrationProbability(GENESIS_Female female,
                                                            GENESIS_AgeBound ageBound)

getDailyOutMigrationProbability

public java.math.BigDecimal getDailyOutMigrationProbability(GENESIS_Male male,
                                                            GENESIS_AgeBound ageBound)

getDailyInternalMigrationRate

public java.math.BigDecimal getDailyInternalMigrationRate(GENESIS_Female female,
                                                          GENESIS_AgeBound ageBound,
                                                          java.math.BigDecimal pop,
                                                          int decimalPlaces,
                                                          java.math.RoundingMode roundingMode)

getDailyInternalMigrationRate

public java.math.BigDecimal getDailyInternalMigrationRate(GENESIS_Male male,
                                                          GENESIS_AgeBound ageBound,
                                                          java.math.BigDecimal pop,
                                                          int decimalPlaces,
                                                          java.math.RoundingMode roundingMode)

getDailyInMigrationRate

public GENESIS_Population getDailyInMigrationRate(java.lang.String regionID)

getDailyImmigrationRate

public GENESIS_Population getDailyImmigrationRate(java.lang.String regionID)