uk.ac.leeds.ccg.andyt.projects.moses.process
Class GeneticAlgorithm_ISARHP_ISARCEP

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.projects.moses.process.GeneticAlgorithm
      extended by uk.ac.leeds.ccg.andyt.projects.moses.process.GeneticAlgorithm_ISARHP_ISARCEP

public class GeneticAlgorithm_ISARHP_ISARCEP
extends GeneticAlgorithm


Field Summary
 
Fields inherited from class uk.ac.leeds.ccg.andyt.projects.moses.process.GeneticAlgorithm
_CASDataRecord, _CASKS002DataRecord, _ConvergenceThreshold, _FitnessCounts, _IndividualCensus, _InitialPopulationSize, _MaxNumberOfMutationsPerChild, _MaxNumberOfMutationsPerParent, _MaxNumberOfSolutions, _NumberOfOptimisationIterations, _Random, _RandomSeed
 
Constructor Summary
GeneticAlgorithm_ISARHP_ISARCEP(CASDataRecord aCASDataRecord)
          Creates a new instance of GeneticAlgorithm
GeneticAlgorithm_ISARHP_ISARCEP(IndividualCensus_ISARHP_ISARCEP _IndividualCensus_ISARHP_ISARCEP, CASDataRecord _CASDataRecord)
          Creates a new instance of GeneticAlgorithm
 
Method Summary
protected static void addToCountsCEP(ISARDataRecord aISARDataRecord, java.util.HashMap tSARCounts, java.util.Random a_Random)
          aISARDataRecord does not comprise part of Household Population
protected static void addToCountsHP(ISARDataRecord aISARDataRecord, java.util.HashMap tSARCounts, java.util.Random a_Random)
          ISARDataRecord aISARDataRecord is assumed to comprise part of Household Population
 void exchangeCEPISARDataRecords(java.util.HashMap tCEP_Age_Vector_HashMap, java.util.Vector tCEP_Vector, java.util.HashSet dataRecordsIndexesToSwapHashSet)
          Exchanges some ISARDataRecords in tCEP_Age_Vector_HashMap ensuring constraints are met.
 void exchangeHPHRPISARDataRecords(java.util.HashMap tHPHRP_Age_Vector_HashMap, java.util.Vector tHPHRP_Vector, java.util.HashSet dataRecordsIndexesToSwapHashSet)
          Exchanges some ISARDataRecords in tHPHRP_AgeSexType_Vector_HashMap ensuring constraints are met.
 void exchangeHPNonHRPISARDataRecords(java.util.Vector tHPNonHRP_Vector, java.util.HashSet dataRecordsIndexesToSwapHashSet)
          Exchanges some ISARDataRecords in tHPNonHRP_Vector.
 java.math.BigDecimal getFitness(java.lang.Object[] tConstraintsAndPopulation_ISARHP_ISARCEP)
           
 java.lang.Object[] getFitnessCounts()
           
static java.lang.Object[] getFitnessCounts(CASDataRecord a_CASDataRecord)
           
 java.lang.Object[] getOptimisedResult_ObjectArray()
           
 java.lang.Object[] getOptimisedResult_ObjectArray(java.util.TreeMap existingSolutions_TreeMap)
           
static java.util.Vector<java.lang.String> getVariableList()
           
static java.lang.String[] getVariables()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneticAlgorithm_ISARHP_ISARCEP

public GeneticAlgorithm_ISARHP_ISARCEP(CASDataRecord aCASDataRecord)
Creates a new instance of GeneticAlgorithm


GeneticAlgorithm_ISARHP_ISARCEP

public GeneticAlgorithm_ISARHP_ISARCEP(IndividualCensus_ISARHP_ISARCEP _IndividualCensus_ISARHP_ISARCEP,
                                       CASDataRecord _CASDataRecord)
Creates a new instance of GeneticAlgorithm

Method Detail

getOptimisedResult_ObjectArray

public java.lang.Object[] getOptimisedResult_ObjectArray()
Returns:
Object[] result: result[0] tConstraintsAndPopulation_ISARHP_ISARCEP: tConstraintsAndPopulation_ISARHP_ISARCEP[0] constraints: constraints[0] = constraintCAS003HPHRPAgeFemaleCount_HashMap; constraints[1] = constraintCAS003HPHRPAgeMaleCount_HashMap; constraints[2] = constraintCAS001CEPAgeFemaleCount3_HashMap; constraints[3] = constraintCAS001CEPAgeMaleCount3_HashMap; tConstraintsAndPopulation_ISARHP_ISARCEP[2] population: population[0] = tHPHRPFemale_Age_Vector_HashMap; population[1] = tHPHRPFemale_Vector; population[2] = tHPHRPMale_Age_Vector_HashMap; population[3] = tHPHRPMale_Vector; population[4] = tHPNon-HRP_Vector; population[5] = tCEPFemale_Age_Vector_HashMap; population[6] = tCEPFemale_Vector; population[7] = tCEPMale_Age_Vector_HashMap; population[8] = tCEPMale_Vector; result[1] BigDecimal fitness

getOptimisedResult_ObjectArray

public java.lang.Object[] getOptimisedResult_ObjectArray(java.util.TreeMap existingSolutions_TreeMap)
Parameters:
existingSolutions_TreeMap - A TreeMap of solutions in the same format as what is returned.
Returns:
Object[] result: result[0] tConstraintsAndPopulation_ISARHP_ISARCEP: tConstraintsAndPopulation_ISARHP_ISARCEP[0] constraints: constraints[0] = constraintCAS003HPHRPAgeFemaleCount_HashMap; constraints[1] = constraintCAS003HPHRPAgeMaleCount_HashMap; constraints[2] = constraintCAS001CEPAgeFemaleCount3_HashMap; constraints[3] = constraintCAS001CEPAgeMaleCount3_HashMap; tConstraintsAndPopulation_ISARHP_ISARCEP[2] population: population[0] = tHPHRPFemale_Age_Vector_HashMap; population[1] = tHPHRPFemale_Vector; population[2] = tHPHRPMale_Age_Vector_HashMap; population[3] = tHPHRPMale_Vector; population[4] = tHPNon-HRP_Vector; population[5] = tCEPFemale_Age_Vector_HashMap; population[6] = tCEPFemale_Vector; population[7] = tCEPMale_Age_Vector_HashMap; population[8] = tCEPMale_Vector; result[1] BigDecimal fitness

exchangeCEPISARDataRecords

public void exchangeCEPISARDataRecords(java.util.HashMap tCEP_Age_Vector_HashMap,
                                       java.util.Vector tCEP_Vector,
                                       java.util.HashSet dataRecordsIndexesToSwapHashSet)
Exchanges some ISARDataRecords in tCEP_Age_Vector_HashMap ensuring constraints are met.


exchangeHPNonHRPISARDataRecords

public void exchangeHPNonHRPISARDataRecords(java.util.Vector tHPNonHRP_Vector,
                                            java.util.HashSet dataRecordsIndexesToSwapHashSet)
Exchanges some ISARDataRecords in tHPNonHRP_Vector. Only constraint is to return the correct number of males and females.


exchangeHPHRPISARDataRecords

public void exchangeHPHRPISARDataRecords(java.util.HashMap tHPHRP_Age_Vector_HashMap,
                                         java.util.Vector tHPHRP_Vector,
                                         java.util.HashSet dataRecordsIndexesToSwapHashSet)
Exchanges some ISARDataRecords in tHPHRP_AgeSexType_Vector_HashMap ensuring constraints are met.


getFitness

public java.math.BigDecimal getFitness(java.lang.Object[] tConstraintsAndPopulation_ISARHP_ISARCEP)
Parameters:
tConstraintsAndPopulation_ISARHP_ISARCEP - An Object[]: tConstraintsAndPopulation_ISARHP_ISARCEP[0] constraints: constraints[0] = constraintCAS003HPHRPAgeFemaleCount_HashMap; constraints[1] = constraintCAS003HPHRPAgeMaleCount_HashMap; constraints[2] = constraintCAS001CEPAgeFemaleCount3_HashMap; constraints[3] = constraintCAS001CEPAgeMaleCount3_HashMap; tConstraintsAndPopulation_ISARHP_ISARCEP[2] population: population[0] = tHPHRPFemale_AgeSexType_Vector_HashMap; population[1] = tHPHRPFemale_Vector; population[2] = tHPHRPMale_AgeSexType_Vector_HashMap; population[3] = tHPHRPMale_Vector; population[4] = tHPNonHRP_Vector; population[5] = tCEPFemale_AgeSexType_Vector_HashMap; population[6] = tCEPFemale_Vector; population[7] = tCEPMale_AgeSexType_Vector_HashMap; population[8] = tCEPMale_Vector;
Returns:
A BigDecimal indicating goodness of fit. This is a sum of the sum of squared difference between CASDataRecord values and estimated aggregate measures. The lower the number returned the better the fit.

addToCountsCEP

protected static void addToCountsCEP(ISARDataRecord aISARDataRecord,
                                     java.util.HashMap tSARCounts,
                                     java.util.Random a_Random)
aISARDataRecord does not comprise part of Household Population

Parameters:
aISARDataRecord - The ISARDataRecord to be accounted for in tSARCounts
tSARCounts - A HashMap of Aggregate Counts

addToCountsHP

protected static void addToCountsHP(ISARDataRecord aISARDataRecord,
                                    java.util.HashMap tSARCounts,
                                    java.util.Random a_Random)
ISARDataRecord aISARDataRecord is assumed to comprise part of Household Population

Parameters:
aISARDataRecord - The ISARDataRecord that will be accounted for in tSARCounts
tSARCounts - HashMap of aggregate counts.

getFitnessCounts

public static java.lang.Object[] getFitnessCounts(CASDataRecord a_CASDataRecord)
Returns:
Object[] tFitnessCounts: tFitnessCounts[0] is a HashMap where; keys are Strings Keys with values derived from CAS001: malesAge0to4 malesAge5to9 malesAge10to14 malesAge15to19 malesAge20to24 malesAge25to29 malesAge30to34 malesAge35to39 malesAge40to44 malesAge45to49 malesAge50to54 malesAge55to59 malesAge60to64 malesAge65to69 malesAge70to74 malesAge75to79 malesAge80AndOver femalesAge0to4 femalesAge5to9 femalesAge10to14 femalesAge15to19 femalesAge20to24 femalesAge25to29 femalesAge30to34 femalesAge35to39 femalesAge40to44 femalesAge45to49 femalesAge50to54 femalesAge55to59 femalesAge60to64 femalesAge65to69 femalesAge70to74 femalesAge75to79 femalesAge80AndOver Keys with values derived from CAS002: malesMarriedAge0to15 malesMarriedAge16to19 malesMarriedAge20to24 malesMarriedAge25to29 malesMarriedAge30to34 malesMarriedAge35to39 malesMarriedAge40to44 malesMarriedAge45to49 malesMarriedAge50to54 malesMarriedAge55to59 malesMarriedAge60to64 malesMarriedAge65to74 malesMarriedAge75to79 malesMarriedAge80AndOver femalesMarriedAge0to15 femalesMarriedAge16to19 femalesMarriedAge20to24 femalesMarriedAge25to29 femalesMarriedAge30to34 femalesMarriedAge35to39 femalesMarriedAge40to44 femalesMarriedAge45to49 femalesMarriedAge50to54 femalesMarriedAge55to59 femalesMarriedAge60to64 femalesMarriedAge65to74 femalesMarriedAge75to79 femalesMarriedAge80AndOver Keys with values derived from CASKS008 peopleWhoseGeneralHealthWasGood peopleWhoseGeneralHealthWasFairlyGood peopleWhoseGeneralHealthWasNotGood peopleWithLimitingLongTermIllness Keys with values derived from CASKS020DataRecord oneFamilyAndNoChildren marriedOrCohabitingCoupleWithChildren loneParentHouseholdsWithChildren Keys with values derived from CASKS09bDataRecord malesAge16to24Unemployed malesAge16to74 malesAge16to74EconomicallyActiveEmployedFullTime malesAge16to74EconomicallyActiveEmployedPartTime malesAge16to74EconomicallyActiveSelfEmployed malesAge16to74EconomicallyActiveUnemployed malesAge16to74EconomicallyInactiveRetired malesAge16to74EconomicallyInactivePermanentlySickOrDisabled malesAge16to74EconomicallyInactiveLookingAfterHomeOrFamily malesAge50AndOverUnemployed Keys with values derived from CASKS09cDataRecord femalesAge16to24Unemployed femalesAge16to74 femalesAge16to74EconomicallyActiveEmployedFullTime femalesAge16to74EconomicallyActiveEmployedPartTime femalesAge16to74EconomicallyActiveSelfEmployed femalesAge16to74EconomicallyActiveUnemployed femalesAge16to74EconomicallyInactiveRetired femalesAge16to74EconomicallyInactivePermanentlySickOrDisabled femalesAge16to74EconomicallyInactiveLookingAfterHomeOrFamily femalesAge50AndOverUnemployed tFitnessCounts[1] is a HashMap where; keys are Strings as in tFitnessCounts[0] values are all 0.

getFitnessCounts

public java.lang.Object[] getFitnessCounts()

getVariables

public static java.lang.String[] getVariables()

getVariableList

public static java.util.Vector<java.lang.String> getVariableList()