|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuchicago.src.sim.engine.SimModelImpl
org.cfpm.caves.za.SouthAfricaModel
public class SouthAfricaModel
The model class.
Nested Class Summary | |
---|---|
class |
SouthAfricaModel.AgeDistributionRecorder
|
(package private) class |
SouthAfricaModel.EmpiricalDiscreteDist
This inner class defines a discrete distribution of empirical values, e.g. |
(package private) class |
SouthAfricaModel.EmpiricalDiscreteDistArray
An array of discrete distributions of empirical values. |
class |
SouthAfricaModel.FriendshipNetworkRecorder
|
class |
SouthAfricaModel.HHIncomeRecorder
|
class |
SouthAfricaModel.HHWealthDistRecorder
|
class |
SouthAfricaModel.HIVDeathRecorder
|
class |
SouthAfricaModel.HouseholdEconomyRecorder
|
class |
SouthAfricaModel.MinerSource
This inner class is a source of miners, i.e. |
class |
SouthAfricaModel.MiningRecorder
|
class |
SouthAfricaModel.PartnershipRecorder
|
class |
SouthAfricaModel.SexualNetworkRecorder
|
class |
SouthAfricaModel.StokvelRecorder
|
class |
SouthAfricaModel.VillageEconomyRecorder
|
(package private) class |
SouthAfricaModel.WHOLifeTable
This class represents a life table as produced by the WHO. |
Field Summary | |
---|---|
(package private) double |
adultEmploymentRate
model parameter: overall proportion of adults with a job. |
(package private) SouthAfricaModel.AgeDistributionRecorder |
ageDistRecorder
|
(package private) double |
birthRate
model parameter: birth rate as number of births per 1000 per year. |
(package private) double |
burialCost
model parameter: average cost of a burial. |
private static int |
CHILD
|
(package private) double |
childGrant
model parameter: monthly child grant for children under the age limit. |
(package private) int |
childGrantAgeLimit
model parameter: upper age limit for child grant. |
(package private) double |
childGrantProportion
model parameter: proportion of eligible children receiving the child grant. |
(package private) java.util.ArrayList<java.lang.String> |
chosenHH
|
(package private) double |
churchParticipationRate
model parameter: overall proportion of households being member of a church. |
(package private) double |
collegeFee
model parameter: yearly university fees. |
(package private) SouthAfricaModel.HIVDeathRecorder |
deathRecorder
|
(package private) double |
densityFactor
model parameter: density factor of villages. |
(package private) org.cfpm.caves.za.EndorsementDisposalPolicy |
disposalPolicy
Retracts facts when they become obsolete according to the specified filters ("disposal policies"). |
(package private) jess.Rete |
engine
the Jess engine |
(package private) SouthAfricaModel.WHOLifeTable |
femalesTable
|
(package private) double |
foodCostChild
model parameter: monthly food cost for a child up to 7 years. |
(package private) double |
foodCostFemaleAdult
model parameter: monthly food cost for a female. |
(package private) double |
foodCostMaleAdult
model parameter: monthly food cost for a male. |
(package private) org.cfpm.caves.za.MultiLayerNetwork2DDisplay |
friendNetwork
|
(package private) uchicago.src.sim.gui.DisplaySurface |
friendNetworkDisplay
|
(package private) SouthAfricaModel.FriendshipNetworkRecorder |
friendNetworkRecorder
|
(package private) double |
governmentEmploymentRate
model parameter: overall proportion of adults with a government job. |
private static int |
GRANDCHILD
|
(package private) int |
gridSizeX
model parameter: size (number of cells) of the 2D grid used as spatial model in x direction. |
(package private) int |
gridSizeY
model parameter: size (number of cells) of the 2D grid used as spatial model in y direction. |
(package private) SouthAfricaModel.HouseholdEconomyRecorder |
hhEconomyRecorder
|
(package private) SouthAfricaModel.HHIncomeRecorder |
hhIncomeRecorder
|
(package private) SouthAfricaModel.HHWealthDistRecorder |
hhWealthDistRecorder
|
(package private) int |
houseCost
model parameter: average cost for a new house in the village. |
(package private) java.util.ArrayList<org.cfpm.caves.za.Household> |
householdList
list of households |
(package private) double |
interArrivalTime
model parameter: mean inter-arrival time for in-migrating mine workers. |
(package private) org.cfpm.caves.za.FactBaseScourer |
jessLink
the class containing procedural functionality outsourced from Jess. |
(package private) org.cfpm.caves.za.MultiLayerNetwork2DDisplay |
kinshipNetwork
|
(package private) uchicago.src.sim.gui.DisplaySurface |
kinshipNetworkDisplay
|
(package private) int |
lowerMaxNumFriends
model parameter: lower limit for the maximal number of friends. |
(package private) int |
lowerMaxNumPartners
model parameter: lower limit for the maximal number of concurrent sexual partners. |
(package private) SouthAfricaModel.WHOLifeTable |
malesTable
|
(package private) double |
maxEndorsementBase
model parameter: maximum value for the base used to compute the overall endorsement value. |
(package private) int |
maxEndorsementClasses
model parameter: maximum number of endorsement classes. |
(package private) int |
maxLobola
model parameter: maximum lobola (bride price). |
(package private) int |
maxRemittance
model parameter: maximum remittance from a migrant agent. |
(package private) int |
maxShackRent
model parameter: upper bound of the monthly rent asked for a shack in the village. |
(package private) double |
maxTagEvolutionPropensity
model parameter: maximal tag evolution propensity. |
(package private) int |
meanAgeArrived
model parameter: mean age of in-migrants. |
(package private) int |
meanNumArrived
model parameter: mean number of in-migrants arriving in the area at one time. |
(package private) org.cfpm.caves.za.Mine |
mine
the mine |
(package private) double |
mineHIVPrevalence
model parameter: HIV prevalence amongst in-migrating mine workers. |
(package private) double |
minEndorsementBase
model parameter: minimum value for the base used to compute the overall endorsement value. |
(package private) int |
minEndorsementClasses
model parameter: minimum number of endorsement classes. |
(package private) SouthAfricaModel.MinerSource |
minerSource
the source of miners from outside the area |
(package private) SouthAfricaModel.MiningRecorder |
miningRecorder
|
(package private) int |
miningTick
model parameter: tick to start mining in the area. |
(package private) int |
minLobola
model parameter: minimum lobola (bride price). |
(package private) int |
minRemittance
model parameter: minimum remittance from a migrant agent. |
(package private) int |
minShackRent
model parameter: lower bound of the monthly rent asked for a shack in the village. |
(package private) double |
minTagEvolutionPropensity
model parameter: minimal tag evolution propensity. |
int |
month
|
(package private) uchicago.src.sim.analysis.LocalDataRecorder |
monthlyDataRecorder
|
(package private) double |
motherChildHIVTransmissionRate
model parameter: mother-to-child transmission rate of HIV. |
(package private) java.util.HashMap<java.lang.String,org.cfpm.caves.za.Household> |
nameHouseholdMap
data structure to map names to Household objects, helpful for the interface with Jess |
(package private) java.util.HashMap<java.lang.String,org.cfpm.caves.za.Person> |
namePersonMap
data structure to map names to Person objects, helpful for the interface with Jess |
(package private) java.util.HashMap<java.lang.String,org.cfpm.caves.za.Village> |
nameVillageMap
data structure to map names to Village objects, helpful for the interface with Jess |
(package private) int |
neededSkilled
model parameter: number of skilled workers needed for the mine. |
(package private) int |
neededUnskilled
model parameter: number of unskilled workers needed for the mine. |
(package private) double |
neighbourhoodRadius
model parameter: radius (number of cells) used to determine neighbourhood of a household. |
(package private) int[][] |
nextBirths
data structure to store the dates (week/month) of upcoming births at the beginning of a simulated year |
(package private) int |
numDenominations
model parameter: number of church denominations. |
(package private) int |
numHHAskingForFood
|
(package private) int |
numHHWithoutEnoughFood
|
(package private) int |
numHouseholds
model parameter: number of initial households. |
(package private) int |
numMiners
|
(package private) int |
numVillages
model parameter: number of villages. |
private static int |
OTHER
|
(package private) java.io.File |
outputFile
|
(package private) java.lang.String |
outputPath
model parameter: Path for the output directory. |
(package private) SouthAfricaModel.PartnershipRecorder |
partnershipRecorder
|
(package private) java.lang.String |
pathName
|
private java.beans.PropertyChangeSupport |
pcs
Necessary for the interface with Jess to make changes in the slots (fields) of shadow facts (Java objects) immediately visible in Jess. |
(package private) int |
pensionAgeLimitFemale
model parameter: lower age limit for female seniors to receive a state pension. |
(package private) int |
pensionAgeLimitMale
model parameter: lower age limit for male seniors to receive a state pension. |
(package private) double |
pensionProportionFemale
model parameter: proportion of female seniors >= 60 receiving a pension. |
(package private) double |
pensionProportionMale
model parameter: proportion of male seniors >= 65 receiving a pension. |
int |
personIndex
counter for person IDs |
(package private) java.util.ArrayList<org.cfpm.caves.za.Person> |
personList
list of agents (persons) |
(package private) java.io.PrintWriter |
printOut
|
(package private) boolean |
printToFile
model parameter: flag to turn the output to file on (true) or off (false). |
(package private) double |
randomPartnerProbability
model parameter: probability to encounter a random sexual partner. |
(package private) double |
remittanceProbability
model parameter: probability for sending remittance home for any migrant in any month. |
private uchicago.src.sim.engine.Schedule |
schedule
|
(package private) double |
schoolFee
model parameter: yearly school fee for non-compulsory secondary school (pupils > 15 years). |
(package private) int |
sdAgeArrived
model parameter: standard deviation of the age of in-migrants. |
(package private) int |
sdNumArrived
model parameter: standard deviation of the number of in-migrants. |
(package private) int |
seed
model parameter: seed for the random number generators. |
(package private) SouthAfricaModel.SexualNetworkRecorder |
sexualNetworkRecorder
|
(package private) double |
shackProportion
model parameter: proportion of households in the village with a shack to rent out if necessary. |
(package private) boolean |
showGUI
model parameter: flag to turn the GUI on (true) or off (false). |
(package private) boolean |
showOutput
model parameter: flag to turn the output to console on (true) or off (false). |
(package private) double |
similarityAgeRange
model parameter: age range for similarity assessment (basically, age range for friends) given as proportion of age of the agent. |
(package private) uchicago.src.sim.space.Object2DGrid |
space
the 2D grid used as a representation of space |
(package private) uchicago.src.sim.gui.DisplaySurface |
spaceDisplay
|
(package private) SouthAfricaModel.EmpiricalDiscreteDist |
stageDist
|
(package private) double |
standardWage
model parameter: monthly wage within village. |
(package private) double |
statePension
model parameter: monthly state pension for seniors. |
(package private) org.cfpm.caves.za.MultiLayerNetwork2DDisplay |
stokvelNetwork
|
(package private) uchicago.src.sim.gui.DisplaySurface |
stokvelNetworkDisplay
|
(package private) SouthAfricaModel.StokvelRecorder |
stokvelRecorder
|
(package private) int |
stopTime
model parameter: tick to stop the simulation run. |
(package private) int |
tagBase
model parameter: number of different values a tag can take (integers between 0 and tagBase - 1). |
(package private) int |
tagLength
model parameter: number of tags (= length of the tag array) used to model agents' characteristic traits. |
int |
tick
|
(package private) int |
upperMaxNumFriends
model parameter: upper limit for the maximal number of friends. |
(package private) int |
upperMaxNumPartners
model parameter: upper limit for the maximal number of concurrent sexual partners. |
(package private) SouthAfricaModel.VillageEconomyRecorder |
villageEconomyRecorder
|
int |
week
|
(package private) uchicago.src.sim.analysis.LocalDataRecorder |
weeklyDataRecorder
|
int |
year
|
Fields inherited from class uchicago.src.sim.engine.SimModelImpl |
---|
descriptors, modelManipulator |
Constructor Summary | |
---|---|
SouthAfricaModel()
|
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener p)
adds a property change listener (for Jess) |
private void |
adjustEducationLevel(org.cfpm.caves.za.Person p)
helper function for assignEducationLevels() |
private int |
ageClassIndexOf(int age,
int[] classes)
helper function for pickHIVPositives() |
boolean |
askChildGrantOracle(org.cfpm.caves.za.Person p)
Determines if the given person will receive a child grant. |
boolean |
askPensionOracle(org.cfpm.caves.za.Person p)
Determines if the given person will receive a pension. |
private void |
assignEducationLevels()
Initialisation related: assign initial education levels to agents according to RADAR data |
private void |
assignEmployments()
Initialisation related: choose some agents to be government employees |
void |
begin()
required by Repast: creates all model components and the schedule |
private void |
buildDisplay()
recommended by Repast: initialises the model GUI |
private void |
buildModel()
recommended by Repast: initialises the model |
jess.Value |
buildNewHouse(org.cfpm.caves.za.Person head)
Create a new household with the given person as head. |
private void |
buildSchedule()
recommended by Repast: creates the schedule |
double |
calculateClusterCoefficient()
calculates the cluster coefficient of the friend network applying the algorithm from Repast |
(package private) void |
calculateNextBirths()
Determines number and dates of births for the upcoming year |
(package private) void |
checkDeath()
Determines number and dates of deaths at the beginning of a year using the WHO life tables. |
(package private) void |
checkDeath(java.util.ArrayList<org.cfpm.caves.za.Person> ageGroup,
SouthAfricaModel.WHOLifeTable table)
helper function for checkDeath(): determines deaths for given age group according to given life table. |
(package private) void |
checkDeath(org.cfpm.caves.za.Person p)
Old version of checkDeath(). |
java.util.HashMap<java.lang.String,java.lang.String[]> |
compileSexualNetwork()
compiles the sexual network to be recorded |
private double |
computeDistance(java.util.ArrayList<org.cfpm.caves.za.NetworkNode> clusterA,
java.util.ArrayList<org.cfpm.caves.za.NetworkNode> clusterB,
double[][] distances)
helper method for determineClusters() |
private void |
createBurialSocieties()
Initialisation related: create some burial societies |
private void |
createChurches(int village,
int startIndex,
int endIndex)
Initialisation related: create churches for a given village and assign the village's households randomly to the churches. |
private void |
createFamilyLinks(org.cfpm.caves.za.Household hh,
org.cfpm.caves.za.Person[] members,
int[] memberType)
helper function for populateHouseholds() |
private void |
createFamilyLinks(org.cfpm.caves.za.Person baby,
org.cfpm.caves.za.Person mother,
org.cfpm.caves.za.Household household)
creates family links between new person and members of the household |
private org.cfpm.caves.za.Person |
createHouseholdMember(java.lang.String name,
org.cfpm.caves.za.Household hhold)
Creates a new member for the given household. |
private void |
createHouseholds()
Initialisation related: create households according to RADAR data |
private java.util.ArrayList<java.util.ArrayList<org.cfpm.caves.za.NetworkNode>> |
createKinshipNetwork()
Initialisation related: create the kinship network between households as a small-world network |
void |
createMine()
Initialisation related: create a mine and some mine workers from outside the village |
private void |
createNeighbourNetwork()
Initialisaiton related: create the neighbour network according to the households' position in space |
(package private) void |
createNewPerson()
Creates a new agent during simulation, i.e. |
private org.cfpm.caves.za.Village |
createVillage(java.lang.String name,
int numHouseholds,
java.util.ArrayList<org.cfpm.caves.za.Village> villages)
Initialisation related: creates a village for the given number of households and positions it in space. |
private java.util.ArrayList<java.util.ArrayList<org.cfpm.caves.za.NetworkNode>> |
determineClusters(java.util.List list)
Perform cluster analysis on kinship network: sort nodes (= households) into as many clusters as there are villages. |
private int[] |
determineVillageLocation(int radius,
java.util.ArrayList<org.cfpm.caves.za.Village> villages)
helper method for createVillage() |
void |
dump(java.lang.String text)
Output the given text to console (if showOutput is true) and/or trace file (if printToFile is true). |
private void |
endorseAllNeighbours(org.cfpm.caves.za.Person p,
org.cfpm.caves.za.Household hh)
helper function: assert neighbour endorsements for the given person and every member of the given household's neighbour households. |
void |
endorseKin(org.cfpm.caves.za.Household hh1,
org.cfpm.caves.za.Household hh2)
Assert kinship endorsements in Jess between the members of the given households. |
(package private) void |
endorseKin(org.cfpm.caves.za.Person baby)
Assert kinship endorsements in Jess for the given person (a newborn baby). |
(package private) void |
endorseNeighbours(org.cfpm.caves.za.Person p)
Assert neighbour endorsements in Jess for the given person (a newborn baby). |
void |
endorseNeighbours(org.cfpm.caves.za.Person p,
org.cfpm.caves.za.Household hh)
Assert neighbour endorsements in Jess for the given person (a miner renting a shack from the given household) |
void |
finalize()
closes trace file on finalisation of model object |
private java.util.ArrayList<jess.Value> |
findChurches(java.util.ArrayList<org.cfpm.caves.za.Person> list)
helper function for pickFriends |
private org.cfpm.caves.za.Household |
findHouseholdOf(org.cfpm.caves.za.NetworkNode node)
returns the household to a given network node |
private int |
findParent(org.cfpm.caves.za.Person[] members,
int[] type,
int childIndex)
helper function for createFamilyLinks() |
private java.util.ArrayList<org.cfpm.caves.za.Household> |
findRelatedHouseholds(org.cfpm.caves.za.Household hh,
java.util.ArrayList<org.cfpm.caves.za.Household> hhList)
helper function for createBurialSocieties() |
boolean |
fitForMarriage(java.lang.String male,
java.lang.String female)
checks if the specified agents are fit for marriage, i.e. |
jess.Value |
fitForMarriage(jess.Value male,
jess.Value female)
wrapper for the fitForMarriage method |
double |
getAdultEmploymentRate()
returns the adult employment rate |
double |
getAvgHHCash()
returns the average amount of cash over all households |
double |
getBirthRate()
returns the birth rate (number of births per 1000 persons in the population) |
double |
getBurialCost()
returns the average cost of a burial |
double |
getChildGrant()
returns the monthly child grant for children up to age 7 |
int |
getChildGrantAgeLimit()
returns the age limit for child grants. |
double |
getChildGrantProportion()
returns the proportion of children under the age limit who receive a child grant. |
double |
getChurchParticipationRate()
returns the overall church participation rate |
double |
getCollegeFee()
returns the yearly college/university fee. |
int |
getCurrentNumHouseholds()
returns the current number of households in the model. |
double |
getDensityFactor()
returns the density factor determining how densely the villages are populated with households (1.0 = very compact, every cell filled with a house) |
double |
getFoodCostChild()
returns the monthly food cost for a child <= 7 years old |
double |
getFoodCostFemaleAdult()
returns the monthly food cost for a female adult |
double |
getFoodCostMaleAdult()
returns the monthly food cost for a male adult |
double |
getGovernmentEmploymentRate()
returns the government employment rate, i.e. |
int |
getGridSizeX()
returns the size in dimension x of the 2D grid used as a spatial model |
int |
getGridSizeY()
returns the size in dimension y of the 2D grid used as a spatial model |
int |
getHIVIncidence()
calculates the HIV incidence for the last month |
int |
getHouseCost()
returns the average cost to build a new house in the village. |
java.lang.String[] |
getInitParam()
required by Repast: returns a list of model parameters, which can be manipulated via the Repast GUI |
double |
getInterArrivalTime()
returns the mean inter-arrival time for in-migrating mine workers. |
private java.util.ArrayList<org.cfpm.caves.za.NetworkNode> |
getLinkedNodes(org.cfpm.caves.za.NetworkNode node)
helper method for determineClusters() |
int |
getLowerMaxNumFriends()
returns the lower limit for the maximum number of friends |
int |
getLowerMaxNumPartners()
returns the lower limit for the maximum number of concurrent sexual partners |
double |
getMaxEndorsementBase()
returns the maximum value for the endorsement base used in the computation of overall endorsement values. |
int |
getMaxEndorsementClasses()
returns the maximum number of endorsement classes. |
double |
getMaxHHCash()
returns the highest amount of cash one of the households owns in the model |
int |
getMaxLobola()
returns the upper bound for the lobola a groom has to pay the bride's household. |
int |
getMaxRemittance()
returns the upper bound for remittances from migrants to their household in the village |
int |
getMaxShackRent()
returns the upper limit for monthly rent of a shack in the village. |
double |
getMaxTagEvolutionPropensity()
returns the upper bound for agents' tag evolution propensity |
int |
getMeanAgeArrived()
returns the mean for the age distribution of in-migrants. |
int |
getMeanNumArrived()
returns the mean number of in-migrant mine workers arriving at one time. |
double |
getMineHIVPrevalence()
returns the HIV prevalence amongst in-migrating mine workers |
double |
getMinEndorsementBase()
returns the minimum value for the endorsement base used in the computation of overall endorsement values. |
int |
getMinEndorsementClasses()
returns the minimum number of endorsement classes. |
double |
getMinHHCash()
returns the smallest amount of cash one of the households owns in the model |
int |
getMiningTick()
returns the tick when mining starts in the simulation |
int |
getMinLobola()
returns the lower bound for the lobola a groom has to pay the bride's household. |
int |
getMinRemittance()
returns the lower bound for remittances from migrants to their household in the village |
int |
getMinShackRent()
returns the lower limit for monthly rent of a shack in the village. |
double |
getMinTagEvolutionPropensity()
returns the lower bound for agents' tag evolution propensity |
int |
getMonth()
returns the current month |
double |
getMotherChildHIVTransmissionRate()
returns the rate for mother-to-child HIV transmission. |
java.lang.String |
getName()
Required by Repast: returns the model name |
int |
getNeededSkilled()
returns the number of skilled workers needed in the mine |
int |
getNeededUnskilled()
returns the number of unskilled workers needed in the mine |
double |
getNeighbourhoodRadius()
returns the neighbourhood radius |
private int |
getNodeIndex(org.cfpm.caves.za.NetworkNode node)
helper method for determineClusters() |
private java.util.ArrayList |
getNodes(java.util.ArrayList agents)
helper method for buildDisplay(): returns a list of nodes for the given agents |
int |
getNumBSMembers()
returns the number of agents who are members of a burial society |
int |
getNumDenominations()
returns the overall number of church denominations |
int |
getNumEmployedMiners()
returns the number of in-migrant miners employed at the mine |
int |
getNumFemaleHIVPositives()
returns the number of female HIV-positive persons |
int |
getNumHHAskingForFood()
returns the number of households asking for food during the current month |
int |
getNumHHWithoutEnoughFood()
returns the number of households with a lack of food even after having asked relatives/neighbours for help |
int |
getNumHIVPositives()
returns the number of HIV-positive persons |
int |
getNumHouseholds()
returns the number of households with which to initialise the model |
int |
getNumMigrants()
returns the current number of migrants from the villages. |
int |
getNumMigrantsOnVisit()
returns the number of migrants currently on visit in the village(s). |
int |
getNumMinerHIVPositives()
returns the number of HIV-positive miners (in-migrants) |
int |
getNumMiners()
returns the number of in-migrant miners in the area |
int |
getNumPersons()
returns the number of persons |
int |
getNumStokvelMembers()
returns the number of agents who are members of a stokvel |
int |
getNumUnskilled()
returns the number of employed unskilled workers in the mine |
int |
getNumVillages()
returns the number of villages |
java.lang.String |
getOutputPath()
returns the output path |
int |
getPensionAgeLimitFemale()
returns the age limit for state pensions for female seniors. |
int |
getPensionAgeLimitMale()
returns the age limit for state pensions for male seniors. |
double |
getPensionProportionFemale()
returns the proportion of female seniors over the age limit who receive state pensions. |
double |
getPensionProportionMale()
returns the proportion of male seniors over the age limit who receive state pensions. |
private java.util.ArrayList<org.cfpm.caves.za.Person> |
getPossibleMothers()
helper function: determines possible mothers for a baby. |
boolean |
getPrintToFile()
returns if the output to file is set on or off |
double |
getRandomPartnerProbability()
returns the probability to encounter a random sexual partner |
double |
getRemittanceProbability()
returns the probability for sending remittance home for any migrant in any month. |
uchicago.src.sim.engine.Schedule |
getSchedule()
Required by Repast: returns the schedule |
double |
getSchoolFee()
returns the yearly school fee for non-compulsory secondary school (pupils > 15 years). |
int |
getSdAgeArrived()
returns the standard deviation for the age distribution of in-migrants. |
int |
getSdNumArrived()
returns the standard deviation of the number of in-migrant mine workers arriving at one time. |
int |
getSeed()
returns the seed to be used with random generators |
double |
getShackProportion()
returns the proportion of households with a shack to rent out if necessary |
boolean |
getShowGUI()
returns if the GUI is to be displayed or not |
double |
getSimilarityAgeRange()
returns the similarity age range |
double |
getStandardWage()
returns the standard monthly wage (for piece jobs in the village). |
double |
getStatePension()
returns the monthly state pension for seniors. |
int |
getStopTime()
returns the tick when a model run stops |
int |
getTagBase()
returns the tag base (number of values per tag) |
int |
getTagLength()
returns the tag length (number of tags) |
int |
getTick()
returns the current tick |
int |
getUpperMaxNumFriends()
returns the upper limit for the maximum number of friends |
int |
getUpperMaxNumPartners()
returns the upper limit for the maximum number of concurrent sexual partners |
int |
getWeek()
returns the current week |
int |
getYear()
returns the current year |
void |
incNumHHAskingForFood()
increases the number of households asking for food by 1 |
void |
incNumHHWithoutEnoughFood()
increases the number of households without enough food by 1 |
boolean |
isShowOutput()
returns if the output to console is set on or off |
private void |
locateHouseholds(java.util.ArrayList<java.util.ArrayList<org.cfpm.caves.za.NetworkNode>> hhClusters)
Initialisation related: create villages, assing households to villages, position households in space. |
static void |
main(java.lang.String[] args)
The main method: runs the model |
void |
marry(java.lang.String maleNameString,
java.lang.String femaleNameString)
wrapper for the marry() method: turns the parameters of type String into parameters of type Value. |
void |
marry(jess.Value maleName,
jess.Value femaleName)
Make a happy couple out of a male and female agent. |
private void |
openOutput()
helper method: opens trace file and directs Jess ouput to it |
private boolean |
overlapping(int[] centre,
int radius,
java.util.ArrayList<org.cfpm.caves.za.Village> villages)
helper method for createVillage() |
private void |
pickFriends(java.util.ArrayList<org.cfpm.caves.za.Person> members,
int maxNum,
java.util.ArrayList<org.cfpm.caves.za.Household> village)
helper function for createBurialSocieties() |
private void |
pickHIVPositives()
Initialisation related: choose some agents to be HIV positive |
private void |
pickMigrants()
|
private org.cfpm.caves.za.Person |
pickMother(java.util.ArrayList<org.cfpm.caves.za.Person> possibleMothers)
|
private void |
pickRelatives(java.util.ArrayList<org.cfpm.caves.za.Household> related,
int n,
java.util.ArrayList<org.cfpm.caves.za.Person> members)
helper function for createBurialSocieties() |
private void |
populateHousehold(int numMembers,
org.cfpm.caves.za.Household hh,
cern.jet.random.Normal hhHeadAgeDist,
cern.jet.random.Normal ageDiffDist,
cern.jet.random.Gamma ageDist,
SouthAfricaModel.EmpiricalDiscreteDist femaleStatusDist,
SouthAfricaModel.EmpiricalDiscreteDist maleStatusDist,
SouthAfricaModel.EmpiricalDiscreteDist memberTypeDist)
Initialisation related: create household members according to empirical data (RADAR) |
private void |
populateVillage(org.cfpm.caves.za.Village village,
int startIndex,
int endIndex)
Initialisation related: position households in space, or to be more precise, position them randomly inside the area the village takes up. |
boolean |
probabilityp(double p)
returns true with the given probability p. |
int |
randomInt(int from,
int to)
samples a random uniform distribution in the interval from-to. |
void |
recordStokvelEvent(java.lang.String stokvel,
java.lang.String event)
records the given event for the given stokvel |
void |
recordStokvelEvent(java.lang.String stokvel,
java.lang.String event,
org.cfpm.caves.za.Person member)
records the given event regarding the given member for the given stokvel |
void |
removeHousehold(org.cfpm.caves.za.Household hh)
Removes the given dissolved household from the model |
private void |
removeLinks(org.cfpm.caves.za.Household hh)
helper method for removeHousehold(): removes the links of the given dissolved household |
private void |
removeLinks(org.cfpm.caves.za.Person p)
Helper function: removes the links of the given dead person. |
void |
removeMiner(org.cfpm.caves.za.Person p)
Removes an external miner from the model |
(package private) void |
removeNeighbourLinks(java.util.ArrayList<java.lang.String> list)
helper function: removes neighbour links (is-neighbour endorsements) for the given list of persons (members of a household, group of leaving miners) |
(package private) void |
removeNeighbourLinks(jess.Value[] list)
helper function: wrapper for same method with ArrayList parameter |
void |
removePerson(org.cfpm.caves.za.Person p)
Removes a dead person from the model and records his/her death. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener p)
removes a property change listener (for Jess) |
private void |
resetNextBirths()
helper function: resets the data structure keeping track of upcoming births |
void |
resetOutputVariables()
resets the output variables recorded on a monthly basis |
(package private) java.util.ArrayList<org.cfpm.caves.za.Person> |
retrieveObjects(jess.Value[] names)
returns the Person objects for the given list of names. |
void |
setAdultEmploymentRate(double rate)
sets the adult employment rate |
private void |
setAsHead(org.cfpm.caves.za.Person person,
SouthAfricaModel.EmpiricalDiscreteDist statusDistribution)
helper function for populateHouseholds() |
void |
setBirthRate(double birthRate)
sets the birth rate (number of births per 1000 persons in the population) |
void |
setBurialCost(double burialCost)
sets the average cost of a burial |
void |
setChildGrant(double childGrant)
sets the monthly child grant for children up to age 7 |
void |
setChildGrantAgeLimit(int childGrantAgeLimit)
sets the age limit for child grants. |
void |
setChildGrantProportion(double childGrantProportion)
sets the proportion of children under the age limit who receive a child grant. |
void |
setChurchParticipationRate(double churchParticipationRate)
sets the overall church participation rate |
void |
setCollegeFee(double collegeFee)
sets the yearly college/university fee. |
private void |
setDateValues()
computes and sets the current date values (year, month, week) |
void |
setDensityFactor(double densityFactor)
sets the density factor determining how densely the villages are populated with households (1.0 = very compact, every cell filled with a house) |
private void |
setDisposalPolicy()
Jess related: define disposal policies for unneeded facts |
void |
setFoodCostChild(double foodCostChild)
sets the monthly food cost for a child <= 7 years old |
void |
setFoodCostFemaleAdult(double foodCostFemaleAdult)
sets the monthly food cost for a female adult |
void |
setFoodCostMaleAdult(double foodCostMaleAdult)
sets the monthly food cost for a male adult |
void |
setGovernmentEmploymentRate(double governmentEmploymentRate)
sets the government employment rate, i.e. |
void |
setGridSizeX(int gridSizeX)
sets the size in dimension x of the 2D grid used as a spatial model |
void |
setGridSizeY(int gridSizeY)
sets the size in dimension y of the 2D grid used as a spatial model |
void |
setHouseCost(int houseCost)
sets the average cost to build a new house in the village. |
void |
setInterArrivalTime(double interArrivalTime)
sets the mean inter-arrival time for in-migrating mine workers. |
void |
setLowerMaxNumFriends(int lowerMaxNumFriends)
sets the lower limit for the maximum number of friends |
void |
setLowerMaxNumPartners(int lowerMaxNumPartners)
sets the lower limit for the maximum number of concurrent sexual partners |
void |
setMaxEndorsementBase(double maxEndorsementBase)
sets the maximum value for the endorsement base used in the computation of overall endorsement values. |
void |
setMaxEndorsementClasses(int maxEndorsementClasses)
sets the maximum number of endorsement classes. |
void |
setMaxLobola(int maxLobola)
sets the upper bound for the lobola a groom has to pay the bride's household. |
void |
setMaxRemittance(int maxRemittance)
sets the upper bound for remittances from migrants to their household in the village |
void |
setMaxShackRent(int maxShackRent)
sets the upper limit for monthly rent of a shack in the village. |
void |
setMaxTagEvolutionPropensity(double maxTagEvolutionPropensity)
sets the upper bound for agents' tag evolution propensity |
void |
setMeanAgeArrived(int meanAgeArrived)
sets the mean for the age distribution of in-migrants. |
void |
setMeanNumArrived(int meanNumArrived)
sets the mean number of in-migrant mine workers arriving at one time. |
void |
setMineHIVPrevalence(double mineHIVPrevalence)
sets the HIV prevalence amongst in-migrating mine workers |
void |
setMinEndorsementBase(double minEndorsementBase)
sets the minimum value for the endorsement base used in the computation of overall endorsement values. |
void |
setMinEndorsementClasses(int minEndorsementClasses)
sets the minimum number of endorsement classes. |
void |
setMiningTick(int miningTick)
sets the tick when mining starts in the simulation |
void |
setMinLobola(int minLobola)
sets the lower bound for the lobola a groom has to pay the bride's household. |
void |
setMinRemittance(int minRemittance)
sets the lower bound for remittances from migrants to their household in the village |
void |
setMinShackRent(int minShackRent)
sets the lower limit for monthly rent of a shack in the village. |
void |
setMinTagEvolutionPropensity(double minTagEvolutionPropensity)
sets the lower bound for agents' tag evolution propensity |
void |
setMonth(int m)
sets the current month |
void |
setMotherChildHIVTransmissionRate(double motherChildHIVTransmissionRate)
sets the rate for mother-to-child HIV transmission. |
void |
setNeededSkilled(int neededSkilled)
sets he number of skilled workers needed in the mine |
void |
setNeededUnskilled(int neededUnskilled)
sets he number of unskilled workers needed in the mine |
void |
setNeighbourhoodRadius(double neighbourhoodRadius)
sets the neighbourhood radius |
void |
setNumDenominations(int numDenominations)
sets the overall number of church denominations |
protected void |
setNumHHAskingForFood(int numHHAskingForFood)
sets the number of households asking for food during the current month |
protected void |
setNumHHWithoutEnoughFood(int numHHWithoutEnoughFood)
sets the number of households with a lack of food even after having asked relatives/neighbours for help |
void |
setNumHouseholds(int numHouseholds)
sets the number of households with which to initialise the model |
void |
setNumVillages(int numVillages)
sets the number of villages |
void |
setOutputPath(java.lang.String outputPath)
sets the output path |
void |
setPensionAgeLimitFemale(int pensionFemaleAgeLimit)
sets the age limit for state pensions for female seniors. |
void |
setPensionAgeLimitMale(int pensionMaleAgeLimit)
sets the age limit for state pensions for male seniors. |
void |
setPensionProportionFemale(double pensionProportionFemale)
sets the proportion of female seniors over the age limit who receive state pensions. |
void |
setPensionProportionMale(double pensionProportionMale)
sets the proportion of male seniors over the age limit who receive state pensions. |
void |
setPrintToFile(boolean printToFile)
turns the output to file on or off |
void |
setRandomPartnerProbability(double randomPartnerProbability)
sets the probability to encounter a random sexual partner |
void |
setRemittanceProbability(double remittanceProbability)
sets the probability for sending remittance home for any migrant in any month. |
void |
setSchoolFee(double schoolFee)
sets the yearly school fee for non-compulsory secondary school (pupils > 15 years). |
void |
setSdAgeArrived(int sdAgeArrived)
sets the standard deviation for the age distribution of in-migrants. |
void |
setSdNumArrived(int sdNumArrived)
sets the standard deviation of the number of in-migrant mine workers arriving at one time. |
void |
setSeed(int seed)
sets the seed to be used with random generators |
void |
setShackProportion(double shackProportion)
sets the proportion of households with a shack to rent out if necessary |
void |
setShowGUI(boolean showGUI)
sets if the GUI is to be displayed or not |
void |
setShowOutput(boolean showOutput)
turns the output to console on or off |
void |
setSimilarityAgeRange(double similarityAgeRange)
sets the similarity age range |
void |
setStandardWage(double standardWage)
sets the standard monthly wage (for piece jobs in the village). |
void |
setStatePension(double statePension)
sets the monthly state pension for seniors. |
void |
setStopTime(int stopTime)
sets the tick when a model run stops |
void |
setTagBase(int tagBase)
sets the tag base (number of values per tag) |
void |
setTagLength(int tagLength)
sets the tag length (number of tags) |
void |
setTick(int t)
sets the current tick |
void |
setup()
required by Repast: resets the model |
void |
setUpperMaxNumFriends(int upperMaxNumFriends)
sets the upper limit for the maximum number of friends |
void |
setUpperMaxNumPartners(int upperMaxNumPartners)
sets the upper limit for the maximum number of concurrent sexual partners |
void |
setWeek(int wk)
sets the current week |
void |
setYear(int yr)
sets the current year |
private int[] |
sortHouseholdList(java.util.ArrayList<java.util.ArrayList<org.cfpm.caves.za.NetworkNode>> clusters)
helper function for locateHouseholds(): sorts household list into clusters detected in the kinship network |
private int[] |
sortPersonList(int lowAge,
int highAge,
java.util.ArrayList<org.cfpm.caves.za.Person> newList)
helper method for pickMigrants() |
private int[] |
sortTypes(int[] types)
helper function for populateHousehold() |
private void |
supplyGrants()
Supply households with state grants: child grants for children < 7 and pensions for registered pensioners. |
void |
unwatchFacts()
equivalent to (unwatch facts) in Jess |
(package private) void |
update()
procedural update of the model state, called each tick |
(package private) void |
updateAgents()
Procedural update of agents (persons), once each tick. |
void |
watchFacts()
equivalent to (watch facts) in Jess |
Methods inherited from class uchicago.src.sim.engine.SimModelImpl |
---|
addPropertyListener, addSimEventListener, clearMediaProducers, clearPropertyListeners, fireBooleanPropertyEvent, fireEndSim, fireNumericPropertyEvent, fireObjectPropertyEvent, firePauseSim, fireSimEvent, fireStopSim, fireStringPropertyEvent, generateNewSeed, getController, getMediaProducers, getModelManipulator, getParameterDescriptors, getPropertiesValues, getRngSeed, getTickCount, pause, registerDisplaySurface, registerMediaProducer, removePropertyListener, removeSimEventListener, setController, setRngSeed, stop |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static int CHILD
private static int GRANDCHILD
private static int OTHER
int numHouseholds
int numVillages
int numDenominations
double churchParticipationRate
double adultEmploymentRate
double governmentEmploymentRate
double standardWage
double childGrant
double childGrantProportion
int childGrantAgeLimit
double statePension
double pensionProportionFemale
double pensionProportionMale
int pensionAgeLimitFemale
int pensionAgeLimitMale
double foodCostChild
double foodCostFemaleAdult
double foodCostMaleAdult
double schoolFee
double collegeFee
int minLobola
int maxLobola
int minRemittance
int maxRemittance
double remittanceProbability
double burialCost
double shackProportion
int minShackRent
int maxShackRent
int houseCost
double motherChildHIVTransmissionRate
double birthRate
int gridSizeX
int gridSizeY
double neighbourhoodRadius
double densityFactor
int miningTick
int neededSkilled
int neededUnskilled
double mineHIVPrevalence
double interArrivalTime
int meanNumArrived
int sdNumArrived
int meanAgeArrived
int sdAgeArrived
int tagLength
int tagBase
double maxTagEvolutionPropensity
double minTagEvolutionPropensity
double minEndorsementBase
double maxEndorsementBase
int minEndorsementClasses
int maxEndorsementClasses
int upperMaxNumFriends
int lowerMaxNumFriends
int upperMaxNumPartners
int lowerMaxNumPartners
double similarityAgeRange
double randomPartnerProbability
boolean showGUI
boolean printToFile
boolean showOutput
java.lang.String outputPath
int seed
int stopTime
java.util.ArrayList<org.cfpm.caves.za.Person> personList
java.util.ArrayList<org.cfpm.caves.za.Household> householdList
uchicago.src.sim.space.Object2DGrid space
org.cfpm.caves.za.Mine mine
SouthAfricaModel.MinerSource minerSource
int[][] nextBirths
public int year
public int month
public int week
public int tick
public int personIndex
java.util.HashMap<java.lang.String,org.cfpm.caves.za.Person> namePersonMap
java.util.HashMap<java.lang.String,org.cfpm.caves.za.Household> nameHouseholdMap
java.util.HashMap<java.lang.String,org.cfpm.caves.za.Village> nameVillageMap
private uchicago.src.sim.engine.Schedule schedule
jess.Rete engine
org.cfpm.caves.za.FactBaseScourer jessLink
org.cfpm.caves.za.EndorsementDisposalPolicy disposalPolicy
private java.beans.PropertyChangeSupport pcs
java.io.PrintWriter printOut
java.io.File outputFile
java.lang.String pathName
int numHHAskingForFood
int numHHWithoutEnoughFood
int numMiners
uchicago.src.sim.analysis.LocalDataRecorder monthlyDataRecorder
uchicago.src.sim.analysis.LocalDataRecorder weeklyDataRecorder
SouthAfricaModel.PartnershipRecorder partnershipRecorder
SouthAfricaModel.SexualNetworkRecorder sexualNetworkRecorder
SouthAfricaModel.FriendshipNetworkRecorder friendNetworkRecorder
SouthAfricaModel.HIVDeathRecorder deathRecorder
java.util.ArrayList<java.lang.String> chosenHH
SouthAfricaModel.HouseholdEconomyRecorder hhEconomyRecorder
SouthAfricaModel.VillageEconomyRecorder villageEconomyRecorder
SouthAfricaModel.HHWealthDistRecorder hhWealthDistRecorder
SouthAfricaModel.HHIncomeRecorder hhIncomeRecorder
SouthAfricaModel.StokvelRecorder stokvelRecorder
SouthAfricaModel.MiningRecorder miningRecorder
SouthAfricaModel.AgeDistributionRecorder ageDistRecorder
uchicago.src.sim.gui.DisplaySurface friendNetworkDisplay
uchicago.src.sim.gui.DisplaySurface kinshipNetworkDisplay
uchicago.src.sim.gui.DisplaySurface stokvelNetworkDisplay
uchicago.src.sim.gui.DisplaySurface spaceDisplay
org.cfpm.caves.za.MultiLayerNetwork2DDisplay friendNetwork
org.cfpm.caves.za.MultiLayerNetwork2DDisplay kinshipNetwork
org.cfpm.caves.za.MultiLayerNetwork2DDisplay stokvelNetwork
SouthAfricaModel.WHOLifeTable malesTable
SouthAfricaModel.WHOLifeTable femalesTable
SouthAfricaModel.EmpiricalDiscreteDist stageDist
Constructor Detail |
---|
public SouthAfricaModel()
Method Detail |
---|
public void setup()
public java.lang.String[] getInitParam()
public void begin()
private void openOutput()
public void finalize()
finalize
in class java.lang.Object
private void buildModel()
private void buildDisplay()
private java.util.ArrayList getNodes(java.util.ArrayList agents)
private void buildSchedule()
public uchicago.src.sim.engine.Schedule getSchedule()
public java.lang.String getName()
private void setDisposalPolicy()
public void watchFacts()
public void unwatchFacts()
private void pickHIVPositives()
private int ageClassIndexOf(int age, int[] classes)
private void assignEducationLevels()
private void adjustEducationLevel(org.cfpm.caves.za.Person p)
private void createBurialSocieties()
private void pickRelatives(java.util.ArrayList<org.cfpm.caves.za.Household> related, int n, java.util.ArrayList<org.cfpm.caves.za.Person> members)
private java.util.ArrayList<org.cfpm.caves.za.Household> findRelatedHouseholds(org.cfpm.caves.za.Household hh, java.util.ArrayList<org.cfpm.caves.za.Household> hhList)
private void pickFriends(java.util.ArrayList<org.cfpm.caves.za.Person> members, int maxNum, java.util.ArrayList<org.cfpm.caves.za.Household> village)
private java.util.ArrayList<jess.Value> findChurches(java.util.ArrayList<org.cfpm.caves.za.Person> list)
private void locateHouseholds(java.util.ArrayList<java.util.ArrayList<org.cfpm.caves.za.NetworkNode>> hhClusters)
hhClusters
- kinship clusters of householdsprivate void createChurches(int village, int startIndex, int endIndex)
village
- village indexstartIndex
- index into the household list (start of this village's households)endIndex
- index into the household list (end of this village's households)private void populateVillage(org.cfpm.caves.za.Village village, int startIndex, int endIndex)
village
- startIndex
- index into the household list (start of this village's households)endIndex
- index into the household list (end of this village's households)private int[] sortHouseholdList(java.util.ArrayList<java.util.ArrayList<org.cfpm.caves.za.NetworkNode>> clusters)
private org.cfpm.caves.za.Household findHouseholdOf(org.cfpm.caves.za.NetworkNode node)
node
- the network node
private org.cfpm.caves.za.Village createVillage(java.lang.String name, int numHouseholds, java.util.ArrayList<org.cfpm.caves.za.Village> villages)
name
- the name of the villagenumHouseholds
- the number of households in the villagevillages
- the list of existing villages (needed to avoid overlapping villages in space)
private int[] determineVillageLocation(int radius, java.util.ArrayList<org.cfpm.caves.za.Village> villages)
private boolean overlapping(int[] centre, int radius, java.util.ArrayList<org.cfpm.caves.za.Village> villages)
private void createHouseholds()
private void pickMigrants()
private int[] sortPersonList(int lowAge, int highAge, java.util.ArrayList<org.cfpm.caves.za.Person> newList)
private void populateHousehold(int numMembers, org.cfpm.caves.za.Household hh, cern.jet.random.Normal hhHeadAgeDist, cern.jet.random.Normal ageDiffDist, cern.jet.random.Gamma ageDist, SouthAfricaModel.EmpiricalDiscreteDist femaleStatusDist, SouthAfricaModel.EmpiricalDiscreteDist maleStatusDist, SouthAfricaModel.EmpiricalDiscreteDist memberTypeDist)
numMembers
- number of membershh
- the householdhhHeadAgeDist
- distribution for the age of the household headageDiffDist
- distribution for the age difference between head and spouseageDist
- distribution for the age of household members in generalfemaleStatusDist
- distribution for the marital status of femalesmaleStatusDist
- distribution for the marital status of malesmemberTypeDist
- distribution for the type of household members (child / grandchild of head or other)private org.cfpm.caves.za.Person createHouseholdMember(java.lang.String name, org.cfpm.caves.za.Household hhold)
name
- the members's namehhold
- the household
private void setAsHead(org.cfpm.caves.za.Person person, SouthAfricaModel.EmpiricalDiscreteDist statusDistribution)
private void createFamilyLinks(org.cfpm.caves.za.Household hh, org.cfpm.caves.za.Person[] members, int[] memberType)
private void assignEmployments()
private int[] sortTypes(int[] types)
private int findParent(org.cfpm.caves.za.Person[] members, int[] type, int childIndex)
private void createNeighbourNetwork()
private java.util.ArrayList<java.util.ArrayList<org.cfpm.caves.za.NetworkNode>> createKinshipNetwork()
public void endorseKin(org.cfpm.caves.za.Household hh1, org.cfpm.caves.za.Household hh2)
hh1
- first householdhh2
- second household, related to firstvoid endorseNeighbours(org.cfpm.caves.za.Person p)
p
- a new personpublic void endorseNeighbours(org.cfpm.caves.za.Person p, org.cfpm.caves.za.Household hh)
p
- a minerhh
- his landlord householdprivate void endorseAllNeighbours(org.cfpm.caves.za.Person p, org.cfpm.caves.za.Household hh)
p
- the personhh
- the householdvoid endorseKin(org.cfpm.caves.za.Person baby)
baby
- a new personprivate java.util.ArrayList<java.util.ArrayList<org.cfpm.caves.za.NetworkNode>> determineClusters(java.util.List list)
list
- the kinship network as a list of nodes
private double computeDistance(java.util.ArrayList<org.cfpm.caves.za.NetworkNode> clusterA, java.util.ArrayList<org.cfpm.caves.za.NetworkNode> clusterB, double[][] distances)
private int getNodeIndex(org.cfpm.caves.za.NetworkNode node)
private java.util.ArrayList<org.cfpm.caves.za.NetworkNode> getLinkedNodes(org.cfpm.caves.za.NetworkNode node)
public void createMine()
void update()
private void supplyGrants()
void createNewPerson()
private org.cfpm.caves.za.Person pickMother(java.util.ArrayList<org.cfpm.caves.za.Person> possibleMothers)
private void createFamilyLinks(org.cfpm.caves.za.Person baby, org.cfpm.caves.za.Person mother, org.cfpm.caves.za.Household household)
baby
- the new personmother
- their motherhousehold
- their householdprivate java.util.ArrayList<org.cfpm.caves.za.Person> getPossibleMothers()
void calculateNextBirths()
private void resetNextBirths()
void updateAgents()
void checkDeath()
void checkDeath(java.util.ArrayList<org.cfpm.caves.za.Person> ageGroup, SouthAfricaModel.WHOLifeTable table)
void checkDeath(org.cfpm.caves.za.Person p)
p
- a newborn agentpublic boolean askPensionOracle(org.cfpm.caves.za.Person p)
p
- a senior
public boolean askChildGrantOracle(org.cfpm.caves.za.Person p)
public void removePerson(org.cfpm.caves.za.Person p)
p
- the dead personpublic void removeMiner(org.cfpm.caves.za.Person p)
p
- the miner who is leaving the areaprivate void removeLinks(org.cfpm.caves.za.Person p)
p
- the dead personpublic void removeHousehold(org.cfpm.caves.za.Household hh)
hh
- the household to be removedprivate void removeLinks(org.cfpm.caves.za.Household hh)
hh
- the dissolved householdpublic static void main(java.lang.String[] args)
public boolean probabilityp(double p)
p
- the given propability
public int randomInt(int from, int to)
from
- lower boundto
- upper bound
public void marry(jess.Value maleName, jess.Value femaleName)
maleName
- name of the malefemaleName
- name of the femalepublic void marry(java.lang.String maleNameString, java.lang.String femaleNameString)
maleNameString
- name of the male agent as a StringfemaleNameString
- name of the female agent as a Stringpublic jess.Value buildNewHouse(org.cfpm.caves.za.Person head) throws jess.JessException
head
- the household head
jess.JessException
void removeNeighbourLinks(jess.Value[] list)
void removeNeighbourLinks(java.util.ArrayList<java.lang.String> list)
list
- list of namesjava.util.ArrayList<org.cfpm.caves.za.Person> retrieveObjects(jess.Value[] names)
names
- list of agents' names
public void dump(java.lang.String text)
text
- the text to be outputpublic int getNumHHAskingForFood()
protected void setNumHHAskingForFood(int numHHAskingForFood)
numHHAskingForFood
- number of households asking for foodpublic int getNumHHWithoutEnoughFood()
protected void setNumHHWithoutEnoughFood(int numHHWithoutEnoughFood)
numHHWithoutEnoughFood
- number of households without enough foodpublic void incNumHHAskingForFood()
public void incNumHHWithoutEnoughFood()
public double getMaxHHCash()
public double getMinHHCash()
public double getAvgHHCash()
public void resetOutputVariables()
public int getNumHIVPositives()
public int getNumFemaleHIVPositives()
public int getNumMinerHIVPositives()
public int getNumPersons()
public int getHIVIncidence()
public int getNumStokvelMembers()
public int getNumBSMembers()
public java.util.HashMap<java.lang.String,java.lang.String[]> compileSexualNetwork()
public double calculateClusterCoefficient()
public void recordStokvelEvent(java.lang.String stokvel, java.lang.String event)
stokvel
- name of a stokvelevent
- type of eventpublic void recordStokvelEvent(java.lang.String stokvel, java.lang.String event, org.cfpm.caves.za.Person member)
stokvel
- name of a stokvelevent
- type of eventmember
- agent (stokvel member)public double getMineHIVPrevalence()
public void setMineHIVPrevalence(double mineHIVPrevalence)
mineHIVPrevalence
- HIV prevalencepublic int getMiningTick()
public void setMiningTick(int miningTick)
miningTick
- start tick of miningpublic int getNeededSkilled()
public void setNeededSkilled(int neededSkilled)
neededSkilled
- number of skilled workerspublic int getNeededUnskilled()
public void setNeededUnskilled(int neededUnskilled)
neededUnskilled
- number of unskilled workerspublic int getNumUnskilled()
public int getNumMiners()
public int getNumEmployedMiners()
public int getCurrentNumHouseholds()
public int getNumMigrants()
public int getNumMigrantsOnVisit()
public boolean fitForMarriage(java.lang.String male, java.lang.String female)
male
- the name of the male partnerfemale
- the name of the female partner
public jess.Value fitForMarriage(jess.Value male, jess.Value female)
public int getMonth()
public void setMonth(int m)
public int getWeek()
public void setWeek(int wk)
public int getYear()
public void setYear(int yr)
public void addPropertyChangeListener(java.beans.PropertyChangeListener p)
public void removePropertyChangeListener(java.beans.PropertyChangeListener p)
public int getTick()
public void setTick(int t)
private void setDateValues()
public int getNumHouseholds()
public void setNumHouseholds(int numHouseholds)
numHouseholds
- the initial number of householdspublic int getSeed()
public void setSeed(int seed)
seed
- the seedpublic boolean getShowGUI()
public void setShowGUI(boolean showGUI)
showGUI
- true to turn the GUI on, false to turn it offpublic double getAdultEmploymentRate()
public void setAdultEmploymentRate(double rate)
rate
- proportion of adult agents with a jobpublic double getGovernmentEmploymentRate()
public void setGovernmentEmploymentRate(double governmentEmploymentRate)
governmentEmploymentRate
- government employment ratepublic int getGridSizeX()
public void setGridSizeX(int gridSizeX)
gridSizeX
- the number of cells in xpublic int getGridSizeY()
public void setGridSizeY(int gridSizeY)
gridSizeY
- the number of cells in ypublic int getNumVillages()
public void setNumVillages(int numVillages)
numVillages
- the number of villagespublic double getDensityFactor()
public void setDensityFactor(double densityFactor)
densityFactor
- the density factorpublic double getBirthRate()
public void setBirthRate(double birthRate)
birthRate
- the birth ratepublic double getNeighbourhoodRadius()
public void setNeighbourhoodRadius(double neighbourhoodRadius)
neighbourhoodRadius
- the neighbourhood radiuspublic int getTagLength()
public void setTagLength(int tagLength)
tagLength
- the number of tags per agentpublic int getTagBase()
public void setTagBase(int tagBase)
tagBase
- the tag basepublic double getChurchParticipationRate()
public void setChurchParticipationRate(double churchParticipationRate)
churchParticipationRate
- the church participation ratepublic int getNumDenominations()
public void setNumDenominations(int numDenominations)
numDenominations
- the number of denominationspublic double getMaxTagEvolutionPropensity()
public void setMaxTagEvolutionPropensity(double maxTagEvolutionPropensity)
maxTagEvolutionPropensity
- the maximal tag evolution propensitypublic double getMinTagEvolutionPropensity()
public void setMinTagEvolutionPropensity(double minTagEvolutionPropensity)
minTagEvolutionPropensity
- the minimal tag evolution propensitypublic boolean getPrintToFile()
public void setPrintToFile(boolean printToFile)
printToFile
- true to turn it on, false to turn it offpublic java.lang.String getOutputPath()
public void setOutputPath(java.lang.String outputPath)
outputPath
- output pathpublic boolean isShowOutput()
public void setShowOutput(boolean showOutput)
showOutput
- true to turn the output on, false to turn it offpublic int getStopTime()
public void setStopTime(int stopTime)
stopTime
- the stop time of a model runpublic double getInterArrivalTime()
public void setInterArrivalTime(double interArrivalTime)
interArrivalTime
- mean inter-arrival time (in ticks)public int getMeanNumArrived()
public void setMeanNumArrived(int meanNumArrived)
meanNumArrived
- mean number of in-migrantspublic int getSdNumArrived()
public void setSdNumArrived(int sdNumArrived)
sdNumArrived
- standard deviation of the number of in-migrantspublic int getLowerMaxNumFriends()
public void setLowerMaxNumFriends(int lowerMaxNumFriends)
lowerMaxNumFriends
- lower limit of maximum number of friendspublic int getUpperMaxNumFriends()
public void setUpperMaxNumFriends(int upperMaxNumFriends)
upperMaxNumFriends
- upper limit of maximum number of friendspublic int getUpperMaxNumPartners()
public void setUpperMaxNumPartners(int upperMaxNumPartners)
upperMaxNumPartners
- upper limit of maximum number of partnerspublic int getLowerMaxNumPartners()
public void setLowerMaxNumPartners(int lowerMaxNumPartners)
lowerMaxNumPartners
- lower limit of maximum number of partnerspublic double getMaxEndorsementBase()
public void setMaxEndorsementBase(double maxEndorsementBase)
maxEndorsementBase
- maximum value for the endorsement basepublic double getMinEndorsementBase()
public void setMinEndorsementBase(double minEndorsementBase)
minEndorsementBase
- minimum value for the endorsement basepublic int getMinEndorsementClasses()
1 <= weight_i <= number of classes
).
public int getMaxEndorsementClasses()
1 <= weight_i <= number of classes
).
public void setMaxEndorsementClasses(int maxEndorsementClasses)
1 <= weight_i <= number of classes
).
maxEndorsementClasses
- maximum number of endorsement classespublic void setMinEndorsementClasses(int minEndorsementClasses)
1 <= weight_i <= number of classes
).
minEndorsementClasses
- minimum number of endorsement classespublic double getStandardWage()
public void setStandardWage(double standardWage)
standardWage
- standard monthly wagepublic double getChildGrant()
public void setChildGrant(double childGrant)
childGrant
- child grantpublic double getStatePension()
public void setStatePension(double statePension)
statePension
- monthly state pensionpublic double getFoodCostChild()
public void setFoodCostChild(double foodCostChild)
foodCostChild
- monthly food cost for a childpublic double getFoodCostFemaleAdult()
public void setFoodCostFemaleAdult(double foodCostFemaleAdult)
foodCostFemaleAdult
- monthly food cost for a femalepublic double getFoodCostMaleAdult()
public void setFoodCostMaleAdult(double foodCostMaleAdult)
foodCostMaleAdult
- monthly food cost for a malepublic double getSimilarityAgeRange()
public void setSimilarityAgeRange(double similarityAgeRange)
similarityAgeRange
- similarity age rangepublic double getBurialCost()
public void setBurialCost(double burialCost)
burialCost
- the burial costpublic double getRandomPartnerProbability()
public void setRandomPartnerProbability(double randomPartnerProbability)
randomPartnerProbability
- random sexual partner probabilitypublic int getMeanAgeArrived()
public void setMeanAgeArrived(int meanAgeArrived)
meanAgeArrived
- mean age of in-migrantspublic int getSdAgeArrived()
public void setSdAgeArrived(int sdAgeArrived)
sdAgeArrived
- standard deviation of age of in-migrantspublic double getShackProportion()
public void setShackProportion(double shackProportion)
shackProportion
- proportion of shacks in the villagepublic int getMinRemittance()
public void setMinRemittance(int minRemittance)
minRemittance
- lower bound for remittancespublic int getMaxRemittance()
public void setMaxRemittance(int maxRemittance)
maxRemittance
- upper bound for remittancespublic double getRemittanceProbability()
public void setRemittanceProbability(double remittanceProbability)
remittanceProbability
- probability for remittancepublic double getCollegeFee()
public void setCollegeFee(double collegeFee)
collegeFee
- college feepublic double getSchoolFee()
public void setSchoolFee(double schoolFee)
schoolFee
- school feepublic int getMaxLobola()
public void setMaxLobola(int maxLobola)
maxLobola
- upper bound for lobolapublic int getMinLobola()
public void setMinLobola(int minLobola)
minLobola
- lower bound for lobolapublic double getPensionProportionFemale()
public void setPensionProportionFemale(double pensionProportionFemale)
pensionProportionFemale
- proportion of female seniors with pensionspublic double getPensionProportionMale()
public void setPensionProportionMale(double pensionProportionMale)
pensionProportionMale
- proportion of male seniors with pensionspublic double getChildGrantProportion()
public void setChildGrantProportion(double childGrantProportion)
childGrantProportion
- proportion of children with child grantspublic int getChildGrantAgeLimit()
public void setChildGrantAgeLimit(int childGrantAgeLimit)
childGrantAgeLimit
- age limit for child grantspublic int getPensionAgeLimitFemale()
public void setPensionAgeLimitFemale(int pensionFemaleAgeLimit)
pensionFemaleAgeLimit
- female age limit for state pensionspublic int getPensionAgeLimitMale()
public void setPensionAgeLimitMale(int pensionMaleAgeLimit)
pensionMaleAgeLimit
- male age limit for state pensionspublic double getMotherChildHIVTransmissionRate()
public void setMotherChildHIVTransmissionRate(double motherChildHIVTransmissionRate)
motherChildHIVTransmissionRate
- mother-to-child HIV transmission ratepublic int getHouseCost()
public void setHouseCost(int houseCost)
houseCost
- house costpublic int getMaxShackRent()
public void setMaxShackRent(int maxShackRent)
maxShackRent
- upper limit of the shack rentpublic int getMinShackRent()
public void setMinShackRent(int minShackRent)
minShackRent
- lower limit of the shack rent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |