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

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
Direct Known Subclasses:
IndividualCensus_HSARHP_ISARCEP, IndividualCensus_ISARHP_ISARCEP

public abstract class IndividualCensus
extends AbstractLog

Abstract class


Field Summary
 java.lang.String _Area
          Stores the Area being computed, this is usually usedin filenames.
protected  CASDataHandler _CASDataHandler
          Reference to the CASDataHandler for handling CASDataRecords
 java.lang.String _CASLevel
          Stores the _CASLevel "OA" or "" is for Output Area "MSOA" is for Middle Layer Super Output Area "Ward" is for Ward "LAD" is for Local Authority District
 java.io.File _Directory
          Stores the base of file input/output
 GeneticAlgorithm _GeneticAlgorithm
          This at minimum stores the fields for: _InitialPopulationSize; _MaxNumberOfSolutions; _ConvergenceThreshold; _MaxNumberOfMutationsPerChild; _MaxNumberOfMutationsPerParent; _NumberOfOptimisationIterations;
protected  java.util.HashSet _IncludedVariablesHashSet
          Reference to the CASDataHandler for handling CASDataRecords
protected  java.io.File _Input_File
          Reference to the File for reading Input
protected  ISARDataHandler _ISARDataHandler
          For holding a reference to the AbstractISARDataHandler
protected  long _LongNumberOfHSARDataRecords
          Stores the number of HSARDataRecords as a long
protected  long _LongNumberOfISARDataRecords
          Stores the number of ISARDataRecords as a long
protected  java.io.File _Output_File_0
          Reference to the File for storing Output0
protected  java.io.File _Output_File_1
          Reference to the File for storing Output1
 java.io.File _OutputDirectory
          Stores the output directory where the results are written
 java.lang.String _OutputDirectory_Name
          Deprecated. 
 java.lang.String _OutputName
          Stores part of the name of the output file where the results are written
protected  java.util.HashMap _Population_HashMap
          A HashMap for storing population where: Each key is a String - first 4 digits of _ZoneCode; Each value is another HashMap where: Each key is the String _ZoneCode; Each value is an Object[] _Pop where: _Pop[ 0 ] is a Vector of _Household Population Household Reference Person Household SAR RecordIDs; _Pop[ 1 ] is a Vector of _Communal Establishment Population Individual SAR RecordIDs
protected  long _StartTime
          Stores the start time of the processing.
protected  ToyModelDataHandler _ToyModelDataHandler
          Reference to the ToyModelDataHandler for handling Toy Model data
protected  java.util.HashMap _ZoneCode_StartRecordID_EndRecordID_HashMap
          Each key is a String and each value a long[2] keys are Census Area Codes values are _StartRecordID_EndRecordID
protected  java.util.TreeSet _ZoneCodeSubstring_TreeSet
          A HashSet for storing a list of what are probably LAD codes.
 
Fields inherited from class uk.ac.leeds.ccg.andyt.projects.moses.utilities.AbstractLog
_Logger, _Logger_FileHandler
 
Constructor Summary
IndividualCensus()
           
 
Method Summary
 AbstractCASDataHandler get_CASDataHandler()
          For returning the _CASDataHandler to be used
 java.util.HashMap get_RecordID_ZoneCode_HashMap()
           
 java.util.HashMap get_RecordID_ZoneCode_HashMap(long _StartRecordID, long _EndRecordID)
           
 long[] get_StartRecordID_EndRecordID(java.lang.String _ZoneCode)
          Find _StartRecordID and _EndRecordID for _LADCode
 java.util.HashSet get_UK_OA_ID_HashSet()
           
 java.util.HashMap get_ZoneCode_RecordID_HashMap(long _StartRecordID, long _EndRecordID)
           
 java.lang.Object[] getGeneralPopulationContraints()
           
 java.lang.Object[] getGeneralPopulationContraints(long _StartRecordID, long _EndRecordID)
           
 void init_CASDataHandler(java.io.File directory, java.lang.String tCASLevel)
          Initialises _CASDataHandler
 java.util.HashSet init_IncludedVariablesHashSet()
          Initialise this._IncludedVariablesHashSet (if not already initialised), then returns this._IncludedVariablesHashSet.
abstract  void init_ISARDataHandler(java.io.File directory)
          Initialises _ISARDataHandler and _LongNumberOfISARDataRecords.
 void init_Population_HashMap()
           
 void init_ToyModelDataHandler(java.io.File aFile)
          Initialises _ToyModelDataHandler
 void init_ZoneCode_StartRecordID_EndRecordID_HashMap()
           
 void init_ZoneCodeSubstring_TreeSet()
          Initialises this._ZoneCode_substring_HashSet
 void init()
          For initialisation of this
protected  void initLogFile()
           
protected  void initLogFile(int log_int)
           
protected  void initLogFile(java.util.logging.Level aLevel)
           
protected  void initLogFile(java.util.logging.Level aLevel, int log_int)
           
protected  boolean initOutputFiles()
           
 void load_Population_HashMap()
           
 java.lang.Object[] loadGeneralPopulationContraints()
           
 void output_Population_HashMap()
           
 java.lang.String 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
 

Field Detail

_GeneticAlgorithm

public GeneticAlgorithm _GeneticAlgorithm
This at minimum stores the fields for: _InitialPopulationSize; _MaxNumberOfSolutions; _ConvergenceThreshold; _MaxNumberOfMutationsPerChild; _MaxNumberOfMutationsPerParent; _NumberOfOptimisationIterations;


_Directory

public java.io.File _Directory
Stores the base of file input/output


_Area

public java.lang.String _Area
Stores the Area being computed, this is usually usedin filenames. Often used examples include "UK" and "Leeds"


_CASLevel

public java.lang.String _CASLevel
Stores the _CASLevel "OA" or "" is for Output Area "MSOA" is for Middle Layer Super Output Area "Ward" is for Ward "LAD" is for Local Authority District


_OutputDirectory

public java.io.File _OutputDirectory
Stores the output directory where the results are written


_OutputDirectory_Name

@Deprecated
public java.lang.String _OutputDirectory_Name
Deprecated. 
Stores the output directory name where the results are written


_OutputName

public java.lang.String _OutputName
Stores part of the name of the output file where the results are written


_Output_File_0

protected java.io.File _Output_File_0
Reference to the File for storing Output0


_Output_File_1

protected java.io.File _Output_File_1
Reference to the File for storing Output1


_ToyModelDataHandler

protected ToyModelDataHandler _ToyModelDataHandler
Reference to the ToyModelDataHandler for handling Toy Model data


_Input_File

protected java.io.File _Input_File
Reference to the File for reading Input


_StartTime

protected long _StartTime
Stores the start time of the processing.


_ISARDataHandler

protected ISARDataHandler _ISARDataHandler
For holding a reference to the AbstractISARDataHandler


_LongNumberOfISARDataRecords

protected long _LongNumberOfISARDataRecords
Stores the number of ISARDataRecords as a long


_LongNumberOfHSARDataRecords

protected long _LongNumberOfHSARDataRecords
Stores the number of HSARDataRecords as a long


_CASDataHandler

protected CASDataHandler _CASDataHandler
Reference to the CASDataHandler for handling CASDataRecords


_IncludedVariablesHashSet

protected java.util.HashSet _IncludedVariablesHashSet
Reference to the CASDataHandler for handling CASDataRecords


_ZoneCodeSubstring_TreeSet

protected java.util.TreeSet _ZoneCodeSubstring_TreeSet
A HashSet for storing a list of what are probably LAD codes. These are the first 4 characters in the string _ZoneCode.


_Population_HashMap

protected java.util.HashMap _Population_HashMap
A HashMap for storing population where: Each key is a String - first 4 digits of _ZoneCode; Each value is another HashMap where: Each key is the String _ZoneCode; Each value is an Object[] _Pop where: _Pop[ 0 ] is a Vector of _Household Population Household Reference Person Household SAR RecordIDs; _Pop[ 1 ] is a Vector of _Communal Establishment Population Individual SAR RecordIDs


_ZoneCode_StartRecordID_EndRecordID_HashMap

protected java.util.HashMap _ZoneCode_StartRecordID_EndRecordID_HashMap
Each key is a String and each value a long[2] keys are Census Area Codes values are _StartRecordID_EndRecordID

Constructor Detail

IndividualCensus

public IndividualCensus()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

init

public void init()
For initialisation of this


initLogFile

protected void initLogFile()

initLogFile

protected void initLogFile(java.util.logging.Level aLevel)

initLogFile

protected void initLogFile(int log_int)

initLogFile

protected void initLogFile(java.util.logging.Level aLevel,
                           int log_int)

initOutputFiles

protected boolean initOutputFiles()

get_CASDataHandler

public AbstractCASDataHandler get_CASDataHandler()
For returning the _CASDataHandler to be used


init_IncludedVariablesHashSet

public java.util.HashSet init_IncludedVariablesHashSet()
Initialise this._IncludedVariablesHashSet (if not already initialised), then returns this._IncludedVariablesHashSet.

Returns:
_IncludedVariablesHashSet

init_CASDataHandler

public void init_CASDataHandler(java.io.File directory,
                                java.lang.String tCASLevel)
Initialises _CASDataHandler

Parameters:
directory - The directory in which input data reside.
tCASLevel - The aggregate level of input data ("" for OA, "MSOA" for MSOA)

init_ISARDataHandler

public abstract void init_ISARDataHandler(java.io.File directory)
                                   throws java.io.IOException
Initialises _ISARDataHandler and _LongNumberOfISARDataRecords.

Parameters:
directory - The directory in which input data reside.
Throws:
java.io.IOException

init_ToyModelDataHandler

public void init_ToyModelDataHandler(java.io.File aFile)
Initialises _ToyModelDataHandler

Parameters:
aFile - File for storing results.

loadGeneralPopulationContraints

public java.lang.Object[] loadGeneralPopulationContraints()
Returns:
Object[] _GeneralPopulationContraints: _GeneralPopulationContraints[0] is a HashMap _ZoneCode_AllHouseholdsTotal_HashMap with keys as String Zone_Code and values being Integer counts of Total Household Population from the respective CAS003DataRecord. (Number of Households) _GeneralPopulationContraints[1] is a HashMap _ZoneCode_CommunalEstablishmentPopulation_HashMap with keys as String Zone_Code and values being Integer counts of Total Communal Establishment Population from the respective CAS001DataRecord.

getGeneralPopulationContraints

public java.lang.Object[] getGeneralPopulationContraints()
Returns:
Object[] _Result where: _Result[ 0 ] is a HashMap of _ZoneCode_AllHouseholdsTotal_HashMap (Number of Households) _Result[ 1 ] is a HashMap of _ZoneCode_CommunalEstablishmentPopulation_HashMap (Population in Communal Establishments)

getGeneralPopulationContraints

public java.lang.Object[] getGeneralPopulationContraints(long _StartRecordID,
                                                         long _EndRecordID)
Returns:
Object[] _GeneralPopulationContraints: _GeneralPopulationContraints[0] is a HashMap _ZoneCode_AllHouseholdsTotal_HashMap with keys as String Zone_Code and values being Integer counts of Total Household Population from the respective CAS003DataRecord. (Number of Households) _GeneralPopulationContraints[1] is a HashMap _ZoneCode_CommunalEstablishmentPopulation_HashMap with keys as String Zone_Code and values being Integer counts of Total Communal Establishment Population from the respective CAS001DataRecord.

init_ZoneCodeSubstring_TreeSet

public void init_ZoneCodeSubstring_TreeSet()
Initialises this._ZoneCode_substring_HashSet


init_Population_HashMap

public void init_Population_HashMap()

get_UK_OA_ID_HashSet

public java.util.HashSet get_UK_OA_ID_HashSet()
                                       throws java.io.IOException
Throws:
java.io.IOException

get_RecordID_ZoneCode_HashMap

public java.util.HashMap get_RecordID_ZoneCode_HashMap()
Returns:
HashMap of RecordID keys and ZoneCode values where each key is entered as a long and each value is a String.

get_RecordID_ZoneCode_HashMap

public java.util.HashMap get_RecordID_ZoneCode_HashMap(long _StartRecordID,
                                                       long _EndRecordID)
Returns:
HashMap of RecordID keys and ZoneCode values where each key is entered as a long and each value is a String.

get_ZoneCode_RecordID_HashMap

public java.util.HashMap get_ZoneCode_RecordID_HashMap(long _StartRecordID,
                                                       long _EndRecordID)
                                                throws java.io.IOException
Returns:
HashMap of ZoneCode keys and RecordID values
Throws:
java.io.IOException

init_ZoneCode_StartRecordID_EndRecordID_HashMap

public void init_ZoneCode_StartRecordID_EndRecordID_HashMap()

get_StartRecordID_EndRecordID

public long[] get_StartRecordID_EndRecordID(java.lang.String _ZoneCode)
Find _StartRecordID and _EndRecordID for _LADCode


output_Population_HashMap

public void output_Population_HashMap()

load_Population_HashMap

public void load_Population_HashMap()