|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuchicago.src.sim.engine.SimModelImpl
uk.ac.ucl.casa.andrew.phd.segModelFourTypes.SegGISModel
Reality is much more complex than that of Schelling’s original model. While Schellings model of residential tipping is well known to students of residential mobility and segregation, it is seldom directly used to analyse neighbourhood change in real populations (Bruch and Mare, 2005). To be used for this purpose, the model needs to address several issues, specifically the limitation of only using two groups. For example within London, there are numerous different types of ethnic or socioeconomic groups living within one area. While the previous models have given insights into segregation, they have only explored what occurs when there are only two types of agents in the system. Therefore a variation of the basic segregation model was created, which allows one to explore relationships between several different racial or socio-economic groups incorporating specific aspects of previous models presented in this website specifically the addition and removal of agents (see SegregationModelAddRemove). The model allows for four different groups/types of agents however this can easily be extended if desired. In this case, the agent belongs to one of the following groups: white, red, blue or green, however these could be social or ethnic groups if the model was extended. Each agent has a preference –preferences for levels of residential contact (co-residence) with members of different groups. Included are preferences for in-group contact, specified in terms of desired minimum levels of co-ethnic presence in neighbourhoods. The ability to add and remove agents of numerous groups can therefore form the foundation to studying and exploring how residential dynamics (such as immigration) affect the pattern of segregation seen within urban areas. To create this model, extra fields where added to the shapefile to represent different social groups thus providing the ability to set the number of agents at the start of each simulation and the basic segregation model was extended to allow for rules governing agents preferences to incorporate these different possible new combinations of neighbourhoods. It is assumed that agents have a positive preference for their own group and a negative preference for other groups. Agents have preferences for the same type and for different nieghbourhood configuations: For agent get all of its neighbours with a specified radius{ If neighbour is Blue, blue-counter ++ If neighbour is Red, red-counter ++ If neighbour is Green, green-counter ++ If neighbour is Blue, white-counter ++ } If agent is of type Blue{ Percentage-of-Blue-agents = (blue-counter/total number of agents)*100 Percentage-of-Red-agents = (red-counter/total number of agents)*100 Percentage-of-Green-agents = (green-counter/total number of agents)*100 Percentage-of-White-agents = (white-counter/total number of agents)*100 If Percentage-of-Blue-agents >= agents tolerance for Blue agents And Percentage-of-Red-agents <= agents tolerance for Red agents And Percentage-of-Green-agents <= agents tolerance for Green agents And Percentage-of-White-agents <= agents tolerance for White agents{ This agent is satisfied with current location } Else agent is dissatisfied with current location } If agent is dissatisfied move to a new location where preferences are satisfied
Field Summary | |
(package private) static int |
addAgents
|
(package private) static int |
ADDAGENTS
|
(package private) boolean |
addNewAgentOn
|
(package private) static int |
blue_blue
|
(package private) static int |
BLUE_BLUE
|
(package private) static int |
blue_green
|
(package private) static int |
BLUE_GREEN
|
(package private) static int |
blue_red
|
(package private) static int |
BLUE_RED
|
(package private) static int |
blue_white
|
(package private) static int |
BLUE_WHITE
|
(package private) static boolean |
closeModelOn
|
(package private) static java.lang.String |
datasource1
|
(package private) javax.swing.JFileChooser |
fileChooser
|
(package private) OpenMapData |
gisData
|
(package private) static int |
green_blue
|
(package private) static int |
GREEN_BLUE
|
(package private) static int |
green_green
|
(package private) static int |
GREEN_GREEN
|
(package private) static int |
green_red
|
(package private) static int |
GREEN_RED
|
(package private) static int |
green_white
|
(package private) static int |
GREEN_WHITE
|
private uchicago.src.sim.analysis.OpenSequenceGraph |
landuseGraph
|
(package private) static int |
movement
|
(package private) static int |
MOVEMENT
|
(package private) static int |
moveToWithIn
|
(package private) static int |
MOVETOWITHIN
|
(package private) static java.lang.String |
neighbourhoodFile1
|
private uchicago.src.sim.gui.Legend |
newlegend
|
(package private) anl.repast.gis.display.OpenMapDisplay |
omDisplay
|
(package private) static int |
perAgents
|
(package private) static int |
PERAGNETS
|
private uchicago.src.sim.analysis.OpenSequenceGraph |
recorderHappyAgentsGraph
|
private uchicago.src.sim.analysis.DataRecorder |
recorderLanduse
|
private uchicago.src.sim.analysis.OpenSequenceGraph |
recorderTotalHappyAndSad
|
(package private) static int |
red_blue
|
(package private) static int |
RED_BLUE
|
(package private) static int |
red_green
|
(package private) static int |
RED_GREEN
|
(package private) static int |
red_red
|
(package private) static int |
RED_RED
|
(package private) static int |
red_white
|
(package private) static int |
RED_WHITE
|
(package private) boolean |
removeAgentsOn
|
(package private) int |
removedResidentBecauseToOld
|
(package private) java.util.ArrayList |
residentAgentsList
|
(package private) static boolean |
saveDataOn
|
(package private) uchicago.src.sim.engine.Schedule |
schedule
|
(package private) static int |
search
|
(package private) static int |
SEARCH
|
(package private) static boolean |
searchOn
|
private int |
simulationSpeed
|
(package private) static float |
sizeOfAgent
|
(package private) static float |
SIZEOFAGENT
|
(package private) static boolean |
snapshotOn
|
(package private) int |
STEP_NUM
|
(package private) double |
totalArea
|
(package private) java.util.ArrayList |
urbanAgentList
|
(package private) static int |
white_blue
|
(package private) static int |
WHITE_BLUE
|
(package private) static int |
white_green
|
(package private) static int |
WHITE_GREEN
|
(package private) static int |
white_red
|
(package private) static int |
WHITE_RED
|
(package private) static int |
white_white
|
(package private) static int |
WHITE_WHITE
|
Fields inherited from class uchicago.src.sim.engine.SimModelImpl |
descriptors, modelManipulator |
Constructor Summary | |
SegGISModel()
|
Method Summary | |
private void |
addNewResdientAgent()
Used to add a new agent randonmly within the urban area, will add however many agents specified in the counter Once an agent is created it is added to the residentAgent list |
void |
begin()
Calls the buildModel, buildDisplay and buildSchedule methods the method initialises the repast model In this order. |
void |
buildDisplay()
Builds the display for the model |
void |
buildModel()
Reads in the data and builds the model |
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 |
createShapefileForAgents()
Creates a new point shapefile containting all the resident agents this uses information from the Resident class specifically information in the gisPropertyList()each element in the dbf file needs a get and set method in a similar way to reading in and storing changes in the urban agent. |
private void |
densityStats(java.util.ArrayList urbanAgentList)
Used to calculate max and miniuim density of Urban agent along with average density of the area. |
int |
getAddAgents()
|
boolean |
getAddNewAgentOn()
|
int |
getBlue_blue()
|
int |
getBlue_green()
|
int |
getBlue_red()
|
int |
getBlue_white()
|
boolean |
getCloseModelOn()
getAddNewAgentOn, setAddNewAgentOn, getSearchOn, setSearchOn, getPerAgents, setPerAgents, * getSizeOfAgent, setSizeOfAgent, getMovement, setMovement, * getSearch, and setSearch Methods * * Used to set the getInitParams and are passed on to other parts* of the model. |
int |
getGreen_blue()
|
int |
getGreen_green()
|
int |
getGreen_red()
|
int |
getGreen_white()
|
java.lang.String[] |
getInitParam()
This method gets the inital parameters of the model it returns an array of string variables. |
int |
getMovement()
|
int |
getMoveToWithin()
|
java.lang.String |
getName()
Replaces repast with the name of the project on the control bar |
java.util.ArrayList |
getNeighborAgents(int[] neighbors)
Gets the neighbourhood info for the urban agents |
int |
getNeighbourhood()
|
int |
getPerAgents()
|
int |
getRed_blue()
|
int |
getRed_green()
|
int |
getRed_red()
|
int |
getRed_white()
|
boolean |
getRemoveAgentsOn()
|
java.util.ArrayList |
getResidentAgents()
|
boolean |
getSaveDataOn()
|
uchicago.src.sim.engine.Schedule |
getSchedule()
gets the schedule |
boolean |
getSearchOn()
|
float |
getSizeOfAgent()
|
boolean |
getSnapshotOn()
|
int |
getSTEP_NUM()
|
java.util.ArrayList |
getUrbanAgentList()
|
int |
getWhite_blue()
|
int |
getWhite_green()
|
int |
getWhite_red()
|
int |
getWhite_white()
|
static void |
main(java.lang.String[] args)
|
void |
metresToDecimalDegress()
Converts meters to degrees |
static float |
movementInDegreesCalculation()
|
private void |
numberOfHappyResdientAgents(java.util.ArrayList residentAgentsList)
Used to calculate the number of unhappy agents in the area. |
void |
postStep()
Calls methods and functions to be carried out in PostStep |
void |
preStep()
Calls methods to be carried out in PreStep |
private int |
removeResidents()
Used to remove an agent at the moment it is only used when an agent becomes to old ie 50+ Resdients are removed but their index (gisResidentAgentIndex is not altered. |
void |
reset()
The reset method is called whenever the model is reset. |
void |
saveGALFile()
Takes a copy of the existing gal file and creates a new copy of it |
void |
saveShapefile()
Any change to the urban layer is saved to a new shapefile |
void |
setAddAgents(int addNewAgent)
|
void |
setAddNewAgentOn(boolean showAdd)
|
void |
setBlue_blue(int i)
|
void |
setBlue_green(int k)
|
void |
setBlue_red(int j)
|
void |
setBlue_white(int l)
|
void |
setCloseModelOn(boolean on)
|
void |
setGreen_blue(int g)
|
void |
setGreen_green(int e)
|
void |
setGreen_red(int f)
|
void |
setGreen_white(int h)
|
void |
setMovement(int mov)
|
void |
setMoveToWithin(int newMovementToWithin)
|
void |
setNeighbourhood(int ser)
|
void |
setPerAgents(int pa)
|
void |
setRed_blue(int c)
|
void |
setRed_green(int b)
|
void |
setRed_red(int a)
|
void |
setRed_white(int d)
|
void |
setRemoveAgentsOn(boolean showRemove)
|
void |
setResidentAgents(java.util.ArrayList residentAgents)
|
void |
setSaveDataOn(boolean show)
|
void |
setSearchOn(boolean show)
|
void |
setSizeOfAgent(float soa)
|
void |
setSnapshotOn(boolean show)
|
void |
setSnapShotRecording()
Created to save time when images are wanted when running a simulation. |
void |
setSTEP_NUM(int step_num)
|
void |
setup()
the setup() function returns the model to the initial conditions |
void |
setUrbanAgentList(java.util.ArrayList agentList)
|
void |
setWhite_blue(int p)
|
void |
setWhite_green(int o)
|
void |
setWhite_red(int n)
|
void |
setWhite_white(int m)
|
void |
step()
Step method tells the program what to do at evey step THis therefore should contain infomation about agent movement, what agents are where etc. |
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 |
javax.swing.JFileChooser fileChooser
static final int RED_RED
static int red_red
static final int RED_GREEN
static int red_green
static final int RED_BLUE
static int red_blue
static final int RED_WHITE
static int red_white
static final int GREEN_GREEN
static int green_green
static final int GREEN_RED
static int green_red
static final int GREEN_BLUE
static int green_blue
static final int GREEN_WHITE
static int green_white
static final int BLUE_BLUE
static int blue_blue
static final int BLUE_RED
static int blue_red
static final int BLUE_GREEN
static int blue_green
static final int BLUE_WHITE
static int blue_white
static final int WHITE_WHITE
static int white_white
static final int WHITE_RED
static int white_red
static final int WHITE_GREEN
static int white_green
static final int WHITE_BLUE
static int white_blue
static final int PERAGNETS
static float SIZEOFAGENT
static final int MOVEMENT
static final int SEARCH
static int perAgents
static float sizeOfAgent
static int search
static int movement
static final int ADDAGENTS
static int addAgents
boolean removeAgentsOn
boolean addNewAgentOn
int removedResidentBecauseToOld
double totalArea
static final int MOVETOWITHIN
static int moveToWithIn
static java.lang.String datasource1
static java.lang.String neighbourhoodFile1
OpenMapData gisData
anl.repast.gis.display.OpenMapDisplay omDisplay
java.util.ArrayList urbanAgentList
java.util.ArrayList residentAgentsList
uchicago.src.sim.engine.Schedule schedule
int STEP_NUM
private int simulationSpeed
private uchicago.src.sim.analysis.OpenSequenceGraph landuseGraph
private uchicago.src.sim.analysis.DataRecorder recorderLanduse
private uchicago.src.sim.analysis.OpenSequenceGraph recorderHappyAgentsGraph
private uchicago.src.sim.analysis.OpenSequenceGraph recorderTotalHappyAndSad
static boolean searchOn
static boolean snapshotOn
static boolean saveDataOn
static boolean closeModelOn
private uchicago.src.sim.gui.Legend newlegend
Constructor Detail |
public SegGISModel()
Method Detail |
public static void main(java.lang.String[] args)
public void begin()
public void buildModel()
public void buildDisplay()
public void buildSchedule()
public void step()
public void preStep()
public void postStep()
private int removeResidents()
private void addNewResdientAgent()
public void setSnapShotRecording()
public void closeModel()
public void takesnapshot()
private void numberOfHappyResdientAgents(java.util.ArrayList residentAgentsList)
private void densityStats(java.util.ArrayList urbanAgentList)
public java.util.ArrayList getNeighborAgents(int[] neighbors)
public void setup()
public void reset()
public uchicago.src.sim.engine.Schedule getSchedule()
public void saveShapefile()
public void createShapefileForAgents()
public void saveGALFile()
public java.lang.String getName()
public java.lang.String[] getInitParam()
public boolean getCloseModelOn()
public void setCloseModelOn(boolean on)
public int getAddAgents()
public void setAddAgents(int addNewAgent)
public boolean getRemoveAgentsOn()
public void setRemoveAgentsOn(boolean showRemove)
public boolean getAddNewAgentOn()
public void setAddNewAgentOn(boolean showAdd)
public int getRed_red()
public void setRed_red(int a)
public int getRed_green()
public void setRed_green(int b)
public int getRed_blue()
public void setRed_blue(int c)
public int getRed_white()
public void setRed_white(int d)
public int getGreen_green()
public void setGreen_green(int e)
public int getGreen_red()
public void setGreen_red(int f)
public int getGreen_blue()
public void setGreen_blue(int g)
public int getGreen_white()
public void setGreen_white(int h)
public int getBlue_blue()
public void setBlue_blue(int i)
public int getBlue_red()
public void setBlue_red(int j)
public int getBlue_green()
public void setBlue_green(int k)
public int getBlue_white()
public void setBlue_white(int l)
public int getWhite_white()
public void setWhite_white(int m)
public int getWhite_red()
public void setWhite_red(int n)
public int getWhite_green()
public void setWhite_green(int o)
public int getWhite_blue()
public void setWhite_blue(int p)
public boolean getSaveDataOn()
public void setSaveDataOn(boolean show)
public boolean getSnapshotOn()
public void setSnapshotOn(boolean show)
public int getMoveToWithin()
public void setMoveToWithin(int newMovementToWithin)
public boolean getSearchOn()
public void setSearchOn(boolean show)
public int getPerAgents()
public void setPerAgents(int pa)
public float getSizeOfAgent()
public void setSizeOfAgent(float soa)
public int getMovement()
public void setMovement(int mov)
public int getNeighbourhood()
public void setNeighbourhood(int ser)
public java.util.ArrayList getUrbanAgentList()
public void setUrbanAgentList(java.util.ArrayList agentList)
public java.util.ArrayList getResidentAgents()
public void setResidentAgents(java.util.ArrayList residentAgents)
public int getSTEP_NUM()
public void setSTEP_NUM(int step_num)
public void metresToDecimalDegress()
public static float movementInDegreesCalculation()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |