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

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

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

This is the same model as segModelPoygonRandom but instead of distributing agents randomly throughout the environment, it reads in attributes from the selected shapefile and assigns each agent the desired colour. Everything else in the model is the same for example, agents preferences etc. To create more space the original shapefile has to be altered.

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

Nested Class Summary
(package private)  class SegGISModelPolygon.happystatsBlue
           
(package private)  class SegGISModelPolygon.happystatsReds
           
(package private)  class SegGISModelPolygon.unhappystatsBlue
           
(package private)  class SegGISModelPolygon.unhappystatsReds
           
(package private)  class SegGISModelPolygon.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
           
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 toleranceRed
           
(package private)  double totalArea
           
(package private)  java.util.ArrayList urbanAgentList
           
 
Fields inherited from class uchicago.src.sim.engine.SimModelImpl
descriptors, modelManipulator
 
Constructor Summary
SegGISModelPolygon()
           
 
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
 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()
           
 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 setSaveDataOn(boolean show)
           
 void setSnapshotOn(boolean show)
           
 void setSTEP_NUM(int step_num)
           
 void setToleranceBlue(double d)
           
 void setToleranceRed(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

toleranceRed

double toleranceRed

toleranceBlue

double toleranceBlue

totalArea

double totalArea

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

snapshotOn

static boolean snapshotOn

saveDataOn

static boolean saveDataOn

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

SegGISModelPolygon

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

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)