RePast
v. 2.0

uchicago.src.sim.Schelling
Class SchellingPolygon

java.lang.Object
  |
  +--uchicago.src.sim.network.DefaultNode
        |
        +--uchicago.src.sim.gis.PolygonAdapter
              |
              +--uchicago.src.sim.gui.DrawablePolygon
                    |
                    +--uchicago.src.sim.Schelling.SchellingPolygon
All Implemented Interfaces:
CustomProbeable, DrawableGisFeature, DrawableMultiFeature, Node, RepastGisFeature, SpatialNode

public class SchellingPolygon
extends DrawablePolygon
implements SpatialNode, CustomProbeable

This is a polygon for use in the schelling model. The probeable fields only apply to this particular shapefile. You need to customize the fields to the data in your shape file. If you run this on another shapefile without changing the params, and get/set methods it will break.


Nested Class Summary
 
Nested classes inherited from class uchicago.src.sim.network.DefaultNode
DefaultNode.OrderedHashMap
 
Field Summary
 
Fields inherited from class uchicago.src.sim.gis.PolygonAdapter
attributes, geometry, label, multi, points
 
Fields inherited from class uchicago.src.sim.network.DefaultNode
inEdges, inMap, outEdges, outMap
 
Constructor Summary
SchellingPolygon(org.geotools.feature.Feature f)
           
SchellingPolygon(com.vividsolutions.jts.geom.Geometry geo, Hashtable attr)
           
 
Method Summary
 void draw(SimGraphics g)
           
 SchellingAgent getAgent()
           
 com.vividsolutions.jts.geom.Point getCentroid()
           
 GisLayer getLayer()
           
 String getName()
          name is included in the shapefile.
 ArrayList getNeighbors()
           
 boolean getOccupied()
           
 double getPop()
          population is included in the shapefile.
 String[] getProbedProperties()
          These properties only apply to this shapefile.
 double getX()
           
 double getY()
           
 double getZ()
           
 String getZip()
          zipcode is included in the shapefile.
 void reset()
          clear out the agent and reset the color.
 void setAgent(SchellingAgent agent)
           
 void setCentroid(com.vividsolutions.jts.geom.Point centroid)
           
 void setLayer(GisLayer layer)
           
 void setX(double x)
           
 void setY(double y)
           
 void setZ(double z)
           
 String toString()
           
 
Methods inherited from class uchicago.src.sim.gui.DrawablePolygon
contains, getColor, getCoords, getFeatures, getLabel, setColor, setLabel
 
Methods inherited from class uchicago.src.sim.gis.PolygonAdapter
addAttribute, crosses, disjoint, getAttribute, getAttributeNames, getAttributes, getGeometry, intersects, isMulti, overlaps, setAttributes, setFeature, setGeometry, touches, within
 
Methods inherited from class uchicago.src.sim.network.DefaultNode
addInEdge, addInEdges, addOutEdge, addOutEdges, clearInEdges, clearOutEdges, getEdgesFrom, getEdgesTo, getFromNodes, getId, getInDegree, getInEdges, getInNodes, getNode, getNodeLabel, getNumInEdges, getNumOutEdges, getOutDegree, getOutEdges, getOutNodes, getRandomFromNode, getRandomNodeIn, getRandomNodeOut, getRandomToNode, getToNodes, hasEdgeFrom, hasEdgeTo, hasEdgeToOrFrom, makeRandomInEdge, makeRandomOutEdge, removeEdgesFrom, removeEdgesTo, removeInEdge, removeOutEdge, setNodeLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface uchicago.src.sim.network.Node
addInEdge, addOutEdge, clearInEdges, clearOutEdges, getId, getInEdges, getNodeLabel, getOutEdges, hasEdgeFrom, hasEdgeTo, removeInEdge, removeOutEdge, setNodeLabel
 
Methods inherited from interface uchicago.src.sim.gis.RepastGisFeature
addAttribute, crosses, disjoint, getAttribute, getAttributeNames, getGeometry, intersects, isMulti, overlaps, setAttributes, setFeature, setGeometry, touches, within
 

Constructor Detail

SchellingPolygon

public SchellingPolygon(com.vividsolutions.jts.geom.Geometry geo,
                        Hashtable attr)

SchellingPolygon

public SchellingPolygon(org.geotools.feature.Feature f)
Method Detail

getPop

public double getPop()
population is included in the shapefile.

Returns:

getZip

public String getZip()
zipcode is included in the shapefile.

Returns:

getName

public String getName()
name is included in the shapefile.

Returns:

getProbedProperties

public String[] getProbedProperties()
These properties only apply to this shapefile.

Specified by:
getProbedProperties in interface CustomProbeable
Returns:

getLayer

public GisLayer getLayer()

setLayer

public void setLayer(GisLayer layer)

getAgent

public SchellingAgent getAgent()

setAgent

public void setAgent(SchellingAgent agent)

reset

public void reset()
clear out the agent and reset the color.


getCentroid

public com.vividsolutions.jts.geom.Point getCentroid()

setCentroid

public void setCentroid(com.vividsolutions.jts.geom.Point centroid)

getNeighbors

public ArrayList getNeighbors()

getOccupied

public boolean getOccupied()

draw

public void draw(SimGraphics g)
Specified by:
draw in interface DrawableGisFeature
Overrides:
draw in class DrawablePolygon

getX

public double getX()
Specified by:
getX in interface SpatialNode

getY

public double getY()
Specified by:
getY in interface SpatialNode

getZ

public double getZ()
Specified by:
getZ in interface SpatialNode

setX

public void setX(double x)
Specified by:
setX in interface SpatialNode

setY

public void setY(double y)
Specified by:
setY in interface SpatialNode

setZ

public void setZ(double z)
Specified by:
setZ in interface SpatialNode

toString

public String toString()
Overrides:
toString in class Object

RePast
v. 2.0

Bug reports and feature requests to RePast