uk.ac.ucl.casa.andrew.phd.segModelPolygonRandom
Class UrbanAgent

java.lang.Object
  extended byuk.ac.ucl.casa.andrew.phd.segModelPolygonRandom.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

THis class extends the basicPolygon class and allows polgygons to be agents

Author:
Andrew Crooks
Centre for Advanced Spatial Analysis, University College London.

Field Summary
(package private)  double area
           
(package private)  int gisAgentIndex
           
(package private)  boolean happy
           
(package private)  double id
           
(package private)  SegGISModelRandom model
           
private  java.util.ArrayList myNeighbors
           
(package private)  int[] neighbors
           
(package private)  int numberOfTimeChanged
           
(package private)  com.bbn.openmap.omGraphics.OMGraphic omGraphic
           
(package private)  double population
           
(package private)  java.lang.String socclass
           
(package private)  com.vividsolutions.jts.geom.MultiPolygon the_geom
           
(package private)  java.lang.String type
           
(package private)  java.lang.String ward
           
 
Constructor Summary
UrbanAgent()
           
 
Method Summary
 double determineLandUse()
           
 void evaluateAndSetHappiness(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.
 double getAREA()
           
 double getAreaJTS()
           
 java.awt.Paint getFillPaint()
           
 com.vividsolutions.jts.geom.Geometry getGeometry()
           
 int getGisAgentIndex()
           
 boolean getHappyness()
          Gets the current agents Happyness (either true or false)
 double getid_id()
           
 java.util.ArrayList getMyNeighbors()
          Gets the agents neighbours
 int[] getNeighbors()
           
 int getNumberOfTimeChanged()
           
 com.bbn.openmap.omGraphics.OMGraphic getOMGraphic()
           
 double getPopModel()
           
 double getPOPU()
           
 java.lang.String getSOC()
           
 java.lang.String getSocialClass()
           
 java.lang.String getType()
          Gets the agents type
 java.lang.String getWARD_ID()
           
 java.lang.String[] gisPropertyList()
           
 void move(java.util.ArrayList urbanAgentList, java.lang.String type)
          If the agent is unhappy in its current location it moves to an empty area.
 void postStep(java.util.ArrayList urbanAgentList)
           
 void preStep()
           
 void setAREA(double area)
           
 void setGisAgentIndex(int index)
           
 void setHappyness(boolean residentHappy)
          Sets the current agents Happyness(either true or false)
 void setid_id(java.lang.Double id_id)
           
 void setModel(SegGISModelRandom model)
           
 void setMyNeighbors(java.util.ArrayList arraylist)
          Sets the agents neighbours
 void setNeighbors(int[] neighbors)
           
 void setNumberOfTimeChanged(int num)
           
 void setOMGraphic(com.bbn.openmap.omGraphics.OMGraphic arg0)
           
 void setPopModel(double popu)
           
 void setPOPU(java.lang.Double popu)
           
 void setSocialClass(java.lang.String soc)
           
 void setType(java.lang.String string)
          Sets the agents type
 void setWARD_ID(java.lang.String ward_id)
           
 void step(java.util.ArrayList urbanAgentList)
          Does the agent move?
 void testNeighbours(int[] neighbors)
          used as a test to see that the neigbourhood calculation was working currectly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

SegGISModelRandom model

gisAgentIndex

int gisAgentIndex

neighbors

int[] neighbors

type

java.lang.String type

area

double area

population

double population

numberOfTimeChanged

int numberOfTimeChanged

myNeighbors

private java.util.ArrayList myNeighbors

id

double id

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

happy

boolean happy
Constructor Detail

UrbanAgent

public UrbanAgent()
Method Detail

step

public void step(java.util.ArrayList urbanAgentList)
Does the agent move?

Parameters:
urbanAgentList -

move

public void move(java.util.ArrayList urbanAgentList,
                 java.lang.String type)
If the agent is unhappy in its current location it moves to an empty area.

Parameters:
urbanAgentList -
type -

getHappyness

public boolean getHappyness()
Gets the current agents Happyness (either true or false)

Returns:

setHappyness

public void setHappyness(boolean residentHappy)
Sets the current agents Happyness(either true or false)

Parameters:
residentHappy -

evaluateAndSetHappiness

public void evaluateAndSetHappiness(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.

Parameters:
urbanAgentList -

setMyNeighbors

public void setMyNeighbors(java.util.ArrayList arraylist)
Sets the agents neighbours

Parameters:
arraylist -

getMyNeighbors

public java.util.ArrayList getMyNeighbors()
Gets the agents neighbours

Returns:

setType

public void setType(java.lang.String string)
Sets the agents type

Parameters:
string -

getType

public java.lang.String getType()
Gets the agents type

Returns:

preStep

public void preStep()

postStep

public void postStep(java.util.ArrayList urbanAgentList)

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(SegGISModelRandom 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

testNeighbours

public void testNeighbours(int[] neighbors)
used as a test to see that the neigbourhood calculation was working currectly

Parameters:
neighbors -

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)

getGeometry

public com.vividsolutions.jts.geom.Geometry getGeometry()

getAreaJTS

public double getAreaJTS()

getNumberOfTimeChanged

public int getNumberOfTimeChanged()

setNumberOfTimeChanged

public void setNumberOfTimeChanged(int num)

setPOPU

public void setPOPU(java.lang.Double popu)

getPOPU

public double getPOPU()

setPopModel

public void setPopModel(double popu)

getPopModel

public double getPopModel()

setSocialClass

public void setSocialClass(java.lang.String soc)

getSocialClass

public java.lang.String getSocialClass()

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 double getid_id()

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