|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuaa.feral.social.waterUse.WaterUseBehaviors
uaa.feral.social.waterUse.SocialDistancing
public class SocialDistancing
Social distancing model based on UAA-Northwestern water use model by Daniel Stouffer.
Constructor Summary | |
---|---|
SocialDistancing(Community community)
Main constructor for object |
Method Summary | |
---|---|
double |
ageWeighted(double[] timeSeries)
Method used to weight certain agents |
void |
askAgents()
Method that allows agents to get water and update values associated with water (quantity and quality) and perceptions of water |
void |
bayesianPreference(HydrologicalUnit hu,
Person p)
Method that calculates water source preferences |
void |
checkPerson(Person p)
Method that checks to see if the person agent has previously been used in the model |
void |
collectWater(Person person,
HydrologicalUnit hu)
Method that calls a method to update quantity extracted by an agent |
double[] |
createValues(int size,
double initValue)
Method used in initializing model values associated with agents |
int[] |
createValues(int size,
int initValue)
Method used in intializing model values associated with agents |
void |
degradeWaterQuality()
Method degrades municipal quality |
void |
degradeWaterQuantity()
Method degrades water quantity by .05 percent |
void |
determineSize(HydrologicalSetting hs)
Method determines the size or number of water sources from a given system |
double |
getAcceptableDistanceLevel()
|
java.util.List<HydrologicalUnit> |
getWaterSourceContexts()
|
double |
getWeightFactor()
|
void |
initializeWater()
Method launched when model first starts. |
void |
initialValues()
Method that initializes data values and data containers used |
void |
moveToMunicipalWaterSource(Person p)
Method to move to a municipal water source |
void |
moveToNaturalWaterSource(Person p)
Method to move to non-municipal water sources |
void |
moveToWaterSource(Person p)
Method that calls the methods that move an agent to a given water source location. |
double |
noisyQuantity(HydrologicalUnit hu)
Method to make the hydrological quantity noisy |
void |
organizeWaterForPeople(Person person)
Method associates a person agent with different water use quantities and data holders |
double[] |
preferenceWeighted(Person person,
double[] belief)
Method to weight preferences for certain water sources |
void |
removeAgent(Person p)
Method to remove agent from the models data |
void |
resetValues()
Method to reset data values to different quantities |
void |
returnHome(Person p)
Method moves the agents home (i.e the location of their community) |
void |
runModel()
Method to run the model that is called by the community |
HydrologicalUnit |
selectWaterSource(Person person)
Method that selects a hydrological source for an agent to use |
void |
setAcceptableDistanceLevel(double acceptableDistanceLevel)
|
void |
setupModelData(java.lang.String file)
Method to setup model data used by a given water use model |
void |
setWaterSourceContexts(java.util.List<HydrologicalUnit> waterSourceContexts)
|
void |
setWeightFactor(double weightFactor)
|
void |
source(Person p)
Method that calls the method for an agent to search for a water source |
void |
updatePeople()
Method updates the people from the community |
void |
updateQuantityBelief(Person person,
HydrologicalUnit hu)
Method updates the belief of an agent on how much water there is for a given water source |
void |
updateQuantityChangeBelief(Person person,
HydrologicalUnit hu)
Method that updates an agents belief about quantity changes in the water source used |
void |
updateQuantityHistory(HydrologicalUnit hu,
Person person,
double quantity)
Method that updates the history kept by an agent about quantities (latest historical values based on length of historical memory) |
void |
updateQuantityMaximum(HydrologicalUnit hu,
Person person,
double waterToCollect)
Method to see if the water collected is an amount among the record high amounts of water collected in agent memory |
void |
updateQuantityMinimum(HydrologicalUnit hu,
Person person,
double waterToCollect)
Method that checks to see if the water quantity is among the minimum amounts kept in memory by an agent |
void |
updateQuantityRecord(HydrologicalUnit hu,
Person person,
double quantity)
Method that calls methods that updates different quantity related values (history, minimum, maximum, quantity belief, and quantity change belief) |
void |
updateSourcePreferences(Person p)
Method updates an agents preference for water sources |
void |
visitWeightedPreference(Person p)
Method to give weights to sources visited |
double[] |
weightWaterByDistance(Person person,
int size)
Weight water sources by distance |
Methods inherited from class uaa.feral.social.waterUse.WaterUseBehaviors |
---|
CreateWaterUseModel, getScenarioData, isDegradeQualityMode, isLargeSimulation, isUpdatePreferences, setDegradeQualityMode, setLargeSimulation, setScenarioData, setUpdatePreferences |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SocialDistancing(Community community)
community
- a community that will implement modelMethod Detail |
---|
public double noisyQuantity(HydrologicalUnit hu)
hu
- the hydrological unit used by an agent
public void degradeWaterQuantity()
public void degradeWaterQuality()
public void initializeWater()
public void initialValues()
public void resetValues()
public void organizeWaterForPeople(Person person)
person
- a person agentpublic void moveToWaterSource(Person p)
p
- a person agentpublic void bayesianPreference(HydrologicalUnit hu, Person p)
hu
- a hydrological unit objectp
- a person agentpublic void visitWeightedPreference(Person p)
p
- a person agentpublic void moveToMunicipalWaterSource(Person p)
p
- a person agentpublic void moveToNaturalWaterSource(Person p)
p
- a person agentpublic int[] createValues(int size, int initValue)
size
- the size of an arrayinitValue
- the initial values in the array
public double[] createValues(int size, double initValue)
size
- the size of the arrayinitValue
- the initial values in the arrray
public double getWeightFactor()
public void setWeightFactor(double weightFactor)
public void runModel()
runModel
in interface GeneralModel
runModel
in class WaterUseBehaviors
public void updatePeople()
public void determineSize(HydrologicalSetting hs)
hs
- a hydrological systempublic void returnHome(Person p)
p
- public void askAgents()
public void checkPerson(Person p)
p
- a person agentpublic double[] weightWaterByDistance(Person person, int size)
size
- number of water sources
public void source(Person p)
p
- a person agentpublic void updateSourcePreferences(Person p)
p
- a person agentpublic HydrologicalUnit selectWaterSource(Person person)
person
- a person agent
public void collectWater(Person person, HydrologicalUnit hu)
person
- a person agenthu
- a hydroloigical unit sourcepublic void updateQuantityRecord(HydrologicalUnit hu, Person person, double quantity)
hu
- the hydrological unitperson
- a person agenthydrological
- unit quantity to updatepublic void updateQuantityHistory(HydrologicalUnit hu, Person person, double quantity)
hu
- a hydrological unitperson
- person agentquantity
- the quantity to update in memorypublic void updateQuantityMinimum(HydrologicalUnit hu, Person person, double waterToCollect)
hu
- a hydrological unitperson
- a person agentwaterToCollect
- amount of water collectedpublic void updateQuantityMaximum(HydrologicalUnit hu, Person person, double waterToCollect)
hu
- the hydrological unitperson
- a person agentwaterToCollect
- the amount of water collectedpublic double ageWeighted(double[] timeSeries)
timeSeries
- time series values
public double[] preferenceWeighted(Person person, double[] belief)
person
- an agent that will update his/her preference for water sourcesbelief
- belief values associated with water source
public void updateQuantityBelief(Person person, HydrologicalUnit hu)
person
- a person agenthu
- a hydrological unitpublic void removeAgent(Person p)
p
- a person agentpublic void updateQuantityChangeBelief(Person person, HydrologicalUnit hu)
person
- a person agenthu
- a hydrological unitpublic void setupModelData(java.lang.String file)
GeneralModel
setupModelData
in interface GeneralModel
setupModelData
in class WaterUseBehaviors
file
- the file to use for model datapublic java.util.List<HydrologicalUnit> getWaterSourceContexts()
public void setWaterSourceContexts(java.util.List<HydrologicalUnit> waterSourceContexts)
public double getAcceptableDistanceLevel()
public void setAcceptableDistanceLevel(double acceptableDistanceLevel)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |