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

java.lang.Object
  extended byuk.ac.ucl.casa.andrew.phd.segModelPolygon.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)  SegGISModelPolygon 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()
          getHappyness Method * * Gets the current agents Happyness (either true or false) * *
 double getid_id()
           
 java.util.ArrayList getMyNeighbors()
           
 int[] getNeighbors()
           
 int getNumberOfTimeChanged()
           
 com.bbn.openmap.omGraphics.OMGraphic getOMGraphic()
           
 double getPopModel()
           
 double getPOPU()
           
 java.lang.String getSOC()
           
 java.lang.String getType()
           
 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)
          setHappyness Method * * Sets the current agents Happyness(either true or false) * *
 void setid_id(java.lang.Double id_id)
           
 void setModel(SegGISModelPolygon model)
           
 void setMyNeighbors(java.util.ArrayList arraylist)
           
 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 setSOC(java.lang.String soc)
           
 void setType(java.lang.String string)
           
 void setWARD_ID(java.lang.String ward_id)
           
 void step(java.util.ArrayList urbanAgentList)
          Does the agent move?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

SegGISModelPolygon 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 -

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 -

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()
getHappyness Method * * Gets the current agents Happyness (either true or false) * *


setHappyness

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


setMyNeighbors

public void setMyNeighbors(java.util.ArrayList arraylist)

getMyNeighbors

public java.util.ArrayList getMyNeighbors()

setType

public void setType(java.lang.String string)

getType

public java.lang.String getType()

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(SegGISModelPolygon 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)

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

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