SORTIE Java Interface  1
Classes | Public Member Functions | Private Attributes | List of all members
sortie.data.funcgroups.planting.PlantingData Class Reference

This class encapsulates the data for a single planting event - being for one species, for one timestep. More...

Classes

class  PlantingAbundance
 This encapsulates a species with its planting abundance.
 

Public Member Functions

 PlantingData (float fXCellLength, float fYCellLength)
 Constructor. More...
 
float getXCellLength ()
 Gets the length of the cells in the X direction that define the area of this event. More...
 
float getYCellLength ()
 Gets the length of the cells in the Y direction that define the area of this event. More...
 
void setXCellLength (float fXCellLength)
 Sets the length of the cells in the X direction that define the area of this event. More...
 
void setYCellLength (float fYCellLength)
 Sets the length of the cells in the Y direction that define the area of this event. More...
 
int getPlantSpacing ()
 Gets the plant spacing. More...
 
void setPlantSpacing (int iSpacing) throws ModelException
 Sets the plant spacing. More...
 
int getTimestep ()
 Gets the timestep for this planting event. More...
 
void removeSpecies (int iSpecies)
 Removes a species from the list to which to apply this harvest. More...
 
void clearSpecies ()
 Clears the list of species. More...
 
void setTimestep (int iTimestep) throws ModelException
 Sets the timestep for this planting event. More...
 
int getNumberOfSpecies ()
 Gets the number of species to which this planting has been applied. More...
 
int getSpecies (int iIndex) throws ModelException
 Gets a species at a certain index within the species list. More...
 
void addSpecies (int iSpecies)
 Adds a new species to apply this planting to. More...
 
int getNumberOfCells ()
 Gets the number of cells in the planting's area. More...
 
void addCell (int iX, int iY, Plot oPlot) throws ModelException
 Adds a cell to the planting area. More...
 
void addCell (Cell oNewCell)
 Adds a cell to the planting area. More...
 
void removeCell (int iIndex)
 Removes a cell from the planting area. More...
 
void removeAllCells ()
 Deletes all cells. More...
 
Cell getCell (int iIndex) throws ModelException
 Gets a cell in the planting's area. More...
 
float getSpacingDistance ()
 Get the distance between trees for a gridded planting. More...
 
float getDensity ()
 Gets the total density of trees for a random planting. More...
 
void setSpacingDistance (float fSpace) throws ModelException
 Sets the distance between trees for a gridded planting. More...
 
void setDensity (float fSpace) throws ModelException
 Sets the total tree density for a random planting. More...
 
void addAbundance (int iSpecies, float fAbundance) throws ModelException
 Adds an abundance value for a given species. More...
 
float getAbundance (int iSpecies) throws ModelException
 Gets an abundance value for a particular species. More...
 
void validatePlant (TreePopulation oPop, Plot oPlot) throws ModelException
 Validates the current set of data in this planting. More...
 
void updateCellsNewGridResolution (float fNewXCellLength, float fNewYCellLength, Plot oPlot) throws ModelException
 Adjusts any existing cell lists in response to grid cell changes. More...
 
Object clone ()
 

Private Attributes

ArrayList< Integer > mp_iSpecies = new ArrayList<Integer>(0)
 Species codes to which to apply this planting. More...
 
ArrayList< Cellmp_oCells = new ArrayList<Cell>(0)
 The list of cells to which to apply this plant (vector of Cell objects) More...
 
ArrayList< PlantingAbundance > mp_oAbundance = new ArrayList<PlantingAbundance>(0)
 The amount of each species to plant. More...
 
float m_fDistanceOrDensity
 If planting is GRIDDED - distance between trees in m. More...
 
float m_fXCellLength
 Length of cells in the X direction. More...
 
float m_fYCellLength
 Length of cells in the Y direction. More...
 
int m_iTimestep
 Timestep to which to apply this planting. More...
 

Detailed Description

This class encapsulates the data for a single planting event - being for one species, for one timestep.

Copyright: Copyright (c) Charles D. Canham 2003

Company: Cary Institute of Ecosystem Studies

Author
Lora E. Murphy
Version
1.0


Edit history:
---------------—
April 28, 2004: Submitted in beta version (LEM)
November 19, 2005: Added species removal capacity (LEM)
February 4, 2008: Updated to conform to Java 6 compliance (LEM)
October 29, 2010: Changed from floats to floats

Constructor & Destructor Documentation

◆ PlantingData()

sortie.data.funcgroups.planting.PlantingData.PlantingData ( float  fXCellLength,
float  fYCellLength 
)

Constructor.

Parameters
fXCellLengthLength of cells in the X direction.
fYCellLengthLength of cells in the Y direction.

Member Function Documentation

◆ addAbundance()

void sortie.data.funcgroups.planting.PlantingData.addAbundance ( int  iSpecies,
float  fAbundance 
) throws ModelException

Adds an abundance value for a given species.

If a value for that species already exists, then the value is replaced with the new value.

Parameters
iSpeciesThe species number.
fAbundanceThe abundance value, as a percentage (between 0 and 100)
Exceptions
ModelExceptionif the abundance value is negative or not a percentage.

◆ addCell() [1/2]

void sortie.data.funcgroups.planting.PlantingData.addCell ( int  iX,
int  iY,
Plot  oPlot 
) throws ModelException

Adds a cell to the planting area.

Duplicates will not be added.

Parameters
iXX cell number.
iYY cell number.
oPlota Plot object.
Exceptions
ModelExceptionif the cell coordinates are invalid.

◆ addCell() [2/2]

void sortie.data.funcgroups.planting.PlantingData.addCell ( Cell  oNewCell)

Adds a cell to the planting area.

Duplicates will not be added.

Parameters
oNewCellCell object to add.

◆ addSpecies()

void sortie.data.funcgroups.planting.PlantingData.addSpecies ( int  iSpecies)

Adds a new species to apply this planting to.

If this species is already on the list, it is not added again.

Parameters
iSpeciesSpecies index.

◆ clearSpecies()

void sortie.data.funcgroups.planting.PlantingData.clearSpecies ( )

Clears the list of species.

◆ clone()

Object sortie.data.funcgroups.planting.PlantingData.clone ( )

◆ getAbundance()

float sortie.data.funcgroups.planting.PlantingData.getAbundance ( int  iSpecies) throws ModelException

Gets an abundance value for a particular species.

Parameters
iSpeciesThe species number.
Returns
The abundance for the specified species.
Exceptions
ModelExceptionif the species doesn't exist.

◆ getCell()

Cell sortie.data.funcgroups.planting.PlantingData.getCell ( int  iIndex) throws ModelException

Gets a cell in the planting's area.

Parameters
iIndexThe index of the object.
Returns
The cell object.
Exceptions
ModelExceptionIf the index is not valid.

◆ getDensity()

float sortie.data.funcgroups.planting.PlantingData.getDensity ( )

Gets the total density of trees for a random planting.

Returns
The density in stems/ha for all species.

◆ getNumberOfCells()

int sortie.data.funcgroups.planting.PlantingData.getNumberOfCells ( )

Gets the number of cells in the planting's area.

Returns
Number of cells.

◆ getNumberOfSpecies()

int sortie.data.funcgroups.planting.PlantingData.getNumberOfSpecies ( )

Gets the number of species to which this planting has been applied.

Returns
The number of species.

◆ getPlantSpacing()

int sortie.data.funcgroups.planting.PlantingData.getPlantSpacing ( )

Gets the plant spacing.

Possible values come from PlantingBehaviors and are GRIDDED, RANDOM, or -1 if the value has not yet been set.

Returns
The plant spacing.

◆ getSpacingDistance()

float sortie.data.funcgroups.planting.PlantingData.getSpacingDistance ( )

Get the distance between trees for a gridded planting.

Returns
The distance between trees, in m.

◆ getSpecies()

int sortie.data.funcgroups.planting.PlantingData.getSpecies ( int  iIndex) throws ModelException

Gets a species at a certain index within the species list.

Parameters
iIndexThe species index.
Returns
The species value.
Exceptions
ModelExceptionIf the index is not valid.

◆ getTimestep()

int sortie.data.funcgroups.planting.PlantingData.getTimestep ( )

Gets the timestep for this planting event.

Returns
The timestep.

◆ getXCellLength()

float sortie.data.funcgroups.planting.PlantingData.getXCellLength ( )

Gets the length of the cells in the X direction that define the area of this event.

Returns
Length of the cells.

◆ getYCellLength()

float sortie.data.funcgroups.planting.PlantingData.getYCellLength ( )

Gets the length of the cells in the Y direction that define the area of this event.

Returns
Length of the cells.

◆ removeAllCells()

void sortie.data.funcgroups.planting.PlantingData.removeAllCells ( )

Deletes all cells.

◆ removeCell()

void sortie.data.funcgroups.planting.PlantingData.removeCell ( int  iIndex)

Removes a cell from the planting area.

Parameters
iIndexint Cell index. Invalid values are ignored.

◆ removeSpecies()

void sortie.data.funcgroups.planting.PlantingData.removeSpecies ( int  iSpecies)

Removes a species from the list to which to apply this harvest.

If this species is not on the list, the function quietly exits.

Parameters
iSpeciesSpecies number (number identifying the species, NOT the index number in the vector).

◆ setDensity()

void sortie.data.funcgroups.planting.PlantingData.setDensity ( float  fSpace) throws ModelException

Sets the total tree density for a random planting.

Parameters
fSpaceThe total stems/ha for all species.
Exceptions
ModelExceptionif the value is negative.

◆ setPlantSpacing()

void sortie.data.funcgroups.planting.PlantingData.setPlantSpacing ( int  iSpacing) throws ModelException

Sets the plant spacing.

Parameters
iSpacingthe plant spacing. Possible values come from PlantingBehaviors and are GRIDDED and RANDOM.
Exceptions
ModelExceptionif the spacing is unrecognized.

◆ setSpacingDistance()

void sortie.data.funcgroups.planting.PlantingData.setSpacingDistance ( float  fSpace) throws ModelException

Sets the distance between trees for a gridded planting.

Parameters
fSpaceThe spacing distance.
Exceptions
ModelExceptionif the value is negative.

◆ setTimestep()

void sortie.data.funcgroups.planting.PlantingData.setTimestep ( int  iTimestep) throws ModelException

Sets the timestep for this planting event.

Parameters
iTimestepThe timestep to set.
Exceptions
ModelExceptionif the timestep is less than 0.

◆ setXCellLength()

void sortie.data.funcgroups.planting.PlantingData.setXCellLength ( float  fXCellLength)

Sets the length of the cells in the X direction that define the area of this event.

Parameters
fXCellLengthLength of the cells.

◆ setYCellLength()

void sortie.data.funcgroups.planting.PlantingData.setYCellLength ( float  fYCellLength)

Sets the length of the cells in the Y direction that define the area of this event.

Parameters
fYCellLengthLength of the cells.

◆ updateCellsNewGridResolution()

void sortie.data.funcgroups.planting.PlantingData.updateCellsNewGridResolution ( float  fNewXCellLength,
float  fNewYCellLength,
Plot  oPlot 
) throws ModelException

Adjusts any existing cell lists in response to grid cell changes.

Parameters
fNewXCellLengthNew X cell length.
fNewYCellLengthNew Y cell length.
oPlotPlot object.
Exceptions
ModelExceptionshouldn't.

◆ validatePlant()

void sortie.data.funcgroups.planting.PlantingData.validatePlant ( TreePopulation  oPop,
Plot  oPlot 
) throws ModelException

Validates the current set of data in this planting.

This makes sure the following are all true:

  • there is at least one species
  • all species are valid
  • a timestep has been specified
  • a planting spacing has been specified
  • there is at least one grid cell to which to apply the planting
  • there is an abundance for all specified species
  • the planting abundances add up to 100
  • if the planting spacing is gridded, that there is a planting distance specified
  • if the planting spacing is random, that there is a total number of stems/ha specified
Parameters
oPopTreePopulation object, to help verify data
oPlotPlot object
Exceptions
ModelExceptionif any of the above conditions is not true

Member Data Documentation

◆ m_fDistanceOrDensity

float sortie.data.funcgroups.planting.PlantingData.m_fDistanceOrDensity
private

If planting is GRIDDED - distance between trees in m.

If RANDOM, total number of trees/ha for all species

◆ m_fXCellLength

float sortie.data.funcgroups.planting.PlantingData.m_fXCellLength
private

Length of cells in the X direction.

◆ m_fYCellLength

float sortie.data.funcgroups.planting.PlantingData.m_fYCellLength
private

Length of cells in the Y direction.

◆ m_iTimestep

int sortie.data.funcgroups.planting.PlantingData.m_iTimestep
private

Timestep to which to apply this planting.

◆ mp_iSpecies

ArrayList<Integer> sortie.data.funcgroups.planting.PlantingData.mp_iSpecies = new ArrayList<Integer>(0)
private

Species codes to which to apply this planting.

◆ mp_oAbundance

ArrayList<PlantingAbundance> sortie.data.funcgroups.planting.PlantingData.mp_oAbundance = new ArrayList<PlantingAbundance>(0)
private

The amount of each species to plant.

◆ mp_oCells

ArrayList<Cell> sortie.data.funcgroups.planting.PlantingData.mp_oCells = new ArrayList<Cell>(0)
private

The list of cells to which to apply this plant (vector of Cell objects)


The documentation for this class was generated from the following file: