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

java.lang.Object
  extended byuchicago.src.sim.engine.SimModelImpl
      extended byuk.ac.ucl.casa.andrew.phd.segModelPolygonRandom.SegGISModelRandom
All Implemented Interfaces:
uchicago.src.reflector.DescriptorContainer, uchicago.src.sim.engine.SimEventProducer, uchicago.src.sim.engine.SimModel

public class SegGISModelRandom
extends uchicago.src.sim.engine.SimModelImpl

All the models up to this point have focused on agents moving within the environment to which they are located. What has become noticeable is the importance of space especially the development of empty space when segregation emerges. This model moves away from representing agents as points, to representing them as polygons, such as building outlines or groups of individuals aggregated into wards. The aim of this model is to explore the importance of empty space on the pattern of segregation that emerges. As with previous models, this extends the basic model. However instead of creating point agents of different types based on population fields held within the data file of the shapefile, polygon agents are created, while this is done randomly agents can be created based on the dominant social group of the area held within the data file if required (see segModelPolygonRandom model) . Within the model, two types of agents are created either of type red or blue, while a certain percentage of area remains unoccupied (black). Each polygon knows which other polygons share a common edge to it. These neighbourhoods are stored within the .GAL file Each polygon has different numbers of neighbours, therefore areas that are separated by geographical features such as rivers are not considered neighbours. What drives the model is the neighbourhood composition, as with the basic segregation model; agents want to live in an area where a certain percentage of their neighbours are of the same type as itself. This is calculated using the neighbours that share a common edge to the agent in question. If an agent is dissatisfied with its current neighbourhood it will move to a random empty polygon, regardless of whether or not this new location meets its preference. This was done to force the agents to move. For example if the agents only moved to areas where there preferences could be matched and there where no areas where this could be achieved, the system would not evolve. As unlike the basic segregation models agents are not removed. Each time an agent moves from an occupied to an unoccupied area, a counter is updated on the area where the agent has just moved to therefore allowing one to study how often agents move throughout the course of a simulation.

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

Nested Class Summary
(package private)  class SegGISModelRandom.happystatsBlue
           
(package private)  class SegGISModelRandom.happystatsReds
           
(package private)  class SegGISModelRandom.unhappystatsBlue
           
(package private)  class SegGISModelRandom.unhappystatsReds
           
(package private)  class SegGISModelRandom.unoccupiedstats
           
 
Field Summary
(package private) static java.lang.String datasource1
           
(package private)  javax.swing.JFileChooser fileChooser
           
(package private)  OpenMapData gisData
           
(package private) static java.lang.String neighbourhoodFile1
           
private  uchicago.src.sim.gui.Legend newlegend
           
(package private)  anl.repast.gis.display.OpenMapDisplay omDisplay
           
(package private)  double perBlue
           
(package private)  double PERBLUE
           
(package private)  double perRed
           
(package private)  double PERRED
           
private  uchicago.src.sim.analysis.OpenSequenceGraph recorderHappyAgentsGraph
           
private  uchicago.src.sim.analysis.DataRecorder recorderLanduse
           
(package private) static boolean saveDataOn
           
(package private)  uchicago.src.sim.engine.Schedule schedule
           
private  int simulationSpeed
           
(package private) static boolean snapshotOn
           
(package private)  int STEP_NUM
           
(package private)  double toleranceBlue
           
(package private)  double TOLERANCEBLUE
           
(package private)  double toleranceRed
           
(package private)  double TOLERANCERED
           
(package private)  double totalArea
           
(package private)  double unoccupied
           
(package private)  double UNOCCUPIED
           
(package private)  java.util.ArrayList urbanAgentList
           
 
Fields inherited from class uchicago.src.sim.engine.SimModelImpl
descriptors, modelManipulator
 
Constructor Summary
SegGISModelRandom()
           
 
Method Summary
 void begin()
           
 void buildDisplay()
           
 void buildModel()
           
 void buildSchedule()
          Schedules the execution of the specified method (ie step)on the specified object(ie this model) to start at the specified clock tick and continue every tick thereafter.
 void closeModel()
          Checks to see if all the agents are happy.
 void createShapefileForUrbanAgent()
           
 java.lang.String[] getInitParam()
           
 java.lang.String getName()
           
 java.util.ArrayList getNeighborAgents(int[] neighbors)
          Tells the polgon agent what is next to what neighbours comes from .GAL file
 double getPerBlue()
           
 double getPerRed()
           
 boolean getSaveDataOn()
           
 uchicago.src.sim.engine.Schedule getSchedule()
          Schedule manages the execution of BasicAction accoriding to the simulation clock.
 boolean getSnapshotOn()
           
 int getSTEP_NUM()
           
 double getToleranceBlue()
           
 double getToleranceRed()
           
 double getUnoccupied()
           
 java.util.ArrayList getUrbanAgentList()
           
static void main(java.lang.String[] args)
           
 void postStep()
           
 void preStep()
           
 void reset()
          The reset mmethod is called whenever the model is reset.
 void saveGALFile()
           
 void saveShapefile()
          Any change to the urban layer is saved to a new shapefile Which is time stamped and a new GAL file is also created which corresponds to the new shapefile created.
 void setPerBlue(double d)
           
 void setPerRed(double d)
           
 void setSaveDataOn(boolean show)
           
 void setSnapshotOn(boolean show)
           
 void setSTEP_NUM(int step_num)
           
 void setToleranceBlue(double d)
           
 void setToleranceRed(double d)
           
 void setUnoccupied(double d)
           
 void setup()
           
 void setUrbanAgentList(java.util.ArrayList agentList)
           
 void step()
           
 void takesnapshot()
           
 
Methods inherited from class uchicago.src.sim.engine.SimModelImpl
addPropertyListener, addSimEventListener, clearMediaProducers, clearPropertyListeners, fireBooleanPropertyEvent, fireEndSim, fireNumericPropertyEvent, fireObjectPropertyEvent, firePauseSim, fireSimEvent, fireStopSim, fireStringPropertyEvent, generateNewSeed, getController, getMediaProducers, getModelManipulator, getParameterDescriptors, getPropertiesValues, getRngSeed, getTickCount, pause, registerDisplaySurface, registerMediaProducer, removePropertyListener, removeSimEventListener, setController, setRngSeed, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileChooser

javax.swing.JFileChooser fileChooser

PERRED

double PERRED

PERBLUE

double PERBLUE

UNOCCUPIED

double UNOCCUPIED

TOLERANCERED

double TOLERANCERED

TOLERANCEBLUE

double TOLERANCEBLUE

toleranceRed

double toleranceRed

toleranceBlue

double toleranceBlue

perRed

double perRed

perBlue

double perBlue

unoccupied

double unoccupied

totalArea

double totalArea

snapshotOn

static boolean snapshotOn

saveDataOn

static boolean saveDataOn

datasource1

static java.lang.String datasource1

neighbourhoodFile1

static java.lang.String neighbourhoodFile1

gisData

OpenMapData gisData

omDisplay

anl.repast.gis.display.OpenMapDisplay omDisplay

urbanAgentList

java.util.ArrayList urbanAgentList

schedule

uchicago.src.sim.engine.Schedule schedule

STEP_NUM

int STEP_NUM

simulationSpeed

private int simulationSpeed

recorderLanduse

private uchicago.src.sim.analysis.DataRecorder recorderLanduse

recorderHappyAgentsGraph

private uchicago.src.sim.analysis.OpenSequenceGraph recorderHappyAgentsGraph

newlegend

private uchicago.src.sim.gui.Legend newlegend
Constructor Detail

SegGISModelRandom

public SegGISModelRandom()
Method Detail

main

public static void main(java.lang.String[] args)

begin

public void begin()

buildModel

public void buildModel()

buildDisplay

public void buildDisplay()

buildSchedule

public void buildSchedule()
Schedules the execution of the specified method (ie step)on the specified object(ie this model) to start at the specified clock tick and continue every tick thereafter.


closeModel

public void closeModel()
Checks to see if all the agents are happy. if they are the model will close.


step

public void step()

preStep

public void preStep()

postStep

public void postStep()

getNeighborAgents

public java.util.ArrayList getNeighborAgents(int[] neighbors)
Tells the polgon agent what is next to what neighbours comes from .GAL file

Parameters:
neighbors -
Returns:

setup

public void setup()

reset

public void reset()
The reset mmethod is called whenever the model is reset. Everything is reset to null


getSchedule

public uchicago.src.sim.engine.Schedule getSchedule()
Schedule manages the execution of BasicAction accoriding to the simulation clock. Actions schedulled on a schedule will be executed in a random order.


saveShapefile

public void saveShapefile()
Any change to the urban layer is saved to a new shapefile Which is time stamped and a new GAL file is also created which corresponds to the new shapefile created.


createShapefileForUrbanAgent

public void createShapefileForUrbanAgent()

takesnapshot

public void takesnapshot()

saveGALFile

public void saveGALFile()

getName

public java.lang.String getName()

getInitParam

public java.lang.String[] getInitParam()

getSaveDataOn

public boolean getSaveDataOn()

setSaveDataOn

public void setSaveDataOn(boolean show)

getSnapshotOn

public boolean getSnapshotOn()

setSnapshotOn

public void setSnapshotOn(boolean show)

setUnoccupied

public void setUnoccupied(double d)

getUnoccupied

public double getUnoccupied()

setPerBlue

public void setPerBlue(double d)

getPerBlue

public double getPerBlue()

setPerRed

public void setPerRed(double d)

getPerRed

public double getPerRed()

setToleranceRed

public void setToleranceRed(double d)

getToleranceRed

public double getToleranceRed()

setToleranceBlue

public void setToleranceBlue(double d)

getToleranceBlue

public double getToleranceBlue()

getUrbanAgentList

public java.util.ArrayList getUrbanAgentList()

setUrbanAgentList

public void setUrbanAgentList(java.util.ArrayList agentList)

getSTEP_NUM

public int getSTEP_NUM()

setSTEP_NUM

public void setSTEP_NUM(int step_num)