LulcCell


cpc.sau.lulctools
Class LulcCell

java.lang.Object
  extended by cpc.sau.lulctools.LulcCell
All Implemented Interfaces:
uchicago.src.sim.gui.Drawable

public class LulcCell
extends java.lang.Object
implements uchicago.src.sim.gui.Drawable

An object representing a discreate amount of a landscape. It is analoous to a raster cell or a pixel in a remotely sensed image. The LulcCell object contains information about the land use or land cover (LULC) within it; the age of the LULC; and the object's location on the landscape, both absolute and in relation to parcels and properties. The LulcCell class contains attributes and methods that allow an "owner" agent to make decisions regarding land use changes and property transfers.

lulcVal : an integer representing the cell's LULC type
lulcType: the name of the LULC type
age: the amount of time the cell has contained the current LULC type
parcelID: the ID of the parcel containing the LulcCell object
propertyID: the ID of the property containing the LulcCell object
x, y : the coordinates of the LulcCell object
cellSize : the size of one side of the cell(i.e. pixel resolution)
cellArea : the area of the cell.
edgeCell : boolean value indicating whether this cell is adjacent to another parcel.
edges: number of edges of the cell adjacent to other parcels. The value is between 0 and 4.
suitabilityScore: a value indicating the suitability of the cell. It is useful when subdivision happens. Suitability scores are used in several different methods, such as the splitting of parcels and properties, and decision-making methods. It is up to the user to generate the scores and apply them in an appropriate fashion.

This class also implements the Drawable interface, and displays the cell as a square with a different color in Repast.


Constructor Summary
LulcCell()
          Constructor to create an LulcCell object.
 
Method Summary
 void draw(uchicago.src.sim.gui.SimGraphics G)
          Display the LulcCell object in the Repast environment.
 int getAge()
          Returns the age of the cell.
 double getCellArea()
          Returns the area of the cell.
 double getCellSize()
          Returns the size of the cell.
 int getEdge()
          Returns the number of edges a cell shares with different parcels.
 java.lang.String getLulcType()
          Returns the name of the LULC type, as a string.
 int getLulcVal()
          Returns an integer value for the cells's LULC
 int getParcelID()
          Returns the parcel ID of the cell
 java.lang.String getPropertyID()
          Returns the ID of the property containing the cell
 double getSuitabilityScore()
          Returns the suitability score of the cell
 java.lang.String getUniqID()
          Returns the unique ID of the cell
 int getX()
          Returns the x coordinate
 int getY()
          Returns the y coordinate
 boolean isEdgeCell()
          Returns a boolean value indicating whether the cell is an edge cell
 void printCover()
          Prints the information of the LulcCell object.
 void setAge(int age)
          Sets the age of the cell
 void setCellSize(double c)
          Sets the cell size.
 void setEdge(int e)
          Sets the edges attribute.
 void setIsEdge()
          Sets the boolean value which indicates whether the cell is an edge cell.
 void setLulcType(java.lang.String type)
          Sets the LULC type to a new type.
 void setLulcVal(int i)
          Changes the LULC value to a new integer value.
 void setLulcVal(uchicago.src.sim.space.RasterSpace rs)
          Initializes the LULC values of the entire landscape.
 void setParcelID(int pid)
          Sets the parcel ID for the cell
 void setPropertyID(java.lang.String fid)
          Sets the property ID for the cell
 void setSuitabilityScore(double s)
          Sets the suitability score of a cell.
 void setUniqID(java.lang.String s)
          Sets the unique ID of the parcel.
 void setXY(int x, int y)
          Defines the X,Y coordinates of the cell.
 void step(int i)
          For every time step in a Repast model, this method will be called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LulcCell

public LulcCell()
Constructor to create an LulcCell object. All default value are 0 or false for boolean value.

Method Detail

setXY

public void setXY(int x,
                  int y)
Defines the X,Y coordinates of the cell.

Parameters:
x - x coordinate
y - y coordinate

getX

public int getX()
Returns the x coordinate

Specified by:
getX in interface uchicago.src.sim.gui.Drawable
Returns:
x coordinate

getY

public int getY()
Returns the y coordinate

Specified by:
getY in interface uchicago.src.sim.gui.Drawable
Returns:
y coordinate

setCellSize

public void setCellSize(double c)
Sets the cell size. It is the length of the edge.

Parameters:
c - the cell size

getCellSize

public double getCellSize()
Returns the size of the cell. It is the length of the edge.

Returns:
the size of the cell

getCellArea

public double getCellArea()
Returns the area of the cell. All cells are square, so the area is equal to cellSize*cellSize

Returns:
the area of the cell

setLulcVal

public void setLulcVal(uchicago.src.sim.space.RasterSpace rs)
Initializes the LULC values of the entire landscape. It uses a RasterSpace object to initialize it. A RasterSpace is created by an ESRI ASCII Raster file containing the LULC values for all cells in the landscape. The method finds teh value at each position(x,y) of the RasterSpace and uses it to initialize the LULC values at the same positions in the final landscape object. After it gets the LULC value, it updates its LULC type(LulcType).

Parameters:
rs - a RasterSpace oject created by an ESRI ASCII Raster file of LULC values

setLulcVal

public void setLulcVal(int i)
Changes the LULC value to a new integer value. After this value is set, it updates the LULC type(lulcType).

Parameters:
i - integer value for the new LULC type

getLulcVal

public int getLulcVal()
Returns an integer value for the cells's LULC

Returns:
LULC value

setLulcType

public void setLulcType(java.lang.String type)
Sets the LULC type to a new type. This method updates the LULC value at the same time.


getLulcType

public java.lang.String getLulcType()
Returns the name of the LULC type, as a string.

Returns:
a string

setAge

public void setAge(int age)
Sets the age of the cell

Parameters:
age - an integer value indicating the amount of time the cell has contained the current LULC

getAge

public int getAge()
Returns the age of the cell.

Returns:
age

setParcelID

public void setParcelID(int pid)
Sets the parcel ID for the cell

Parameters:
pid - an integer value

getParcelID

public int getParcelID()
Returns the parcel ID of the cell

Returns:
an integer value of the parcel ID

setPropertyID

public void setPropertyID(java.lang.String fid)
Sets the property ID for the cell

Parameters:
fid - the property ID

getPropertyID

public java.lang.String getPropertyID()
Returns the ID of the property containing the cell

Returns:
the property ID

setIsEdge

public void setIsEdge()
Sets the boolean value which indicates whether the cell is an edge cell. An edge cell is a cell that shares at least one edge with another parcel. Edges of all LulcCell objects(cells) on the landscape can be calculated by calling the SpatialTools.setCellEdge method.


isEdgeCell

public boolean isEdgeCell()
Returns a boolean value indicating whether the cell is an edge cell

Returns:
a boolean value

setEdge

public void setEdge(int e)
Sets the edges attribute. The value is the number of edges the cell shares with different parcels.

Parameters:
e - the number of edges that the cell shares with different parcels. It can be calculated by calling SpatialTools.setCellEdge method.

getEdge

public int getEdge()
Returns the number of edges a cell shares with different parcels.

Returns:
the value of the edges attribute

setUniqID

public void setUniqID(java.lang.String s)
Sets the unique ID of the parcel. A landscape may contain multiple properties. The Parcels on different properties might have the same parcel ID. In order to distinguish these LulcCell objects with teh parcel IDs from different properties, it is necessary to give them an unique ID. In this case, the unique ID is property ID + parcelID.

Parameters:
s - an unique string that indentifies the parcel on the landscape

getUniqID

public java.lang.String getUniqID()
Returns the unique ID of the cell

Returns:
the unique ID of the cell

setSuitabilityScore

public void setSuitabilityScore(double s)
Sets the suitability score of a cell. This score is needed for vaious methods, including decision-making processes.

Parameters:
s - the suitability score of the cell

getSuitabilityScore

public double getSuitabilityScore()
Returns the suitability score of the cell

Returns:
a double value

printCover

public void printCover()
Prints the information of the LulcCell object. It prints the parcel ID, property ID, LULC value, LULC type, age and area.


draw

public void draw(uchicago.src.sim.gui.SimGraphics G)
Display the LulcCell object in the Repast environment. It is shown as a square and its color depends on different the LULC value.

Specified by:
draw in interface uchicago.src.sim.gui.Drawable

step

public void step(int i)
For every time step in a Repast model, this method will be called. When it executes, the methods it contains are executed. Currently, it just has one method, which sets the LULC value. After the LULC value changes, the color of the cell will also change.



Wink Plone Theme by Quintagroup © 2013.

Personal tools
This is themeComment for Wink theme