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

java.lang.Object
  extended by uk.ac.leeds.ccg.andyt.projects.moses.utilities.AbstractLog
      extended by uk.ac.leeds.ccg.andyt.projects.moses.process.IndividualCensus
          extended by uk.ac.leeds.ccg.andyt.projects.moses.process.IndividualCensus_ISARHP_ISARCEP
              extended by uk.ac.leeds.ccg.andyt.projects.moses.process.IndividualCensus_ISARHP_ISARCEP_PC

public class IndividualCensus_ISARHP_ISARCEP_PC
extends IndividualCensus_ISARHP_ISARCEP

Class for creating an individual census using sampling with replacement. The Household Population (HP) is comprised from ISARDataRecords. The Communal Establishment Population (CEP) is comprised from ISARDataRecords. The main method is for invoking on an individual PC and reads and writes files from a single directory as specified in a configuration file along with other parameters. JVM Options: -Xmx1200m This ensures there is a minimum sufficient memory. Additional requirements: At least 15GB Disk for a full UK run. This is with the default logging level, and default output formats. More disk may be needed for finer logging levels depending on how much optimisation is done. Running this class requires a configuration file which can be specified via the argument passed into the main method. Either an existing solution is re-optimised or a new solution is generated from scratch. Which is attempted depends on the configuration file. The configuration file is a text file of which the first 10 lines are as follows (quotation marks are not expected, they are added here for clarity along with a brief explanation of each parameter): line 1: A workspace directory (e.g. "C:/Workspace/") line 2: A Local Authority District (LAD) Code (e.g. "00DA") or a region code (e.g. "00D"), or "UK" in which case all LAD in the UK are processed. line 3: Output Level (e.g. "OA") (Currently only OA for Output Areas is supported.) Lines 4,5,6,7,8 and 9 are integer (int) Genetic Algorithm parameters: Line 4: _InitialPopulationSize the initial population size for an optimisation (NB. This has to be 1 or more. The larger this is, the slower the first part of the optimisation will be and the more resources will be required. A value greater than 100 is not advised and a suggested value is 10.) Line 5: _NumberOfOptimisationIterations the number of optimisation iterations of an optimisation Line 6: _MaxNumberOfSolutions the maximum number of solutions stored during an optimisation. (NB. This has to be 1 or more. The larger this is, the slower the optimisation will be and the more resources will be required. A value greater than 100 is not advised and a suggested value is 10.) Line 7: _ConvergenceThreshold the convergence threshold used during an optimisation. If after this many iterations around the optimisation loop no better solution is found, the program breaks out of the optimisation loop. (NB. Sensibly this is greater than 1 and less than 100) Line 8: _MaxNumberOfMutationsPerChild the maximum number of mutations or changes per child used during an optimisation Line 9: _MaxNumberOfMutationsPerParent the maximum number of mutations or changes per parent used during an optimisation Line 10: _RandomSeed the seed for random number generation. Line 11: A String name to be used to specify the top level output directory. Line 12: The abstract file location of a file which is a result previously generated output file in the form of a Serialized HashMap. It is expected this is called population_HashMap.thisFile. If the file specified exists, it is reloaded and used as an initial population for re-optimising. The HP is created in 4 parts: Household Reference Persons (HRP) for females, HRP for males, non-HRP for females, non-HRP for males. The CEP is created in 2 parts: female, males. Each of these parts of the population are control constrained: The HRP HP are constrained for each gender using age classes (0,20,30,60) as in CAS003; The non-HRP HP are constrained for each gender for household resident count as in CAS001 (the total HRP HP for each gender is taken from the CAS001 count); The CEP are constrained for each gender using age classes (0,16,20,25,30,45,60,65,70,75,80,85,90). By default all CEP have the expected ISARDataRecord.get_RELTOHR() type. However, where necessary other such types are used.


Field Summary
 
Fields inherited from class uk.ac.leeds.ccg.andyt.projects.moses.process.IndividualCensus
_Area, _CASDataHandler, _CASLevel, _Directory, _GeneticAlgorithm, _IncludedVariablesHashSet, _Input_File, _ISARDataHandler, _LongNumberOfHSARDataRecords, _LongNumberOfISARDataRecords, _Output_File_0, _Output_File_1, _OutputDirectory, _OutputDirectory_Name, _OutputName, _Population_HashMap, _StartTime, _ToyModelDataHandler, _ZoneCode_StartRecordID_EndRecordID_HashMap, _ZoneCodeSubstring_TreeSet
 
Fields inherited from class uk.ac.leeds.ccg.andyt.projects.moses.utilities.AbstractLog
_Logger, _Logger_FileHandler
 
Constructor Summary
IndividualCensus_ISARHP_ISARCEP_PC()
           
IndividualCensus_ISARHP_ISARCEP_PC(java.io.File _Input_Parameter_File)
           
 
Method Summary
 void initialOptimise()
           
static void main(java.lang.String[] args)
           
 void reloadAndOptimise()
           
 void run(java.lang.String[] args)
          Top level control for controlling which type of run is performed and setting parameters.
 
Methods inherited from class uk.ac.leeds.ccg.andyt.projects.moses.process.IndividualCensus_ISARHP_ISARCEP
getConstraints_ISARHP_ISARCEP, getConstraintsAndPopulation_ISARHP_ISARCEP, init_ISARDataHandler, init, init, write_ISARHP_ISARCEP
 
Methods inherited from class uk.ac.leeds.ccg.andyt.projects.moses.process.IndividualCensus
get_CASDataHandler, get_RecordID_ZoneCode_HashMap, get_RecordID_ZoneCode_HashMap, get_StartRecordID_EndRecordID, get_UK_OA_ID_HashSet, get_ZoneCode_RecordID_HashMap, getGeneralPopulationContraints, getGeneralPopulationContraints, init_CASDataHandler, init_IncludedVariablesHashSet, init_Population_HashMap, init_ToyModelDataHandler, init_ZoneCode_StartRecordID_EndRecordID_HashMap, init_ZoneCodeSubstring_TreeSet, init, initLogFile, initLogFile, initLogFile, initLogFile, initOutputFiles, load_Population_HashMap, loadGeneralPopulationContraints, output_Population_HashMap, toString
 
Methods inherited from class uk.ac.leeds.ccg.andyt.projects.moses.utilities.AbstractLog
init_Logger, init_Logger, init_Logger, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IndividualCensus_ISARHP_ISARCEP_PC

public IndividualCensus_ISARHP_ISARCEP_PC()

IndividualCensus_ISARHP_ISARCEP_PC

public IndividualCensus_ISARHP_ISARCEP_PC(java.io.File _Input_Parameter_File)
Method Detail

main

public static void main(java.lang.String[] args)
Parameters:
args - the command line arguments

run

public void run(java.lang.String[] args)
         throws java.io.IOException
Top level control for controlling which type of run is performed and setting parameters.

Throws:
java.io.IOException

initialOptimise

public void initialOptimise()
                     throws java.io.IOException
Throws:
java.io.IOException

reloadAndOptimise

public void reloadAndOptimise()
                       throws java.io.IOException
Throws:
java.io.IOException