uk.ac.ucl.casa.andrew.phd.segModelPreferencesForBothDislike
Class UrbanAgent
java.lang.Object
uk.ac.ucl.casa.andrew.phd.segModelPreferencesForBothDislike.UrbanAgent
- All Implemented Interfaces:
- anl.repast.gis.GisAgent, anl.repast.gis.OpenMapAgent
- public class UrbanAgent
- extends java.lang.Object
- implements anl.repast.gis.OpenMapAgent, anl.repast.gis.GisAgent
Extends basic polygon agent and acts as a container for resident agents
- Author:
- Andrew Crooks
Centre for Advanced Spatial Analysis, University College London.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
static org.apache.log4j.Category log
residentAgents
private java.util.ArrayList residentAgents
urbanAgentList
private java.util.ArrayList urbanAgentList
model
SegGISModel model
gisAgentIndex
int gisAgentIndex
neighbors
int[] neighbors
landuse
int landuse
type
int type
area
double area
population
double population
id
double id
determinepop
int determinepop
totalResCountPerCell
int totalResCountPerCell
omGraphic
com.bbn.openmap.omGraphics.OMGraphic omGraphic
the_geom
com.vividsolutions.jts.geom.MultiPolygon the_geom
socclass
java.lang.String socclass
ward
java.lang.String ward
placementOfAgents
private java.lang.Object placementOfAgents
numResidentAgents
private int numResidentAgents
Point
private com.vividsolutions.jts.geom.Point Point
randomPoints
private com.bbn.openmap.omGraphics.OMPoint randomPoints
socResident
private java.lang.String socResident
ageResident
private int ageResident
unionGeometry
private static com.vividsolutions.jts.geom.Geometry unionGeometry
bufferedUnionGeometry
private static com.vividsolutions.jts.geom.Geometry bufferedUnionGeometry
redPopPercentage
int redPopPercentage
bluePopPercentage
int bluePopPercentage
redPopulationRedisdents
int redPopulationRedisdents
bluePopulationRedisdents
int bluePopulationRedisdents
totalPopulationRedisdents
int totalPopulationRedisdents
actuualPopRed
int actuualPopRed
actualPopBlue
int actualPopBlue
UrbanAgent
public UrbanAgent()
reset
public static void reset()
getBufferedGeometry
public static com.vividsolutions.jts.geom.Geometry getBufferedGeometry(java.util.ArrayList urbanAgentList)
- This method creates a new geometry off the bounding area and *
is used in randomPointforNewAgent method because it was *
noticed that due to rounding errors of switching from an *
Vivid slolutions Point to OMCircle (float) that the Lat and *
often changed by a few 0.00 decimal degrees therefore the new *
agent would be drawn outside of the area which is a problem *
when trying to move the agent is steprestrict
- Parameters:
urbanAgentList
-
- Returns:
setResidentAgents
public void setResidentAgents(java.util.ArrayList residentAgents)
- called by SegGISModel.buildModel method, creates resident agents *
for each urban agent. The method is only called in the build *
model process.
- Parameters:
residentAgents
-
socialClassOfUrbanAgent
public void socialClassOfUrbanAgent()
- Takes a list of residents and calucates the landuse within a
a polygon based on the agents present.
step
public void step()
preStep
public void preStep()
postStep
public void postStep(java.util.ArrayList urbanAgentList)
setUpResidents
public void setUpResidents()
randomPoint
public com.bbn.openmap.omGraphics.OMPoint randomPoint()
determineLandUse
public double determineLandUse()
getGisAgentIndex
public int getGisAgentIndex()
- Specified by:
getGisAgentIndex
in interface anl.repast.gis.GisAgent
setGisAgentIndex
public void setGisAgentIndex(int index)
- Specified by:
setGisAgentIndex
in interface anl.repast.gis.GisAgent
setModel
public void setModel(SegGISModel model)
gisPropertyList
public java.lang.String[] gisPropertyList()
- Specified by:
gisPropertyList
in interface anl.repast.gis.GisAgent
setNeighbors
public void setNeighbors(int[] neighbors)
- Specified by:
setNeighbors
in interface anl.repast.gis.GisAgent
getNeighbors
public int[] getNeighbors()
- Specified by:
getNeighbors
in interface anl.repast.gis.GisAgent
getFillPaint
public java.awt.Paint getFillPaint()
- Specified by:
getFillPaint
in interface anl.repast.gis.OpenMapAgent
getAREA
public double getAREA()
setAREA
public void setAREA(double area)
getAreaJTS
public double getAreaJTS()
setRED
public void setRED(int red)
getRED
public int getRED()
setBLUE
public void setBLUE(int blue)
getBLUE
public int getBLUE()
setPOPU
public void setPOPU(java.lang.Double popu)
getPOPU
public java.lang.Double getPOPU()
setLANDUSE
public void setLANDUSE(int landuse)
getLANDUSE
public int getLANDUSE()
setSOC
public void setSOC(java.lang.String soc)
getSOC
public java.lang.String getSOC()
setWARD_ID
public void setWARD_ID(java.lang.String ward_id)
getWARD_ID
public java.lang.String getWARD_ID()
setid_id
public void setid_id(java.lang.Double id_id)
getid_id
public java.lang.Double getid_id()
determinepop
public int determinepop()
determinPopulationPercentage
public void determinPopulationPercentage()
soccialclassShouldbe
public java.util.HashMap soccialclassShouldbe()
setREDNO
public void setREDNO(int actuualPopRed)
getREDNO
public int getREDNO()
setBLUENO
public void setBLUENO(int actualPopBlue)
getBLUENO
public int getBLUENO()
setdeterminepop
public void setdeterminepop(int determinepop)
getdeterminepop
public int getdeterminepop()
getOMGraphic
public com.bbn.openmap.omGraphics.OMGraphic getOMGraphic()
- Specified by:
getOMGraphic
in interface anl.repast.gis.OpenMapAgent
setOMGraphic
public void setOMGraphic(com.bbn.openmap.omGraphics.OMGraphic arg0)
- Specified by:
setOMGraphic
in interface anl.repast.gis.OpenMapAgent
getGeometry
public com.vividsolutions.jts.geom.Geometry getGeometry()
getUnion
public static com.vividsolutions.jts.geom.Geometry getUnion(java.util.ArrayList urbanAgentList)
urbanAgentContainsResidents
public java.util.ArrayList urbanAgentContainsResidents(boolean popdensityOff)
popDensity
public double popDensity(boolean popdensityOff)
countResidentTypes
public static java.util.HashMap countResidentTypes(java.util.ArrayList residents)
percentageResidentTypes
public static java.util.HashMap percentageResidentTypes(java.util.ArrayList residents)