|
||||||||||
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.SocialDistancingModified
public class SocialDistancingModified
Modified version of the social distancing model
Constructor Summary | |
---|---|
SocialDistancingModified(Community community)
Main constructor for object |
Method Summary | |
---|---|
void |
adjustViewsOfOtherSources(Person person,
HydrologicalUnit hu)
Method to determine perception of other sources |
void |
askAgents()
Method that allows agents to get water and update values associated with water (quantity and quality) and perceptions of water |
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 |
determineSize(HydrologicalSetting hs)
Method determines the size or number of water sources from a given system |
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 |
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 |
setupModelData(java.lang.String file)
Method to setup model data used by a given water use model |
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 SocialDistancingModified(Community community)
community
- a community that will implement modelMethod Detail |
---|
public void degradeWaterQuality()
public void initializeWater()
public void initialValues()
public double noisyQuantity(HydrologicalUnit hu)
hu
- the hydrological unit used by an agent
public void updatePeople()
public void returnHome(Person p)
p
- public void moveToMunicipalWaterSource(Person p)
p
- a person agentpublic void runModel()
runModel
in interface GeneralModel
runModel
in class WaterUseBehaviors
public void moveToNaturalWaterSource(Person p)
p
- a person agentpublic void moveToWaterSource(Person p)
p
- a person agentpublic void askAgents()
public 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 void checkPerson(Person p)
p
- a person agentpublic void organizeWaterForPeople(Person person)
person
- 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 adjustViewsOfOtherSources(Person person, HydrologicalUnit hu)
person
- a person objecthu
- a hydrological unitpublic void updateQuantityBelief(Person person, HydrologicalUnit hu)
person
- a person agenthu
- a hydrological unitpublic void updateQuantityChangeBelief(Person person, HydrologicalUnit hu)
person
- a person agenthu
- a hydrological unitpublic 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 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 void setupModelData(java.lang.String file)
GeneralModel
setupModelData
in interface GeneralModel
setupModelData
in class WaterUseBehaviors
file
- the file to use for model datapublic void determineSize(HydrologicalSetting hs)
hs
- a hydrological systempublic void visitWeightedPreference(Person p)
p
- a person agentpublic void removeAgent(Person p)
p
- a person agent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |