SORTIE Java Interface
1
|
This class encapsulates the data for a single harvest event - being for one timestep, for one cut type. More...
Public Member Functions | |
HarvestData (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 | getCutAmountType () |
Gets the cut amount type. More... | |
void | setCutAmountType (int iCut) throws ModelException |
Sets the cut amount type. More... | |
int | getCutType () |
Gets the cut type. More... | |
void | setCutType (int iCut) throws ModelException |
Sets the cut type. More... | |
String | getPriority1Name () |
Gets the data member name for the first cut priority. More... | |
String | getPriority2Name () |
Gets the data member name for the second cut priority. More... | |
String | getPriority3Name () |
Gets the data member name for the third cut priority. More... | |
float | getPriority1Min () |
Gets the minimum value for the first cut priority. More... | |
float | getPriority2Min () |
Gets the minimum value for the second cut priority. More... | |
float | getPriority3Min () |
Gets the minimum value for the third cut priority. More... | |
float | getPriority1Max () |
Gets the maximum value for the first cut priority. More... | |
float | getPriority2Max () |
Gets the maximum value for the second cut priority. More... | |
float | getPriority3Max () |
Gets the maximum value for the third cut priority. More... | |
int | getPriority1Type () |
Gets the data member type for the first cut priority. More... | |
int | getPriority2Type () |
Gets the data member type for the second cut priority. More... | |
int | getPriority3Type () |
Gets the data member type for the third cut priority. More... | |
void | writePriority1XML (BufferedWriter jOut) throws IOException |
Writes XML for the first priority. More... | |
void | writePriority2XML (BufferedWriter jOut) throws IOException |
Writes XML for the second priority. More... | |
void | writePriority3XML (BufferedWriter jOut) throws IOException |
Writes XML for the third priority. More... | |
void | setPriority1 (String sPriorityName, float fMin, float fMax, int iType) |
Sets priority 1 information. More... | |
void | setPriority2 (String sPriorityName, float fMin, float fMax, int iType) |
Sets priority 2 information. More... | |
void | setPriority3 (String sPriorityName, float fMin, float fMax, int iType) |
Sets priority 3 information. More... | |
int | getTimestep () |
Gets the timestep for this cut event. More... | |
void | setTimestep (int iTimestep) throws ModelException |
Sets the timestep for this cut event. More... | |
int | getNumberOfSpecies () |
Gets the number of species to which this cut has been applied. More... | |
int | getSpecies (int iIndex) throws ModelException |
Gets a species at a certain index within the species list. More... | |
void | setSeedlingMortRate (int iSpecies, float fRate) |
Sets the seedling mortality rate for a species. More... | |
float | getSeedlingMortRate (int iSpecies) |
Gets the seedling mortality rate for a species. More... | |
int | getSeedlingMortRateSize () |
Returns the number of set seedling mortality rates. More... | |
void | addSpecies (int iSpecies) |
Adds a new species to apply this harvest cut to. 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... | |
int | getNumberOfCutRanges () |
Gets the number of cut ranges. More... | |
void | addCutRange (float fLow, float fHigh, float fAmountToCut) throws ModelException |
Adds a new cut range. More... | |
float | getLowerBound (int iCutRangeIndex) throws ModelException |
Gets the lower dbh bound value for a cut range. More... | |
boolean | getTallestFirstFlag () |
Gets the flag for whether to cut tallest-to-smallest (true) or smallest- to-tallest (false). More... | |
void | setTallestFirstFlag (boolean bFlag) |
Sets the flag for whether to cut tallest-to-smallest (true) or smallest- to-tallest (false). More... | |
float | getUpperBound (int iCutRangeIndex) throws ModelException |
Gets the upper dbh bound value for a cut range. More... | |
float | getCutAmount (int iCutRangeIndex) throws ModelException |
Gets the cut amount for a cut range. More... | |
int | getNumberOfCells () |
Gets the number of cells in the cut range's cut area. More... | |
void | addCell (int iX, int iY, Plot oPlot) throws ModelException |
Adds a cell to the harvest cut range's area. More... | |
void | addCell (Cell oNewCell) |
Adds a cell to the harvest cut range's area. More... | |
void | removeCell (int iIndex) |
Removes a cell from the harvest cut range's area. More... | |
void | removeAllCells () |
Deletes all cells. More... | |
Cell | getCell (int iIndex) throws ModelException |
Gets a cell in a harvest's cut area. More... | |
void | validateCut (TreePopulation oPop, Plot oPlot) throws ModelException |
Validates the current set of data in this cut. 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 () |
Makes a clone of this object. More... | |
Static Public Attributes | |
static final int | PERCENTAGE_BASAL_AREA = 2 |
Percentage basal area. More... | |
static final int | ABSOLUTE_BASAL_AREA = 3 |
Absolute basal area. More... | |
static final int | PERCENTAGE_DENSITY = 0 |
Percentage density. More... | |
static final int | ABSOLUTE_DENSITY = 1 |
Absolute density. More... | |
static final int | PARTIAL_CUT = 1 |
Partial cut. More... | |
static final int | GAP_CUT = 2 |
Gap cut. More... | |
static final int | CLEAR_CUT = 3 |
Clear cut. More... | |
static int | NUMBER_ALLOWED_CUT_RANGES = 4 |
Maximum number of allowed cut ranges. More... | |
Private Attributes | |
ArrayList< Integer > | mp_iSpecies = new ArrayList<Integer>(0) |
Species codes to which to apply this harvest cut. More... | |
ArrayList< Cell > | mp_oCells = new ArrayList<Cell>(0) |
The list of cells to which to apply this cut (vector of Cell objects) More... | |
ArrayList< CutRange > | mp_oCutRanges = new ArrayList<CutRange>(0) |
The list of cut ranges and cut amounts (CutRange objects) More... | |
ArrayList< Float > | mp_fSeedlingMortRate = new ArrayList<Float>(0) |
Seedling mortality rate. 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 = -1 |
Timestep to which to apply this harvest cut. More... | |
int | m_iCutType = -1 |
The cut type - possible values come from DisturbanceBehaviors and are PARTIAL_CUT, GAP_CUT, and CLEAR_CUT. More... | |
int | m_iCutAmountType = -1 |
How the cut amount is specified - possible values come from DisturbanceBehaviors and are PERCENTAGE_BASAL_AREA, ABSOLUTE_BASAL_AREA, PERCENTAGE_DENSITY, and ABSOLUTE_DENSITY. More... | |
boolean | m_bTallestFirst = true |
Flag for whether to cut tallest-to-smallest (true) or smallest-to-tallest (false. More... | |
CutPriority | m_oPriority1 = new CutPriority() |
First cut priority. More... | |
CutPriority | m_oPriority2 = new CutPriority() |
Second cut priority. More... | |
CutPriority | m_oPriority3 = new CutPriority() |
Third cut priority. More... | |
This class encapsulates the data for a single harvest event - being for one timestep, for one cut type.
Copyright: Copyright (c) Charles D. Canham 2003
Company: Cary Institute of Ecosystem Studies
Edit history:
---------------—
December 8, 2011: Wiped the slate clean for version 7 (LEM)
May 12, 2017: Added flag for cut smallest-to-tallest
sortie.data.funcgroups.disturbance.HarvestData.HarvestData | ( | float | fXCellLength, |
float | fYCellLength | ||
) |
Constructor.
fXCellLength | Length of cells in the X direction. |
fYCellLength | Length of cells in the Y direction. |
void sortie.data.funcgroups.disturbance.HarvestData.addCell | ( | int | iX, |
int | iY, | ||
Plot | oPlot | ||
) | throws ModelException |
Adds a cell to the harvest cut range's area.
Duplicates will not be added.
iX | X cell number. |
iY | Y cell number. |
oPlot | a Plot object. |
ModelException | if the cell coordinates are invalid. |
void sortie.data.funcgroups.disturbance.HarvestData.addCell | ( | Cell | oNewCell | ) |
Adds a cell to the harvest cut range's area.
Duplicates will not be added.
oNewCell | Cell object to add. |
void sortie.data.funcgroups.disturbance.HarvestData.addCutRange | ( | float | fLow, |
float | fHigh, | ||
float | fAmountToCut | ||
) | throws ModelException |
Adds a new cut range.
fLow | Lower bound of the cut range, as a dbh in cm. |
fHigh | Upper bound of the cut range, as a dbh in cm. |
fAmountToCut | Amount to cut. If the amount cut type is as a percentage of either basal area or density, this is a percentage value between 0 and 100. If it is amount of basal area, this is basal area in square meters per hectare. If this is amount of density, this is number of trees per hectare. |
ModelException | if any of the following are true:
|
void sortie.data.funcgroups.disturbance.HarvestData.addSpecies | ( | int | iSpecies | ) |
Adds a new species to apply this harvest cut to.
If this species is already on the list, it is not added again.
iSpecies | Species index. |
void sortie.data.funcgroups.disturbance.HarvestData.clearSpecies | ( | ) |
Clears the list of species.
Object sortie.data.funcgroups.disturbance.HarvestData.clone | ( | ) |
Makes a clone of this object.
Cell sortie.data.funcgroups.disturbance.HarvestData.getCell | ( | int | iIndex | ) | throws ModelException |
Gets a cell in a harvest's cut area.
iIndex | The index of the object. |
ModelException | If the index is not valid. |
float sortie.data.funcgroups.disturbance.HarvestData.getCutAmount | ( | int | iCutRangeIndex | ) | throws ModelException |
Gets the cut amount for a cut range.
iCutRangeIndex | The cut range index. |
ModelException | If the cut range is invalid. |
int sortie.data.funcgroups.disturbance.HarvestData.getCutAmountType | ( | ) |
Gets the cut amount type.
Possible values come from DisturbanceBehaviors and are PERCENTAGE_BASAL_AREA, ABSOLUTE_BASAL_AREA, PERCENTAGE_DENSITY, and ABSOLUTE_DENSITY, or -1 if the value has not yet been set.
int sortie.data.funcgroups.disturbance.HarvestData.getCutType | ( | ) |
Gets the cut type.
float sortie.data.funcgroups.disturbance.HarvestData.getLowerBound | ( | int | iCutRangeIndex | ) | throws ModelException |
Gets the lower dbh bound value for a cut range.
iCutRangeIndex | The cut range index. |
ModelException | If the cut range is invalid. |
int sortie.data.funcgroups.disturbance.HarvestData.getNumberOfCells | ( | ) |
Gets the number of cells in the cut range's cut area.
int sortie.data.funcgroups.disturbance.HarvestData.getNumberOfCutRanges | ( | ) |
Gets the number of cut ranges.
int sortie.data.funcgroups.disturbance.HarvestData.getNumberOfSpecies | ( | ) |
Gets the number of species to which this cut has been applied.
float sortie.data.funcgroups.disturbance.HarvestData.getPriority1Max | ( | ) |
Gets the maximum value for the first cut priority.
float sortie.data.funcgroups.disturbance.HarvestData.getPriority1Min | ( | ) |
Gets the minimum value for the first cut priority.
String sortie.data.funcgroups.disturbance.HarvestData.getPriority1Name | ( | ) |
Gets the data member name for the first cut priority.
int sortie.data.funcgroups.disturbance.HarvestData.getPriority1Type | ( | ) |
Gets the data member type for the first cut priority.
float sortie.data.funcgroups.disturbance.HarvestData.getPriority2Max | ( | ) |
Gets the maximum value for the second cut priority.
float sortie.data.funcgroups.disturbance.HarvestData.getPriority2Min | ( | ) |
Gets the minimum value for the second cut priority.
String sortie.data.funcgroups.disturbance.HarvestData.getPriority2Name | ( | ) |
Gets the data member name for the second cut priority.
int sortie.data.funcgroups.disturbance.HarvestData.getPriority2Type | ( | ) |
Gets the data member type for the second cut priority.
float sortie.data.funcgroups.disturbance.HarvestData.getPriority3Max | ( | ) |
Gets the maximum value for the third cut priority.
float sortie.data.funcgroups.disturbance.HarvestData.getPriority3Min | ( | ) |
Gets the minimum value for the third cut priority.
String sortie.data.funcgroups.disturbance.HarvestData.getPriority3Name | ( | ) |
Gets the data member name for the third cut priority.
int sortie.data.funcgroups.disturbance.HarvestData.getPriority3Type | ( | ) |
Gets the data member type for the third cut priority.
float sortie.data.funcgroups.disturbance.HarvestData.getSeedlingMortRate | ( | int | iSpecies | ) |
Gets the seedling mortality rate for a species.
iSpecies | Species to set. |
int sortie.data.funcgroups.disturbance.HarvestData.getSeedlingMortRateSize | ( | ) |
Returns the number of set seedling mortality rates.
A useful check to see if any were read.
int sortie.data.funcgroups.disturbance.HarvestData.getSpecies | ( | int | iIndex | ) | throws ModelException |
Gets a species at a certain index within the species list.
iIndex | The species index. |
ModelException | If the index is not valid. |
boolean sortie.data.funcgroups.disturbance.HarvestData.getTallestFirstFlag | ( | ) |
Gets the flag for whether to cut tallest-to-smallest (true) or smallest- to-tallest (false).
int sortie.data.funcgroups.disturbance.HarvestData.getTimestep | ( | ) |
Gets the timestep for this cut event.
float sortie.data.funcgroups.disturbance.HarvestData.getUpperBound | ( | int | iCutRangeIndex | ) | throws ModelException |
Gets the upper dbh bound value for a cut range.
iCutRangeIndex | The cut range index. |
ModelException | If the cut range is invalid. |
float sortie.data.funcgroups.disturbance.HarvestData.getXCellLength | ( | ) |
Gets the length of the cells in the X direction that define the area of this event.
float sortie.data.funcgroups.disturbance.HarvestData.getYCellLength | ( | ) |
Gets the length of the cells in the Y direction that define the area of this event.
void sortie.data.funcgroups.disturbance.HarvestData.removeAllCells | ( | ) |
Deletes all cells.
void sortie.data.funcgroups.disturbance.HarvestData.removeCell | ( | int | iIndex | ) |
Removes a cell from the harvest cut range's area.
iIndex | int Cell index. Invalid values are ignored. |
void sortie.data.funcgroups.disturbance.HarvestData.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.
iSpecies | Species number (number identifying the species, NOT the index number in the vector). |
void sortie.data.funcgroups.disturbance.HarvestData.setCutAmountType | ( | int | iCut | ) | throws ModelException |
Sets the cut amount type.
iCut | the cut amount type. Possible values come from DisturbanceBehaviors and are PERCENTAGE_BASAL_AREA, ABSOLUTE_BASAL_AREA, PERCENTAGE_DENSITY, and ABSOLUTE_DENSITY. |
ModelException | if the cut amount type is unrecognized. |
void sortie.data.funcgroups.disturbance.HarvestData.setCutType | ( | int | iCut | ) | throws ModelException |
Sets the cut type.
iCut | The cut type. Values come from DisturbanceBehaviors and are PARTIAL_CUT, GAP_CUT, and CLEAR_CUT. |
ModelException | if the cut type is unrecognized. |
void sortie.data.funcgroups.disturbance.HarvestData.setPriority1 | ( | String | sPriorityName, |
float | fMin, | ||
float | fMax, | ||
int | iType | ||
) |
Sets priority 1 information.
sPriorityName | Priority name |
fMin | Min value |
fMax | Max value |
iType | Type, from DataMember: FLOAT, INTEGER, or BOOLEAN |
void sortie.data.funcgroups.disturbance.HarvestData.setPriority2 | ( | String | sPriorityName, |
float | fMin, | ||
float | fMax, | ||
int | iType | ||
) |
Sets priority 2 information.
sPriorityName | Priority name |
fMin | Min value |
fMax | Max value |
iType | Type, from DataMember: FLOAT, INTEGER, or BOOLEAN |
void sortie.data.funcgroups.disturbance.HarvestData.setPriority3 | ( | String | sPriorityName, |
float | fMin, | ||
float | fMax, | ||
int | iType | ||
) |
Sets priority 3 information.
sPriorityName | Priority name |
fMin | Min value |
fMax | Max value |
iType | Type, from DataMember: FLOAT, INTEGER, or BOOLEAN |
void sortie.data.funcgroups.disturbance.HarvestData.setSeedlingMortRate | ( | int | iSpecies, |
float | fRate | ||
) |
Sets the seedling mortality rate for a species.
Value should be between 0 and 100.
iSpecies | Species to set. |
fRate | Mortality rate. |
void sortie.data.funcgroups.disturbance.HarvestData.setTallestFirstFlag | ( | boolean | bFlag | ) |
Sets the flag for whether to cut tallest-to-smallest (true) or smallest- to-tallest (false).
bFlag | Tallest-to-smallest flag. |
void sortie.data.funcgroups.disturbance.HarvestData.setTimestep | ( | int | iTimestep | ) | throws ModelException |
Sets the timestep for this cut event.
iTimestep | The timestep to set. |
ModelException | if the timestep is less than 0. |
void sortie.data.funcgroups.disturbance.HarvestData.setXCellLength | ( | float | fXCellLength | ) |
Sets the length of the cells in the X direction that define the area of this event.
fXCellLength | Length of the cells. |
void sortie.data.funcgroups.disturbance.HarvestData.setYCellLength | ( | float | fYCellLength | ) |
Sets the length of the cells in the Y direction that define the area of this event.
fYCellLength | Length of the cells. |
void sortie.data.funcgroups.disturbance.HarvestData.updateCellsNewGridResolution | ( | float | fNewXCellLength, |
float | fNewYCellLength, | ||
Plot | oPlot | ||
) | throws ModelException |
Adjusts any existing cell lists in response to grid cell changes.
fNewXCellLength | New X cell length. |
fNewYCellLength | New Y cell length. |
oPlot | Plot object. |
ModelException | shouldn't. |
void sortie.data.funcgroups.disturbance.HarvestData.validateCut | ( | TreePopulation | oPop, |
Plot | oPlot | ||
) | throws ModelException |
Validates the current set of data in this cut.
This makes sure the following are all true:
oPop | TreePopulation object, to help verify data |
oPlot | Plot object for timestep verification |
ModelException | if any of the above conditions is not true |
void sortie.data.funcgroups.disturbance.HarvestData.writePriority1XML | ( | BufferedWriter | jOut | ) | throws IOException |
Writes XML for the first priority.
jOut | File to write to. |
IOException |
void sortie.data.funcgroups.disturbance.HarvestData.writePriority2XML | ( | BufferedWriter | jOut | ) | throws IOException |
Writes XML for the second priority.
jOut | File to write to. |
IOException |
void sortie.data.funcgroups.disturbance.HarvestData.writePriority3XML | ( | BufferedWriter | jOut | ) | throws IOException |
Writes XML for the third priority.
jOut | File to write to. |
IOException |
|
static |
Absolute basal area.
Matches the old code's enum value - that's important!
|
static |
Absolute density.
Matches the old code's enum value - that's important!
|
static |
Clear cut.
Matches the old code's enum value - that's important!.
|
static |
Gap cut.
Matches the old code's enum value - that's important!.
|
private |
Flag for whether to cut tallest-to-smallest (true) or smallest-to-tallest (false.
|
private |
Length of cells in the X direction.
|
private |
Length of cells in the Y direction.
|
private |
How the cut amount is specified - possible values come from DisturbanceBehaviors and are PERCENTAGE_BASAL_AREA, ABSOLUTE_BASAL_AREA, PERCENTAGE_DENSITY, and ABSOLUTE_DENSITY.
|
private |
The cut type - possible values come from DisturbanceBehaviors and are PARTIAL_CUT, GAP_CUT, and CLEAR_CUT.
|
private |
Timestep to which to apply this harvest cut.
|
private |
First cut priority.
|
private |
Second cut priority.
|
private |
Third cut priority.
|
private |
Seedling mortality rate.
|
private |
Species codes to which to apply this harvest cut.
|
private |
The list of cells to which to apply this cut (vector of Cell objects)
|
private |
The list of cut ranges and cut amounts (CutRange objects)
|
static |
Maximum number of allowed cut ranges.
|
static |
Partial cut.
Matches the old code's enum value - that's important!.
|
static |
Percentage basal area.
Matches the old code's enum value - that's important!
|
static |
Percentage density.
Matches the old code's enum value - that's important!