|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.ucl.casa.andrew.phd.segregationModelRestricted.Resident
Field Summary | |
(package private) static java.util.ArrayList |
agentCouldNotGetHappyInOriginalArea
|
(package private) int |
gisResidentAgentIndex
|
(package private) boolean |
happy
|
(package private) static int |
idCounter
|
(package private) float |
movementOfResident
|
(package private) int |
noTimesMoved
|
(package private) com.bbn.openmap.omGraphics.OMCircle |
omCircle
|
(package private) static java.util.ArrayList |
removedResidentList
|
(package private) java.lang.String |
socclass
|
Constructor Summary | |
Resident(float lat,
float lon,
float radius,
java.lang.String socclass,
boolean happy)
|
Method Summary | |
java.util.ArrayList |
agentsInSameArea(java.util.ArrayList urbanAgents,
java.util.ArrayList residentAgents)
Designed to stop the agents from moving outside thier original area, finds all the residents that are within the urban area. |
void |
bigMovementForResident()
|
void |
calculateDistanceToAgentsOfSameType(java.util.ArrayList residentsList,
java.util.ArrayList urbanAgentsList,
float movetoWithin)
If the Agent is unhappy it moves. |
void |
calculateDistanceToAgentsOfSameTypeRestricited(java.util.ArrayList newReturnResList,
java.util.ArrayList geoemtryofLocalPoygon,
java.util.ArrayList urbanAgentList,
java.util.ArrayList residentsList,
float movetoWithin)
Same as calculateDistanceToAgentsOfSameType but uses a restricted geoemtry of the urban agent |
void |
calculateNeigbours(java.util.ArrayList residentsList,
java.util.ArrayList urbanAgentList)
Caluculates the types of nighbousrs based on Social classs and uses the hashmap from the neighboursWithin method to do this. |
static java.util.HashMap |
countNeibourhingAgents(java.util.ArrayList residents)
Takes the parameter residents and caluclates The method returns a hashMap and is used in percentageOfNeibourhingAgents |
void |
evaluateAndSetHappiness(java.util.ArrayList residentsList,
java.util.ArrayList urbanAgentList)
Evaluates and sets the agents happyness based on its surrounding neighbourhood and the agents indervidial prefferences for differnet types of agents. |
ResidentArrayList |
findNearestNeighbourOfSameType(java.util.ArrayList residentsList)
If the Agent is unhappy it moves. |
java.awt.Paint |
getFillPaint()
|
com.vividsolutions.jts.geom.Geometry |
getGeometryResdient()
This method gets the lat & longeting of the omCircle (agents) goeometry and creates a new point for the agent which is then passed to the isInUnionGeometry method to check that the can move, see if each omCircle agent is within UrbanAgent bounding box. |
int |
getGisAgentIndex()
|
boolean |
getHappyness()
|
float |
getLat()
|
com.bbn.openmap.LatLonPoint |
getLatLon()
|
float |
getLon()
|
int[] |
getNeighbors()
|
int |
getNumberOfTimesAgentMoved()
|
com.bbn.openmap.omGraphics.OMGraphic |
getOMGraphic()
|
float |
getRadius()
|
java.lang.String |
getsoc()
|
java.lang.String[] |
gisPropertyList()
|
boolean |
isInUnionGeometry(java.util.ArrayList urbanAgentsList)
Tests to see if resdient agent is within an urban agent which is used in stepRestrictTo method, the mthod takes the ArrayList from Urban Agent (therefore inherits all the properties from Urban agent (especially the union geoemtry)and uses it to see if the agent can move. |
void |
moveAgentUntilHappy(java.util.ArrayList residentsList,
java.util.ArrayList urbanAgentsList,
anl.repast.gis.display.OpenMapDisplay omDisplay,
float movetoWithin,
float movementOfResident)
This method will only move the agents that are unhappy, each agent is moved until it finds an area where it is happy to live. |
void |
moveAgentUntilHappyRestricted(java.util.ArrayList residentsList,
java.util.ArrayList urbanAgentsList,
float movetoWithin,
float movementOfResident)
This is the same as moveAgentUntilHappy however a local geoemerty is used based on the urban agent |
void |
movement(float movementOfResident)
Governs how far an agent can move in any time step, takes the SegGISModel.movement movement paremater as the distance for random movement in both X and Y Directions. |
void |
movementForNewResdient()
|
java.util.ArrayList |
neighboursWithin(java.util.ArrayList residentsList,
java.util.ArrayList urbanAgentList)
finds which resident agents are within a specified radius of a specific agent using a buffering mechansim from JTS. |
com.vividsolutions.jts.geom.Point |
newAgentAtCentrePoint(java.util.ArrayList urbanAgents)
|
static int |
numberOfTimesAgentMoved()
|
static java.util.HashMap |
percentageOfNeibourhingAgents(java.util.ArrayList residentsList)
Takes the parameter residents and uses the method countNeibourhingAgents and is called in the calculateNeigbours method after summaryOfNeibourhingAgents has been called and caluclates the percentage of neighbours at a specific distance (buffer). |
java.util.ArrayList |
polygonOfAgent(java.util.ArrayList urbanAgents,
java.util.ArrayList residentAgents)
Designed to stop the agents from moving outside thier original area |
void |
postStep(java.util.ArrayList residents,
java.util.ArrayList urbanAgentList)
|
void |
preStep(java.util.ArrayList residents,
java.util.ArrayList urbanAgentsList)
|
static com.vividsolutions.jts.geom.Point |
randomPointforNewAgent(java.util.ArrayList urbanAgentList)
This method creates a new point for the agent to be placed randomly within the urban area using JTS CoordinateArrays class http://vividsolutions.com/jts/javadoc/com/vividsolutions/jts/geom/CoordinateArrays.html The method first finds the max and min x and y values and creates a random new point between these values, and then checks to see if the agent is within the urban layer extent if not, a new random point is chosen until it returns true. |
void |
reallyBigBigMovementForResident()
|
void |
reallyBigMovementForResident()
|
void |
setGisAgentIndex(int index)
|
void |
setHappyness(boolean residentHappy)
Sets the current agents Happyness(either true or false) |
void |
setLat(float lat)
|
void |
setLatLon(float lat,
float lon)
|
void |
setLon(float lon)
|
void |
setNeighbors(int[] neighbours)
|
void |
setNumberOfTimesAgentMoved(int noTimesMoved)
|
void |
setOMGraphic(com.bbn.openmap.omGraphics.OMGraphic omg)
|
void |
setRadius(float newrad)
|
void |
setsoc(java.lang.String socialclass)
|
void |
smallMovementForNewResdient()
|
void |
step(java.util.ArrayList residentsList,
java.util.ArrayList urbanAgentsList,
anl.repast.gis.display.OpenMapDisplay omDisplay,
float movetoWithin,
float movementOfResident)
What the urban agents do in each time step, I have tried to to keep this simple, but it calls on a number of other methods Parameters taken include residents,ArrayList urbanAgents, OpenMapDisplay omDisplay, which are passed on from SegGISModel |
void |
stepRestrictTo(java.util.ArrayList residentsList,
java.util.ArrayList urbanAgentsList,
anl.repast.gis.display.OpenMapDisplay omDisplay)
used to restrict movement of the agents within a shapefile. |
void |
stepRestrictToForNewResident(java.util.ArrayList residentsList,
java.util.ArrayList urbanAgentsList,
anl.repast.gis.display.OpenMapDisplay omDisplay,
float movetoWithin,
float movementOfResident)
To ensure that the current resedient is actually created the area of interest, once the resident agent has been created stepRestrictToForNewResident mehod is called. |
java.util.ArrayList |
summaryOfNeibourhingAgents(java.util.ArrayList residentsList,
java.util.ArrayList urbanAgentList)
Takes the parameter residents and caluclates the number of neighbours at a specific distance (buffer) and is used in calculateNeigbours method. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
com.bbn.openmap.omGraphics.OMCircle omCircle
static int idCounter
static java.util.ArrayList removedResidentList
static java.util.ArrayList agentCouldNotGetHappyInOriginalArea
int gisResidentAgentIndex
int noTimesMoved
java.lang.String socclass
float movementOfResident
boolean happy
Constructor Detail |
public Resident(float lat, float lon, float radius, java.lang.String socclass, boolean happy)
Method Detail |
public void preStep(java.util.ArrayList residents, java.util.ArrayList urbanAgentsList)
public void step(java.util.ArrayList residentsList, java.util.ArrayList urbanAgentsList, anl.repast.gis.display.OpenMapDisplay omDisplay, float movetoWithin, float movementOfResident)
residentsList
- urbanAgentsList
- omDisplay
- movetoWithin
- movementOfResident
- public void postStep(java.util.ArrayList residents, java.util.ArrayList urbanAgentList)
residents
- urbanAgentList
- public int getNumberOfTimesAgentMoved()
public void setNumberOfTimesAgentMoved(int noTimesMoved)
public static int numberOfTimesAgentMoved()
public void evaluateAndSetHappiness(java.util.ArrayList residentsList, java.util.ArrayList urbanAgentList)
residentsList
- urbanAgentList
- public com.vividsolutions.jts.geom.Point newAgentAtCentrePoint(java.util.ArrayList urbanAgents)
public static com.vividsolutions.jts.geom.Point randomPointforNewAgent(java.util.ArrayList urbanAgentList)
urbanAgentList
-
public void stepRestrictToForNewResident(java.util.ArrayList residentsList, java.util.ArrayList urbanAgentsList, anl.repast.gis.display.OpenMapDisplay omDisplay, float movetoWithin, float movementOfResident)
residentsList
- urbanAgentsList
- omDisplay
- movetoWithin
- movementOfResident
- public void stepRestrictTo(java.util.ArrayList residentsList, java.util.ArrayList urbanAgentsList, anl.repast.gis.display.OpenMapDisplay omDisplay)
residentsList
- urbanAgentsList
- omDisplay
- public ResidentArrayList findNearestNeighbourOfSameType(java.util.ArrayList residentsList)
residentsList
-
public void calculateDistanceToAgentsOfSameType(java.util.ArrayList residentsList, java.util.ArrayList urbanAgentsList, float movetoWithin)
residentsList
- urbanAgentsList
- movetoWithin
- public void calculateDistanceToAgentsOfSameTypeRestricited(java.util.ArrayList newReturnResList, java.util.ArrayList geoemtryofLocalPoygon, java.util.ArrayList urbanAgentList, java.util.ArrayList residentsList, float movetoWithin)
newReturnResList
- geoemtryofLocalPoygon
- urbanAgentList
- residentsList
- movetoWithin
- public void moveAgentUntilHappy(java.util.ArrayList residentsList, java.util.ArrayList urbanAgentsList, anl.repast.gis.display.OpenMapDisplay omDisplay, float movetoWithin, float movementOfResident)
residentsList
- urbanAgentsList
- omDisplay
- movetoWithin
- movementOfResident
- public void moveAgentUntilHappyRestricted(java.util.ArrayList residentsList, java.util.ArrayList urbanAgentsList, float movetoWithin, float movementOfResident)
residentsList
- urbanAgentsList
- movetoWithin
- movementOfResident
- public java.util.ArrayList polygonOfAgent(java.util.ArrayList urbanAgents, java.util.ArrayList residentAgents)
urbanAgents
- residentAgents
-
public java.util.ArrayList agentsInSameArea(java.util.ArrayList urbanAgents, java.util.ArrayList residentAgents)
urbanAgents
- residentAgents
-
public com.vividsolutions.jts.geom.Geometry getGeometryResdient()
public boolean isInUnionGeometry(java.util.ArrayList urbanAgentsList)
urbanAgentsList
-
public void movement(float movementOfResident)
movementOfResident
- public void smallMovementForNewResdient()
public void movementForNewResdient()
public void bigMovementForResident()
public void reallyBigMovementForResident()
public void reallyBigBigMovementForResident()
public void calculateNeigbours(java.util.ArrayList residentsList, java.util.ArrayList urbanAgentList)
residentsList
- urbanAgentList
- public java.util.ArrayList neighboursWithin(java.util.ArrayList residentsList, java.util.ArrayList urbanAgentList)
public java.util.ArrayList summaryOfNeibourhingAgents(java.util.ArrayList residentsList, java.util.ArrayList urbanAgentList)
residentsList
- urbanAgentList
-
public static java.util.HashMap countNeibourhingAgents(java.util.ArrayList residents)
residents
-
public static java.util.HashMap percentageOfNeibourhingAgents(java.util.ArrayList residentsList)
residentsList
-
public boolean getHappyness()
public void setHappyness(boolean residentHappy)
public float getLat()
public float getLon()
public com.bbn.openmap.LatLonPoint getLatLon()
public void setLatLon(float lat, float lon)
public float getRadius()
public void setRadius(float newrad)
public void setLat(float lat)
public void setLon(float lon)
public void setsoc(java.lang.String socialclass)
public java.lang.String getsoc()
public java.awt.Paint getFillPaint()
getFillPaint
in interface anl.repast.gis.OpenMapAgent
public com.bbn.openmap.omGraphics.OMGraphic getOMGraphic()
getOMGraphic
in interface anl.repast.gis.OpenMapAgent
public void setOMGraphic(com.bbn.openmap.omGraphics.OMGraphic omg)
setOMGraphic
in interface anl.repast.gis.OpenMapAgent
public int getGisAgentIndex()
getGisAgentIndex
in interface anl.repast.gis.GisAgent
public void setGisAgentIndex(int index)
setGisAgentIndex
in interface anl.repast.gis.GisAgent
public java.lang.String[] gisPropertyList()
gisPropertyList
in interface anl.repast.gis.GisAgent
public void setNeighbors(int[] neighbours)
setNeighbors
in interface anl.repast.gis.GisAgent
public int[] getNeighbors()
getNeighbors
in interface anl.repast.gis.GisAgent
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |