units
Class Household

java.lang.Object
  extended by units.Household

public class Household
extends java.lang.Object

Class representing a household in the population.


Field Summary
private  java.util.ArrayList<Agent> adults
          Adults in the household
private  java.util.ArrayList<Agent> applicants
          Applicants for piecework jobs
private  boolean bereaved
          this indicates that there was at least one death this month /tick we'll see how we pay for it after we get the income, support from the funeral club and if possible, from the extended family
private  java.util.ArrayList<Agent> children
          Children in the household
private  Church church
          Church of which the household is the members
private  int churchID
          Church Id of which the household is the members
private  java.util.ArrayList<Couple> coupleList
          List of married couples in the household
private  java.util.ArrayList<Agent> currentMembers
          List of current members in the household
private  int currentMembersOnMigration
          Households members on migration
private  int defaultFuneralClubCount
          number of funeral club memberships
private  java.util.HashMap<java.lang.Integer,Employee> employees
          Employees maps for this household
private  java.util.ArrayList<java.lang.Integer> extendedFamilyIDList
          only maintains the household ID ...
private  FuneralClub funeralClub
          Funeral club of which the household is the members
private  Agent head
          Household head
private  boolean hungry
          Are household members hungry?
private  int id
          Household Id
private  boolean memberFuneralClub
          Is member of funeral club
private  java.util.ArrayList<Agent> members
          List of members in the household
private  Model model
           
private  boolean noGuardians
          Has guardians?
private  int numberAvailableJobs
          Number of available piecework jobs
private  java.util.ArrayList<Agent> seniors
          Seniors in the household
private  double wealth
          Household's current wealth
 
Constructor Summary
Household()
          Default constructor
Household(int _id, Model _model)
          Create household in simulation.
 
Method Summary
 Household accommodateNeighbour()
          Find a neighbour ..
 void accommodateNewMembers(Household household)
          Accommodate new members of the dissolved household
 Household accommodateRelative()
          this is for a household who happens to be a member of an extended family...
 double accumulateIncome()
          Accumulated incomes from the household members
 void addAgent(Agent agent)
          Add agent to household
 void addCouple(Couple couple)
          Add couple to this household
 void addFuneralWealth(double money)
          Add money from funeral contributions
 void addWealth(double money)
          Add money to the household wealth
 void allocateJob()
          Allocate jobs to applicants.
 boolean announceJobs()
          Announce piecework jobs
 void borrowFood()
          the underlying assumption is that there is at least one person in the household who has gone hungry ...
 void borrowFuneralCost(int cost)
          Borrow money for the funeral.
 Household chooseExtendedFamilyHousehold()
          according to the Oct 2007 validation trip by Gina and Tak, the women said that children are accommodated/taken care of by the family on the fathers' side - as they belong to the father's moiety.
 void deductClubsFee()
          Deducts (or supposed to deduct)the fee for the funeral club or savings club, the household is member of ...
 void deductEducationFee()
          FANRPAN Working Document: Series Ref.
 void deductFuneralCost()
          Deduct the expenditure for the funeral
 void deductHealthExpenditure()
          Deduct health expenditure
 void deductWealth(double money)
          deduct money from wealth
 void feed(int childFeedStatus, int seniorFeedStatus, int adultFeedStatus, java.util.ArrayList<Agent> adults)
          Feed the household members based on the decision to feed children, adults and seniors
 int feedHousehold()
          there's an underlying assumption, which is lightly supported by anecdotal accounts those members of the households on migration are not included in feeding ...
 int feedHouseholdWithoutFAO()
          Feed household members without the FAO recommendations
 int feedWithoutFarm()
          Feed household members without the farming
 FuneralClub findFuneralClub()
          now once decided to join a funeral club, we choose which one to join
 java.util.ArrayList<Agent> getAaplicants()
          Get applicants list for piecwork
 java.util.ArrayList<Agent> getAdults()
          Get household adults
 java.util.ArrayList<Agent> getChildren()
          Get household children
 Church getChurch()
          Get my church
 int getChurchID()
          Get my church Id
 java.util.ArrayList<Couple> getCoupleList()
          Get the couples list
 int getCurrentAdultMales()
          Get current adult members
 java.util.ArrayList<Agent> getCurrentMembers()
          Get my current members
 int getCurrentMembersOnLabor()
          Get current members on job/labor
 int getDefaultFuneralClubCount()
           
 java.util.HashMap<java.lang.Integer,Employee> getEmployee()
           
 java.util.ArrayList<java.lang.Integer> getExtendedFamilyIDList()
          Get list of extended family households Ids
 FuneralClub getFuneralClub()
          Get funeral club
 Agent getHead()
          Get household head
 int getId()
          Get Id
 java.util.ArrayList<Agent> getMembers()
          Get household members
 boolean getNoGuardians()
          Update the status that there are no guardians
 int getNumberAvailableJobs()
          Get number of available piecework jobs
 java.util.ArrayList<Agent> getSeniors()
          Get household seniors
 int getSize()
          Get household size
 double getWealth()
          Get household wealth
 boolean hasLebola()
          Can the household has the lobola
 void initialize()
          This an important method that assigns head, roles, wealth and other attributes ...
 boolean isBereaved()
          Am I bereaved
 boolean isHungry()
          Am I hungry
 boolean isKin(Agent agent)
          Is agent a kin to my household
 boolean isMemberFuneralClub()
          Is member of a funeral club
 boolean isNeighbour(Household relativeHousehold)
          Check if this is neighbor
 boolean isReliable(Agent agent)
          TODO: ...
 void makeChildrenOrphan(Agent agent)
          orphan means 'single OR double orphan'
 void populateExtendedFamily(Household husbandHousehold, Household wifeHousehold)
          We give this new hh its relatives following the Union of both husband and wife
 void printhouseholdComposition()
          Print my household composition
 void recruitEmployee(Agent agent)
          TODO: We could also increase some pay for those working for us regularly??
 void removeAgent(Agent agent)
          Removes the agent from the household
 void removeCouple(Agent agent)
          Removes the couple for this agent from the household
 void removeCouple(Couple couple)
          Remove couple from this household
 Household returnAccommodator()
          Return the best accommodator for my dissolved household
 HouseholdNode returnHouseholdNode()
          Return my node from the network GUI
 int returnRequirementFAO(Agent agent)
          Return the FAO Adult equivalence nutrition requirement for agent
 int returnRequirementFermi(Agent agent)
          Using a non-linear Fermi equation ...
 void setBereaved(boolean isBereaved)
          Set my bereaved flag
 void setChurch(Church church)
          Set my church
 void setChurchID(int churchID)
          Set my church ID
 void setCoupleList(java.util.ArrayList<Couple> coupleList)
          Set the couples list
 void setCurrentMembers(java.util.ArrayList<Agent> currentMembers)
          Set my current members
 void setDefaultFuneralClubCount(int defaultFuneralClubCount)
           
 void setExtendedFamilyIDList(java.util.ArrayList<java.lang.Integer> extendedFamilyID)
           
 void setFuneralClub(FuneralClub funeralClub)
          Set funeral club
 void setHead(Agent _head)
          Set household members
 void setHungry(boolean hungry)
          Set flag for hungry
 void setMemberFuneralClub(boolean _isMemberFuneralClub)
          Set if member of a funeral club
 void setWealth(double _wealth)
          Set household members
 void step()
          Main step for the household: accumulate income, feeds members and deducts expenditure
 void updateAgentAgeGroup(Agent agent, int ageGroup)
          Update members when age groups change
 boolean updateHead(Agent agent)
          Update household head
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

private int id
Household Id


head

private Agent head
Household head


children

private java.util.ArrayList<Agent> children
Children in the household


adults

private java.util.ArrayList<Agent> adults
Adults in the household


seniors

private java.util.ArrayList<Agent> seniors
Seniors in the household


members

private java.util.ArrayList<Agent> members
List of members in the household


extendedFamilyIDList

private java.util.ArrayList<java.lang.Integer> extendedFamilyIDList
only maintains the household ID ... we fetch the household from the household map in the Model


coupleList

private java.util.ArrayList<Couple> coupleList
List of married couples in the household


currentMembers

private java.util.ArrayList<Agent> currentMembers
List of current members in the household


model

private Model model

funeralClub

private FuneralClub funeralClub
Funeral club of which the household is the members


church

private Church church
Church of which the household is the members


churchID

private int churchID
Church Id of which the household is the members


noGuardians

private boolean noGuardians
Has guardians?


currentMembersOnMigration

private int currentMembersOnMigration
Households members on migration


memberFuneralClub

private boolean memberFuneralClub
Is member of funeral club


defaultFuneralClubCount

private int defaultFuneralClubCount
number of funeral club memberships


wealth

private double wealth
Household's current wealth


employees

private java.util.HashMap<java.lang.Integer,Employee> employees
Employees maps for this household


applicants

private java.util.ArrayList<Agent> applicants
Applicants for piecework jobs


numberAvailableJobs

private int numberAvailableJobs
Number of available piecework jobs


bereaved

private boolean bereaved
this indicates that there was at least one death this month /tick we'll see how we pay for it after we get the income, support from the funeral club and if possible, from the extended family


hungry

private boolean hungry
Are household members hungry?

Constructor Detail

Household

public Household()
Default constructor


Household

public Household(int _id,
                 Model _model)
Create household in simulation.

Method Detail

getId

public int getId()
Get Id


initialize

public void initialize()
This an important method that assigns head, roles, wealth and other attributes ... depending upon the logic


addAgent

public void addAgent(Agent agent)
Add agent to household


removeAgent

public void removeAgent(Agent agent)
Removes the agent from the household


removeCouple

public void removeCouple(Agent agent)
Removes the couple for this agent from the household


deductFuneralCost

public void deductFuneralCost()
Deduct the expenditure for the funeral


borrowFuneralCost

public void borrowFuneralCost(int cost)
Borrow money for the funeral.

Parameters:
cost -

makeChildrenOrphan

public void makeChildrenOrphan(Agent agent)
orphan means 'single OR double orphan'


updateAgentAgeGroup

public void updateAgentAgeGroup(Agent agent,
                                int ageGroup)
Update members when age groups change


getMembers

public java.util.ArrayList<Agent> getMembers()
Get household members


getSize

public int getSize()
Get household size


getWealth

public double getWealth()
Get household wealth


setWealth

public void setWealth(double _wealth)
Set household members

Parameters:
_wealth -

getChildren

public java.util.ArrayList<Agent> getChildren()
Get household children


getAdults

public java.util.ArrayList<Agent> getAdults()
Get household adults


getSeniors

public java.util.ArrayList<Agent> getSeniors()
Get household seniors


getHead

public Agent getHead()
Get household head


setHead

public void setHead(Agent _head)
Set household members

Parameters:
_head -

step

public void step()
Main step for the household: accumulate income, feeds members and deducts expenditure


deductEducationFee

public void deductEducationFee()
FANRPAN Working Document: Series Ref. Number: NAT SAA005 IMPACT OF HIV & AIDS ON AGRICULTURE AND FOOD SECURITY: THE CASE OF LIMPOPO PROVINCE IN SOUTH AFRICA 2006


deductHealthExpenditure

public void deductHealthExpenditure()
Deduct health expenditure


feedHouseholdWithoutFAO

public int feedHouseholdWithoutFAO()
Feed household members without the FAO recommendations


feedWithoutFarm

public int feedWithoutFarm()
Feed household members without the farming


feedHousehold

public int feedHousehold()
there's an underlying assumption, which is lightly supported by anecdotal accounts those members of the households on migration are not included in feeding ... this could be a sensitive assumption ... however, let it be like that.


feed

public void feed(int childFeedStatus,
                 int seniorFeedStatus,
                 int adultFeedStatus,
                 java.util.ArrayList<Agent> adults)
Feed the household members based on the decision to feed children, adults and seniors

Parameters:
childFeedStatus -
seniorFeedStatus -
adultFeedStatus -
adults -

returnRequirementFAO

public int returnRequirementFAO(Agent agent)
Return the FAO Adult equivalence nutrition requirement for agent

Parameters:
agent -
Returns:

deductClubsFee

public void deductClubsFee()
Deducts (or supposed to deduct)the fee for the funeral club or savings club, the household is member of ... the membership is annual here ... so every month, some money is accumulated in the fund for clubs ... if there's no money at a moment, the household may get money out of it ... this may force a household to pull out of a savings club


accumulateIncome

public double accumulateIncome()
Accumulated incomes from the household members

Returns:

updateHead

public boolean updateHead(Agent agent)
Update household head


getNoGuardians

public boolean getNoGuardians()
Update the status that there are no guardians


addFuneralWealth

public void addFuneralWealth(double money)
Add money from funeral contributions

Parameters:
money -

addWealth

public void addWealth(double money)
Add money to the household wealth

Parameters:
money -

deductWealth

public void deductWealth(double money)
deduct money from wealth

Parameters:
money -

accommodateNeighbour

public Household accommodateNeighbour()
Find a neighbour .. in future we would like to give preference to those to whom we have stronger/multiple ties


getFuneralClub

public FuneralClub getFuneralClub()
Get funeral club


setFuneralClub

public void setFuneralClub(FuneralClub funeralClub)
Set funeral club


isMemberFuneralClub

public boolean isMemberFuneralClub()
Is member of a funeral club


setMemberFuneralClub

public void setMemberFuneralClub(boolean _isMemberFuneralClub)
Set if member of a funeral club


findFuneralClub

public FuneralClub findFuneralClub()
now once decided to join a funeral club, we choose which one to join


getDefaultFuneralClubCount

public int getDefaultFuneralClubCount()

setDefaultFuneralClubCount

public void setDefaultFuneralClubCount(int defaultFuneralClubCount)

getCurrentMembersOnLabor

public int getCurrentMembersOnLabor()
Get current members on job/labor


getCurrentAdultMales

public int getCurrentAdultMales()
Get current adult members


accommodateNewMembers

public void accommodateNewMembers(Household household)
Accommodate new members of the dissolved household

Parameters:
household -

addCouple

public void addCouple(Couple couple)
Add couple to this household

Parameters:
couple -

removeCouple

public void removeCouple(Couple couple)
Remove couple from this household

Parameters:
couple -

getCoupleList

public java.util.ArrayList<Couple> getCoupleList()
Get the couples list


setCoupleList

public void setCoupleList(java.util.ArrayList<Couple> coupleList)
Set the couples list

Parameters:
coupleList -

getExtendedFamilyIDList

public java.util.ArrayList<java.lang.Integer> getExtendedFamilyIDList()
Get list of extended family households Ids

Returns:

accommodateRelative

public Household accommodateRelative()
this is for a household who happens to be a member of an extended family... we first check if - any adult sibling is alive and married of the children - otherwise, we will look for grandParents households - otherwise we will look for maternal aunts, - otherwise anyone from the extened family in the village - else return nil.


chooseExtendedFamilyHousehold

public Household chooseExtendedFamilyHousehold()
according to the Oct 2007 validation trip by Gina and Tak, the women said that children are accommodated/taken care of by the family on the fathers' side - as they belong to the father's moiety. choose the household which is best suited to accomodate this household's ... currently, we choose randomly, but then we need better logics here .. It is actually implemented in here - as we're only adding the mother's hh to our extended-family list and nothing more.


isNeighbour

public boolean isNeighbour(Household relativeHousehold)
Check if this is neighbor

Parameters:
relativeHousehold -
Returns:

populateExtendedFamily

public void populateExtendedFamily(Household husbandHousehold,
                                   Household wifeHousehold)
We give this new hh its relatives following the Union of both husband and wife

Parameters:
husbandHousehold -
wifeHousehold -

setExtendedFamilyIDList

public void setExtendedFamilyIDList(java.util.ArrayList<java.lang.Integer> extendedFamilyID)

returnRequirementFermi

public int returnRequirementFermi(Agent agent)
Using a non-linear Fermi equation ...


returnAccommodator

public Household returnAccommodator()
Return the best accommodator for my dissolved household

Returns:

printhouseholdComposition

public void printhouseholdComposition()
Print my household composition


isBereaved

public boolean isBereaved()
Am I bereaved

Returns:

setBereaved

public void setBereaved(boolean isBereaved)
Set my bereaved flag

Parameters:
isBereaved -

returnHouseholdNode

public HouseholdNode returnHouseholdNode()
Return my node from the network GUI

Returns:

hasLebola

public boolean hasLebola()
Can the household has the lobola

Returns:

getChurch

public Church getChurch()
Get my church

Returns:

setChurch

public void setChurch(Church church)
Set my church

Parameters:
church -

announceJobs

public boolean announceJobs()
Announce piecework jobs

Returns:

getAaplicants

public java.util.ArrayList<Agent> getAaplicants()
Get applicants list for piecwork

Returns:

getNumberAvailableJobs

public int getNumberAvailableJobs()
Get number of available piecework jobs

Returns:

allocateJob

public void allocateJob()
Allocate jobs to applicants.


isKin

public boolean isKin(Agent agent)
Is agent a kin to my household

Parameters:
agent -
Returns:

isReliable

public boolean isReliable(Agent agent)
TODO: ... IS A STUBS


recruitEmployee

public void recruitEmployee(Agent agent)
TODO: We could also increase some pay for those working for us regularly??


borrowFood

public void borrowFood()
the underlying assumption is that there is at least one person in the household who has gone hungry ... most likely, an adult or a senior...or an entire household


getEmployee

public java.util.HashMap<java.lang.Integer,Employee> getEmployee()

isHungry

public boolean isHungry()
Am I hungry

Returns:

setHungry

public void setHungry(boolean hungry)
Set flag for hungry

Parameters:
hungry -

getCurrentMembers

public java.util.ArrayList<Agent> getCurrentMembers()
Get my current members

Returns:

setCurrentMembers

public void setCurrentMembers(java.util.ArrayList<Agent> currentMembers)
Set my current members

Parameters:
currentMembers -

getChurchID

public int getChurchID()
Get my church Id

Returns:

setChurchID

public void setChurchID(int churchID)
Set my church ID

Parameters:
churchID -