SORTIE Java Interface  1
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
sortie.data.funcgroups.Behavior Class Referenceabstract

Represents a single behavior in the core. More...

Inheritance diagram for sortie.data.funcgroups.Behavior:
sortie.data.funcgroups.Allometry sortie.data.funcgroups.analysis.BoleVolumeCalculator sortie.data.funcgroups.analysis.CarbonValueCalculator sortie.data.funcgroups.analysis.ConditOmegaCalculator sortie.data.funcgroups.analysis.DimensionAnalysis sortie.data.funcgroups.analysis.FoliarChemistry sortie.data.funcgroups.analysis.MerchValueCalculator sortie.data.funcgroups.analysis.PartitionedDBHBiomass sortie.data.funcgroups.analysis.PartitionedHeightBiomass sortie.data.funcgroups.analysis.RipleysKCalculator sortie.data.funcgroups.analysis.StateReporter sortie.data.funcgroups.analysis.StormKilledPartitionedDBHBiomass sortie.data.funcgroups.analysis.StormKilledPartitionedHeightBiomass sortie.data.funcgroups.analysis.TreeAgeCalculator sortie.data.funcgroups.analysis.VolumeCalculator sortie.data.funcgroups.disperse.DisperseBase sortie.data.funcgroups.disperse.StochDoubleLogTempDepNeighDisperse sortie.data.funcgroups.disturbance.CompetitionHarvest sortie.data.funcgroups.disturbance.DensDepInfestation sortie.data.funcgroups.disturbance.EpisodicMortality sortie.data.funcgroups.disturbance.GeneralizedHarvestRegime sortie.data.funcgroups.disturbance.Harvest sortie.data.funcgroups.disturbance.HarvestInterface sortie.data.funcgroups.disturbance.InsectInfestation sortie.data.funcgroups.disturbance.RandomBrowse sortie.data.funcgroups.disturbance.SelectionHarvest sortie.data.funcgroups.disturbance.Storm sortie.data.funcgroups.disturbance.StormDamageApplier sortie.data.funcgroups.disturbance.StormDamageKiller sortie.data.funcgroups.disturbance.StormDirectKiller sortie.data.funcgroups.disturbance.Windstorm sortie.data.funcgroups.epiphyticestablishment.EpiphyticEstablishment sortie.data.funcgroups.establishment.ConspecificTreeDensitySeedSurvival sortie.data.funcgroups.establishment.DensityDependentSeedSurvival sortie.data.funcgroups.establishment.Establishment sortie.data.funcgroups.establishment.LightDependentSeedSurvival sortie.data.funcgroups.establishment.MicroEstablishment sortie.data.funcgroups.establishment.MicrotopographicSubstrateSeedSurvival sortie.data.funcgroups.establishment.ProportionalSeedSurvival sortie.data.funcgroups.establishment.StormLightDependentSeedSurvival sortie.data.funcgroups.establishment.SubstrateDepEstablishmentBase sortie.data.funcgroups.growth.AbsoluteGrowthBALimited sortie.data.funcgroups.growth.AbsoluteGrowthRadialLimited sortie.data.funcgroups.growth.AbsoluteUnlimited sortie.data.funcgroups.growth.AllometricDiam sortie.data.funcgroups.growth.AllometricHeight sortie.data.funcgroups.growth.BrowsedRelativeGrowth sortie.data.funcgroups.growth.ConstantBA sortie.data.funcgroups.growth.ConstantRadial sortie.data.funcgroups.growth.DoubleMMRel sortie.data.funcgroups.growth.LaggedPostHarvestGrowth sortie.data.funcgroups.growth.LinearBiLevel sortie.data.funcgroups.growth.LogBiLevel sortie.data.funcgroups.growth.Logistic sortie.data.funcgroups.growth.LogisticHeightOnly sortie.data.funcgroups.growth.Lognormal sortie.data.funcgroups.growth.LognormalHeightOnly sortie.data.funcgroups.growth.MichMenNeg sortie.data.funcgroups.growth.MichMenPhotoinhibition sortie.data.funcgroups.growth.PowerHeight sortie.data.funcgroups.growth.PRSemiStochDiamOnly sortie.data.funcgroups.growth.PRStormBiLevel sortie.data.funcgroups.growth.RelativeGrowthBALimited sortie.data.funcgroups.growth.RelativeGrowthRadialLimited sortie.data.funcgroups.growth.RelativeHeight sortie.data.funcgroups.growth.RelativeUnlimited sortie.data.funcgroups.growth.ShadedLinearGrowth sortie.data.funcgroups.growth.ShadedLinearGrowthHeightOnly sortie.data.funcgroups.growth.SimpleLinear sortie.data.funcgroups.growth.SimpleLinearHeightOnly sortie.data.funcgroups.growth.SizeDepLogistic sortie.data.funcgroups.growth.SizeDepLogisticHeightOnly sortie.data.funcgroups.growth.StochasticGap sortie.data.funcgroups.light.AverageLight sortie.data.funcgroups.light.BasalAreaLight sortie.data.funcgroups.light.ConstantGLI sortie.data.funcgroups.light.GapLight sortie.data.funcgroups.light.GLIBase sortie.data.funcgroups.light.LightFilter sortie.data.funcgroups.light.StormLight sortie.data.funcgroups.management.QualityVigorClassifier sortie.data.funcgroups.mortality.AggregatedMortality sortie.data.funcgroups.mortality.BCMort sortie.data.funcgroups.mortality.BrowsedStochasticMortality sortie.data.funcgroups.mortality.ClimateCompDepNeighborhoodSurvival sortie.data.funcgroups.mortality.CompetitionMortality sortie.data.funcgroups.mortality.DensitySelfThinning sortie.data.funcgroups.mortality.DensitySelfThinningGompertz sortie.data.funcgroups.mortality.ExpResourceMortality sortie.data.funcgroups.mortality.GMFMort sortie.data.funcgroups.mortality.GrowthResourceMortality sortie.data.funcgroups.mortality.HeightGLIWeibullMortality sortie.data.funcgroups.mortality.InsectInfestationMortality sortie.data.funcgroups.mortality.LogisticBiLevelMortality sortie.data.funcgroups.mortality.PostHarvestSkiddingMort sortie.data.funcgroups.mortality.SelfThinMort sortie.data.funcgroups.mortality.SenescenceMort sortie.data.funcgroups.mortality.SizeDependentLogisticMortality sortie.data.funcgroups.mortality.StochasticBiLevelLightMortality sortie.data.funcgroups.mortality.StochasticMort sortie.data.funcgroups.mortality.SuppressionDurationMort sortie.data.funcgroups.mortality.TempDepNeighborhoodSurvival sortie.data.funcgroups.mortality.WeibullSnagMort sortie.data.funcgroups.mortalityutilities.DeadTreeRemover sortie.data.funcgroups.nci.CrowdingEffectDefault sortie.data.funcgroups.nci.CrowdingEffectNoSize sortie.data.funcgroups.nci.CrowdingEffectTempDep sortie.data.funcgroups.nci.DamageEffectDefault sortie.data.funcgroups.nci.InfectionEffect sortie.data.funcgroups.nci.InfectionEffectSizeDependent sortie.data.funcgroups.nci.NCILargerNeighbors sortie.data.funcgroups.nci.NCIMasterBase sortie.data.funcgroups.nci.NCINeighborBA sortie.data.funcgroups.nci.NCITermBARatio sortie.data.funcgroups.nci.NCITermBARatioDBHDefault sortie.data.funcgroups.nci.NCITermDefault sortie.data.funcgroups.nci.NCITermNCIBARatio sortie.data.funcgroups.nci.NCITermNCIBARatioDBHDefault sortie.data.funcgroups.nci.NCITermNCITempDepBARatio sortie.data.funcgroups.nci.NCITermNCITempDepBARatioDBHDefault sortie.data.funcgroups.nci.NCITermWithNeighborDamage sortie.data.funcgroups.nci.NCIWithSeedlings sortie.data.funcgroups.nci.NitrogenEffectGaussian sortie.data.funcgroups.nci.PrecipitationEffectDoubleLogistic sortie.data.funcgroups.nci.PrecipitationEffectWeibull sortie.data.funcgroups.nci.ShadingDefault sortie.data.funcgroups.nci.SizeEffectCompoundExpInf sortie.data.funcgroups.nci.SizeEffectCompoundExponential sortie.data.funcgroups.nci.SizeEffectDefault sortie.data.funcgroups.nci.SizeEffectLowerBounded sortie.data.funcgroups.nci.SizeEffectPowerFunction sortie.data.funcgroups.nci.SizeEffectShiftedLogInf sortie.data.funcgroups.nci.SizeEffectShiftedLognormal sortie.data.funcgroups.nci.TemperatureEffectDoubleLogistic sortie.data.funcgroups.nci.TemperatureEffectWeibull sortie.data.funcgroups.output.DetailedOutput sortie.data.funcgroups.output.ShortOutput sortie.data.funcgroups.planting.Planting sortie.data.funcgroups.Plot sortie.data.funcgroups.seedpredation.FuncResponseSeedPredation sortie.data.funcgroups.seedpredation.FuncResponseSeedPredationLnk sortie.data.funcgroups.seedpredation.NeighborhoodSeedPredation sortie.data.funcgroups.seedpredation.NeighborhoodSeedPredationLnk sortie.data.funcgroups.snagdynamics.SnagDecayClassDynamics sortie.data.funcgroups.statechange.ClimateImporter sortie.data.funcgroups.statechange.PrecipitationClimateChange sortie.data.funcgroups.statechange.SeasonalWaterDeficit sortie.data.funcgroups.statechange.TemperatureClimateChange sortie.data.funcgroups.substrate.DetailedSubstrate sortie.data.funcgroups.substrate.Substrate sortie.data.funcgroups.TreeBehavior

Classes

enum  setupType
 How this behavior's setup interface is handled. More...
 

Public Member Functions

GUIManager getGUIManager ()
 
 Behavior (GUIManager oManager, BehaviorTypeBase oParent, String sDescriptor, String sParFileTag, String sXMLRootString, String sHelpFileString)
 Constructor. More...
 
abstract void validateData (TreePopulation oPop) throws ModelException
 Override this to implement data checking. More...
 
void callSetupDialog (JDialog jParent, MainWindow oMain)
 Override this to call a specific setup dialog for this behavior. More...
 
int getNumberOfDataObjects ()
 Gets the number of managed data objects. More...
 
ModelData getDataObject (int iInd)
 Gets the managed data object at a particular index. More...
 
void validate () throws ModelException
 Behavior performs an internal check to make sure its settings are consistent and logical. More...
 
void setListPosition (int iListPosition) throws ModelException
 Sets the behavior list position. More...
 
int getListPosition ()
 Gets the behavior list position. More...
 
String getXMLParametersRoot ()
 Gets the XML parameter root string. More...
 
int getNumberNewDataMembers ()
 
DataMember getNewTreeDataMember (int iIndex) throws ModelException
 
void setCanApplyTo (int iType, boolean bCanApply)
 Sets whether this behavior can apply to a given tree type. More...
 
String getParameterFileBehaviorName ()
 Gets the parameter file name for this behavior. More...
 
double getVersion ()
 Gets behavior's parameter file version. More...
 
double getMinimumVersion ()
 Gets behavior's parameter file minimum version. More...
 
String getDescriptor ()
 Gets the descriptor string. More...
 
String getHelpFileString ()
 Gets the help file UD. More...
 
void setDescriptor (String s)
 Sets the descriptor string. More...
 
int getNumberOfCombos ()
 Gets the number of species/type combos to which this behavior applies. More...
 
int getNumberOfGrids ()
 Gets the number of grids to which this behavior applies. More...
 
void deleteSpeciesTypeCombo (int iIndex) throws ModelException
 Deletes the SpeciesTypeCombo at the given index. More...
 
void deleteSpeciesTypeCombo (SpeciesTypeCombo oCombo) throws ModelException
 Deletes a SpeciesTypeCombo. More...
 
void clearSpeciesTypeCombos ()
 Empties the species/type combo list. More...
 
SpeciesTypeCombo getSpeciesTypeCombo (int iIndex) throws ModelException
 Returns the SpeciesTypeCombo at the given index of the species/type combo list. More...
 
Grid getGrid (int iIndex) throws ModelException
 Returns the Grid at the given index of the grid applies to list. More...
 
ModelData getRequiredData (int iIndex)
 Returns the required data object at a given index. More...
 
int getNumberOfRequiredDataObjects ()
 Gets the number of required data objects for this behavior. More...
 
void addSpeciesTypeCombo (SpeciesTypeCombo oCombo) throws ModelException
 Adds a new species/type combo to the list to which this behavior applies. More...
 
void addGrid (Grid oGrid, boolean bReplace)
 Adds a new Grid to the list to which this behavior applies. More...
 
void addRequiredData (ModelData oData)
 Adds a piece of required data to the list. More...
 
boolean [] getWhichSpeciesUsed (TreePopulation oPop)
 Returns which species to which this behavior is applied. More...
 
boolean setVectorValueByXMLTag (String sXMLTag, String sXMLParentTag, ArrayList< String > p_oData, String[] p_sChildXMLTags, boolean[] p_bAppliesTo, Attributes oParentAttributes, Attributes[] p_oAttributes) throws ModelException
 Sets a data vector's value. More...
 
boolean setSingleValueByXMLTag (String sXMLTag, String sXMLParentTag, Attributes oAttributes, Object oData) throws ModelException
 Sets a data object's value. More...
 
ModelData findObjectByXMLTag (String sXMLTag)
 Finds an object based on its XML tag. More...
 
void copySpecies (int iSpeciesCopyFrom, int iSpeciesCopyTo) throws ModelException
 Copies one species to another. More...
 
void writeXML (BufferedWriter jOut, TreePopulation oPop) throws ModelException
 Writes the XML data to a parameter file for the behaviors owned by this object. More...
 
void writeSpeciesSpecificValue (BufferedWriter jOut, ModelVector p_oData, TreePopulation oPop) throws java.io.IOException, ModelException
 Writes a set of species-specific float values to a parameter file. More...
 
void writeSpeciesSpecificValue (BufferedWriter jOut, ModelVector p_oData, TreePopulation oPop, boolean[] p_bFlags) throws java.io.IOException, ModelException
 Writes a set of species-specific values to a parameter file for a certain subset of species. More...
 
void readXMLParentTag (String sXMLTag, Attributes oAttributes) throws ModelException
 Accepts an XML parent tag (empty, no data) from the parser. More...
 
void changeOfSpeciesName (String sOldSpecies, String sNewSpecies)
 Performs any necessary tasks associated with changing the name of a species. More...
 
void changeOfSpecies (int iOldNumSpecies, int[] p_iIndexer, String[] p_sNewSpecies) throws ModelException
 Triggered when there is a change in the species list. More...
 
boolean getMustHaveTrees ()
 Gets whether this behavior must have trees. More...
 
ModelData findObjectByDescriptor (String sDescriptor)
 Finds an object based on its descriptor. More...
 
void writeBehaviorNode (BufferedWriter out, TreePopulation oPop) throws ModelException
 Writes behavior tags to the parameter file. More...
 
ArrayList< BehaviorParameterDisplayformatDataForDisplay (TreePopulation oPop)
 Formats data for display in a set of JTables. More...
 
String getAppliedToForDisplay (TreePopulation oPop)
 Get which species/types this behavior applies to, in a display-friendly format truncated to 250 chars. More...
 
void readDataFromDisplay (ArrayList< BehaviorParameterDisplay > oData, TreePopulation oPop) throws ModelException
 Reads in data from the parameter display window. More...
 
boolean canBeDuplicated ()
 Whether or not this behavior can be duplicated in the run. More...
 
void endOfParameterFileRead ()
 Called at the end of the parameter file read process. More...
 
void changeOfPlotResolution (float fOldX, float fOldY, float fNewX, float fNewY) throws ModelException
 Performs any tasks associated with a change of plot resolution. More...
 
setupType getSetupType ()
 
void writeParametersToTextFile (FileWriter jOut, TreePopulation oPop) throws IOException
 Writes the parameters for the behavior to file, using the same system as the basic parameter display and entry system. More...
 

Static Public Member Functions

static void setVectorValues (ModelVector oData, Float[] p_fValuesToSet, boolean[] p_bAppliesTo)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, Float[] p_fValuesToSet)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, Double[] p_fValuesToSet, boolean[] p_bAppliesTo)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, Double[] p_fValuesToSet)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, Integer[] p_iValuesToSet, boolean[] p_bAppliesTo)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, String[] p_sValuesToSet)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, String[] p_sValuesToSet, boolean[] p_bAppliesTo)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector oData, Integer[] p_iValuesToSet)
 Sets the values for vector variables. More...
 
static void setVectorValues (ModelVector p_oData, ArrayList< String > p_oValuesToSet, boolean[] p_bAppliesTo) throws ModelException
 Sets the values for vector variables. More...
 
static void writeDataToFile (BufferedWriter ojOut, ModelData oData) throws java.io. IOException
 Writes a piece of data to an XML file. More...
 
static Object [] formatBlankHeaderRow (Object[][] p_oTable)
 Creates a blank header row for a table. More...
 
static Object [][] formatDataAsComboBox (Object[][] p_oExisting, ModelEnum oToFormat)
 Adds a value with combo box formatting to an Object array for display in a JTable. More...
 
static String formatComboBoxString (ModelEnum oToFormat)
 Formats a combo box string from a ModelEnum. More...
 
static void addDataObjectToDisplayArrays (ModelData p_oDataObject, ArrayList< ModelData > p_oSingles, ArrayList< ArrayList< SpeciesSpecific >> p_oSpeciesSpecific, boolean[] p_bAppliesTo)
 Adds a data object to the arrays which will eventually display run parameters in a set of tables. More...
 
static Object [][] addDataToArray (Object[][] p_oExistingArray, Object[] p_oAddArray)
 Adds an Object array to an existing Object array. More...
 
static Object [][] formatDataForTable (Object[][] p_oExisting, ModelFloat oToFormat)
 Formats and adds a value into an Object array suitable for placing in a JTable. More...
 
static Object [][] formatDataForTable (Object[][] p_oExisting, ModelInt oToFormat)
 Formats and adds a value into an Object array suitable for placing in a JTable. More...
 
static Object [][] formatDataForTable (Object[][] p_oExisting, ModelString oToFormat)
 Formats and adds a value into an Object array suitable for placing in a JTable. More...
 
static Object [][] formatDataForTable (Object[][] p_oExisting, ModelVector oToFormat)
 Formats a vector of values into an object array and adds it to another Object array suitable for placing in a JTable. More...
 
static Object [][] formatDataForTable (Object[][] p_oExisting, ModelVector oToFormat, boolean[] p_bWhichSpecies)
 Formats a vector of values into a plain vector suitable for placing in a JTable and adds it to a vector of vectors at the end. More...
 
static Object [] formatSpeciesHeaderRow (boolean[] p_bUsed, TreePopulation oPop)
 Creates an object array of strings consisting of species names, suitable for including in the parameter entry table. More...
 
static void ensureSize (ArrayList<?> list, int size)
 Ensure an ArrayList is at least a specific size. More...
 

Public Attributes

boolean m_bMustHaveTrees = true
 If true, and a tree has no species/type combos, it automatically becomes disabled. More...
 

Protected Member Functions

void setSingleValue (ModelData oDataMember, Object oData) throws ModelException
 Sets the value of a single data member. More...
 
BehaviorParameterDisplay formatTable (ArrayList< ModelData > p_oSingles, ArrayList< ArrayList< SpeciesSpecific >> p_oSpeciesSpecific, TreePopulation oPop)
 Turns vector groups of data objects into a set of tables for display. More...
 

Static Protected Member Functions

static boolean boolArraysEqual (boolean[] p_bArrayOne, boolean[] p_bArrayTwo)
 Tests two boolean arrays for equality. More...
 

Protected Attributes

GUIManager m_oManager
 GUIManager object. More...
 
BehaviorTypeBase m_oParent
 Parent manager. More...
 
ArrayList< ModelDatamp_oAllData = new ArrayList<ModelData>()
 All data for this object. More...
 
ArrayList< SpeciesTypeCombomp_oTreesAppliesTo = new ArrayList<SpeciesTypeCombo>(0)
 A set of SpeciesTypeCombo objects to which this behavior is applied - or none if it is not applied to trees. More...
 
ArrayList< Integer > mp_iGridsAppliesTo = new ArrayList<Integer>(0)
 A set of hashcodes of the Grids to which this behavior is applied - or none if it is not applied to grids. More...
 
ArrayList< DataMembermp_oNewTreeDataMembers = new ArrayList<DataMember>(0)
 The new tree data members that this behavior adds, above and beyond the basic tree population data members. More...
 
boolean m_bCanBeDuplicated = true
 Whether or not this behavior can have multiple copies in a run or not. More...
 
String m_sDescriptor = ""
 This is what will be displayed as the name of a given behavior in the GUI. More...
 
String m_sParFileTag = ""
 String which is used to identify this behavior in the parameter file. More...
 
String m_sXMLRootString = ""
 XML tag to surround this behavior's data. More...
 
String m_sHelpFileString = ""
 Help file topic identifier string. More...
 
boolean [] mp_bCanApplyToTreeType
 For each tree type, whether or not this behavior can be applied to it. More...
 
double m_fVersion = 1.0
 Version of this behavior. More...
 
double m_fMinVersion = 1.0
 Minimum version of this behavior. More...
 
int m_iListPosition = -1
 This behavior's position in the behavior list. More...
 
setupType m_iBehaviorSetupType
 

Detailed Description

Represents a single behavior in the core.

There is a one-to-one relationship between behaviors in the core model and objects of this class.

Behaviors can count on the tree population information being available when they are instantiated.

Copyright: Copyright (c) 2011 Company: Cary Institute of Ecosystem Studies

Author
Lora E. Murphy
Version
1.0


Edit history:
---------------—
December 8, 2011: Wiped the slate clean for version 7 (LEM)

Constructor & Destructor Documentation

◆ Behavior()

sortie.data.funcgroups.Behavior.Behavior ( GUIManager  oManager,
BehaviorTypeBase  oParent,
String  sDescriptor,
String  sParFileTag,
String  sXMLRootString,
String  sHelpFileString 
)

Constructor.

Parameters
oManagerGUI manager.
oParentParent managing object.
sDescriptorThe name of the behavior for the user.
sParFileTagString which is used to identify this behavior in the parameter file.
sXMLRootStringXML tag to surround this behavior's data.
sHelpFileStringString matching this behavior's topic in the help

Member Function Documentation

◆ addDataObjectToDisplayArrays()

static void sortie.data.funcgroups.Behavior.addDataObjectToDisplayArrays ( ModelData  p_oDataObject,
ArrayList< ModelData p_oSingles,
ArrayList< ArrayList< SpeciesSpecific >>  p_oSpeciesSpecific,
boolean []  p_bAppliesTo 
)
static

Adds a data object to the arrays which will eventually display run parameters in a set of tables.

There are two possible vectors to which to add the data object - one grouping single values, and other grouping groups of species-specific values according to the species they require.

When a new data object is to be added to the list, the first thing to do is see if it's already there. If it is, and it's not species-specific, it's not added again. If it is species-specific, the species to which it applies are merged with the existing list and it is re-grouped if necessary.

Parameters
p_oDataObjectData object to add
p_oSinglesSet of single values
p_oSpeciesSpecificSet of species-specific values
p_bAppliesToIf this is a species-specific value, what it applies to

◆ addDataToArray()

static Object [][] sortie.data.funcgroups.Behavior.addDataToArray ( Object  p_oExistingArray[][],
Object []  p_oAddArray 
)
static

Adds an Object array to an existing Object array.

The new array is added at the end. If the existing array is null, it will be created.

Parameters
p_oExistingArrayObject array to add to.
p_oAddArrayArray to add.
Returns
The new Object array.

◆ addGrid()

void sortie.data.funcgroups.Behavior.addGrid ( Grid  oGrid,
boolean  bReplace 
)

Adds a new Grid to the list to which this behavior applies.

If this exact grid object is already added, nothing is done. Calling this method does NOT automatically cause the behavior to become enabled, because grids are more of an inherent property of behaviors. For this reason, a Behavior should always be notified of its Grids whether or not it is enabled.

Parameters
oGridGrid to add.
bReplaceIf true, this grid replaces any existing grids with this name. If false, if it has the same name as another grid object, the first grid is used and this grid is dropped.

◆ addRequiredData()

void sortie.data.funcgroups.Behavior.addRequiredData ( ModelData  oData)

Adds a piece of required data to the list.

Parameters
oDataData to add.

◆ addSpeciesTypeCombo()

void sortie.data.funcgroups.Behavior.addSpeciesTypeCombo ( SpeciesTypeCombo  oCombo) throws ModelException

Adds a new species/type combo to the list to which this behavior applies.

If this particular species/type combo is already on the list, it's not added again. Calling this causes this behavior to become enabled.

Parameters
oComboThe new species/type combo.
Exceptions
ModelExceptionif the tree type in the combo cannot be applied to this behavior according to mp_bCanApplyToTreeType.

◆ boolArraysEqual()

static boolean sortie.data.funcgroups.Behavior.boolArraysEqual ( boolean []  p_bArrayOne,
boolean []  p_bArrayTwo 
)
staticprotected

Tests two boolean arrays for equality.

Equality is defined as having the same value in each array bucket.

Parameters
p_bArrayOneFirst array.
p_bArrayTwoSecond array.
Returns
true if the arrays are equal, false if they are not.

◆ callSetupDialog()

void sortie.data.funcgroups.Behavior.callSetupDialog ( JDialog  jParent,
MainWindow  oMain 
)

Override this to call a specific setup dialog for this behavior.

Otherwise the default is called.

◆ canBeDuplicated()

boolean sortie.data.funcgroups.Behavior.canBeDuplicated ( )

Whether or not this behavior can be duplicated in the run.

Returns
Whether or not this behavior can be duplicated in the run.

◆ changeOfPlotResolution()

void sortie.data.funcgroups.Behavior.changeOfPlotResolution ( float  fOldX,
float  fOldY,
float  fNewX,
float  fNewY 
) throws ModelException

Performs any tasks associated with a change of plot resolution.

Parameters
fOldXfloat Old plot X length.
fOldYfloat Old plot Y length.
fNewXfloat New plot X length.
fNewYfloat New plot Y length.
Exceptions
ModelExceptionif anything goes wrong.

◆ changeOfSpecies()

void sortie.data.funcgroups.Behavior.changeOfSpecies ( int  iOldNumSpecies,
int []  p_iIndexer,
String []  p_sNewSpecies 
) throws ModelException

Triggered when there is a change in the species list.

This goes through everything in the mp_oAllData array. Any piece of data of type ModelVector which is species-specific is transformed. The ModelVector will be re-sized to match the new number of species. Any species that are the same from the old set to the new have their data transferred to their new array index. Any new species indexes are set to null. Any species which were deleted have their data lost.

Parameters
iOldNumSpeciessays how many species there used to be.
p_iIndexeris an array, sized to the new number of species. For each bucket (representing the index number of a species on the new list), the value is either the index of that same species in the old species list, or -1 if the species is new.
p_sNewSpeciesThe new species list.
Exceptions
ModelExceptionif there's a problem.

◆ changeOfSpeciesName()

void sortie.data.funcgroups.Behavior.changeOfSpeciesName ( String  sOldSpecies,
String  sNewSpecies 
)

Performs any necessary tasks associated with changing the name of a species.

Everything about the species remains the same except for the name. This is an easier process than actually changing the species list.

Parameters
sOldSpeciesString Old name of the species, with underscores instead of spaces (like the species names would come from the tree population)
sNewSpeciesString New name of the species, with underscores instead of spaces (like the species names would come from the tree population)
Exceptions
ModelExceptionif there is a problem.

◆ clearSpeciesTypeCombos()

void sortie.data.funcgroups.Behavior.clearSpeciesTypeCombos ( )

Empties the species/type combo list.

◆ copySpecies()

void sortie.data.funcgroups.Behavior.copySpecies ( int  iSpeciesCopyFrom,
int  iSpeciesCopyTo 
) throws ModelException

Copies one species to another.

This makes sure all species-specific vectors are updated and that behavior assignments are the same.

Parameters
iSpeciesCopyFromint Species to copy.
iSpeciesCopyToint Species that is the copy.
Exceptions
ModelExceptionif there is a problem.

◆ deleteSpeciesTypeCombo() [1/2]

void sortie.data.funcgroups.Behavior.deleteSpeciesTypeCombo ( int  iIndex) throws ModelException

Deletes the SpeciesTypeCombo at the given index.

If this removes the last combo, and the behavior has its m_bMustHaveTrees flag set to true, this sets m_bIsEnabled to false.

Parameters
iIndexThe index number of the SpeciesTypeCombo.
Exceptions
ModelExceptionif the index number is invalid.

◆ deleteSpeciesTypeCombo() [2/2]

void sortie.data.funcgroups.Behavior.deleteSpeciesTypeCombo ( SpeciesTypeCombo  oCombo) throws ModelException

Deletes a SpeciesTypeCombo.

This is a safe way to do it - if the combo doesn't exist, this quietly exits.

Parameters
oComboThe SpeciesTypeCombo object to delete.
Exceptions
ModelExceptionif the index number is invalid.

◆ endOfParameterFileRead()

void sortie.data.funcgroups.Behavior.endOfParameterFileRead ( )

Called at the end of the parameter file read process.

Override this to do anything at that point.

◆ ensureSize()

static void sortie.data.funcgroups.Behavior.ensureSize ( ArrayList<?>  list,
int  size 
)
static

Ensure an ArrayList is at least a specific size.

Parameters
list
size

◆ findObjectByDescriptor()

ModelData sortie.data.funcgroups.Behavior.findObjectByDescriptor ( String  sDescriptor)

Finds an object based on its descriptor.

Parameters
sDescriptorDescriptor for the object.
Returns
ModelData object corresponding to the descriptor, or null if no such object is found.

◆ findObjectByXMLTag()

ModelData sortie.data.funcgroups.Behavior.findObjectByXMLTag ( String  sXMLTag)

Finds an object based on its XML tag.

Parameters
sXMLTagXML tag for the object.
Returns
ModelData object corresponding to the XML tag, or null if no such object is found.

◆ formatBlankHeaderRow()

static Object [] sortie.data.funcgroups.Behavior.formatBlankHeaderRow ( Object  p_oTable[][])
static

Creates a blank header row for a table.

It will be sized the same size as the size of the array in the first array position.

Parameters
p_oTableThe table for which to create the blank header row.
Returns
The blank header row.

◆ formatComboBoxString()

static String sortie.data.funcgroups.Behavior.formatComboBoxString ( ModelEnum  oToFormat)
static

Formats a combo box string from a ModelEnum.

The formatting consists of some special characters in a text string that our parameter display code will recognize as setup for a combo box.

Parameters
oToFormatModelEnum to format.
Returns
Formatted string.

◆ formatDataAsComboBox()

static Object [][] sortie.data.funcgroups.Behavior.formatDataAsComboBox ( Object  p_oExisting[][],
ModelEnum  oToFormat 
)
static

Adds a value with combo box formatting to an Object array for display in a JTable.

The formatting consists of some special characters in a text string that our parameter display code will recognize as setup for a combo box.

Parameters
p_oExistingObject array to add to.
oToFormatValue to add.
Returns
Object array with new value added.

◆ formatDataForDisplay()

ArrayList<BehaviorParameterDisplay> sortie.data.funcgroups.Behavior.formatDataForDisplay ( TreePopulation  oPop)

Formats data for display in a set of JTables.

Each element in the ArrrayList of BehaviorParameterDisplay returned is one table to display. Each single table vector's first element is an Object array with the header row for the table, and the second element is an Object[][] with the table's data. Data labels should be placed in the first array bucket.

Once the sorted lists are in place, they are transformed to the table format and returned.

One BehaviorParameterDisplay object is the default, but more than one can be returned if desired. They will appear like separate behavior displays.

Parameters
oPopTreePopulation object.
Returns
Vector of vectors suitable for creating a set of JTables, or null if there is no data to display.

◆ formatDataForTable() [1/5]

static Object [][] sortie.data.funcgroups.Behavior.formatDataForTable ( Object  p_oExisting[][],
ModelFloat  oToFormat 
)
static

Formats and adds a value into an Object array suitable for placing in a JTable.

The new array is formed by taking the descriptor and putting it into the first position, and then putting the value in the next position.

Parameters
p_oExistingThe existing Object array to add to.
oToFormatThe object to format.
Returns
Object array suitable for placing in a JTable.

◆ formatDataForTable() [2/5]

static Object [][] sortie.data.funcgroups.Behavior.formatDataForTable ( Object  p_oExisting[][],
ModelInt  oToFormat 
)
static

Formats and adds a value into an Object array suitable for placing in a JTable.

The new array is formed by taking the descriptor and putting it into the first position, and then putting the value in the next position.

Parameters
p_oExistingThe existing Object array to add to.
oToFormatThe object to format.
Returns
Object array suitable for placing in a JTable.

◆ formatDataForTable() [3/5]

static Object [][] sortie.data.funcgroups.Behavior.formatDataForTable ( Object  p_oExisting[][],
ModelString  oToFormat 
)
static

Formats and adds a value into an Object array suitable for placing in a JTable.

The new array is formed by taking the descriptor and putting it into the first position, and then putting the value in the next position.

Parameters
p_oExistingThe existing Object array to add to.
oToFormatThe object to format.
Returns
Object array suitable for placing in a JTable.

◆ formatDataForTable() [4/5]

static Object [][] sortie.data.funcgroups.Behavior.formatDataForTable ( Object  p_oExisting[][],
ModelVector  oToFormat 
)
static

Formats a vector of values into an object array and adds it to another Object array suitable for placing in a JTable.

The descriptor is placed in the first bucket of the new vector and all subsequent values in order after that.

Parameters
p_oExistingThe existing Object array to add to.
oToFormatThe object to format.
Returns
Object array suitable for placing in a JTable.

◆ formatDataForTable() [5/5]

static Object [][] sortie.data.funcgroups.Behavior.formatDataForTable ( Object  p_oExisting[][],
ModelVector  oToFormat,
boolean []  p_bWhichSpecies 
)
static

Formats a vector of values into a plain vector suitable for placing in a JTable and adds it to a vector of vectors at the end.

No headers are created. The descriptor is placed in the first bucket of the new vector and all subsequent values in order after that.

Parameters
p_oExistingThe existing Object array to add to.
oToFormatThe object to format.
p_bWhichSpeciesBoolean of whether or not each species should be added. If false for a species, the value at that Vector index is not added.
Returns
Object array suitable for placing in a JTable.

◆ formatSpeciesHeaderRow()

static Object [] sortie.data.funcgroups.Behavior.formatSpeciesHeaderRow ( boolean []  p_bUsed,
TreePopulation  oPop 
)
static

Creates an object array of strings consisting of species names, suitable for including in the parameter entry table.

The species will be in order, skipping over any positions in p_bUsed which are false. The first position in the array is blank.

Parameters
p_bUsedArray of which species to include, in species number order.
oPopTreePopulation object.
Returns
Object array of species names, or null if no species are to be used.

◆ formatTable()

BehaviorParameterDisplay sortie.data.funcgroups.Behavior.formatTable ( ArrayList< ModelData p_oSingles,
ArrayList< ArrayList< SpeciesSpecific >>  p_oSpeciesSpecific,
TreePopulation  oPop 
)
protected

Turns vector groups of data objects into a set of tables for display.

Parameters
p_oSinglesSingle values.
p_oSpeciesSpecificVector of vectors of species-specific values grouped together by what species they apply to.
oPopTreePopulation object.
Returns
Vector of tables for display.

◆ getAppliedToForDisplay()

String sortie.data.funcgroups.Behavior.getAppliedToForDisplay ( TreePopulation  oPop)

Get which species/types this behavior applies to, in a display-friendly format truncated to 250 chars.

Parameters
oPopTree population.
Returns
String of species/types for display, or "" if not applied to trees.

◆ getDataObject()

ModelData sortie.data.funcgroups.Behavior.getDataObject ( int  iInd)

Gets the managed data object at a particular index.

Parameters
iIndThe index of the desired managed data object.

◆ getDescriptor()

String sortie.data.funcgroups.Behavior.getDescriptor ( )

Gets the descriptor string.

Returns
The descriptor string.

◆ getGrid()

Grid sortie.data.funcgroups.Behavior.getGrid ( int  iIndex) throws ModelException

Returns the Grid at the given index of the grid applies to list.

Parameters
iIndexIndex of grid desired.
Returns
The Grid object requested.
Exceptions
ModelExceptionif the index is not valid.

◆ getGUIManager()

GUIManager sortie.data.funcgroups.Behavior.getGUIManager ( )

◆ getHelpFileString()

String sortie.data.funcgroups.Behavior.getHelpFileString ( )

Gets the help file UD.

Returns
the m_sHelpFileString

◆ getListPosition()

int sortie.data.funcgroups.Behavior.getListPosition ( )

Gets the behavior list position.

Returns
List position.

◆ getMinimumVersion()

double sortie.data.funcgroups.Behavior.getMinimumVersion ( )

Gets behavior's parameter file minimum version.

Returns
Parameter file minimum version.

◆ getMustHaveTrees()

boolean sortie.data.funcgroups.Behavior.getMustHaveTrees ( )

Gets whether this behavior must have trees.

Returns
Whether to auto-display parameters.

◆ getNewTreeDataMember()

DataMember sortie.data.funcgroups.Behavior.getNewTreeDataMember ( int  iIndex) throws ModelException

◆ getNumberNewDataMembers()

int sortie.data.funcgroups.Behavior.getNumberNewDataMembers ( )

◆ getNumberOfCombos()

int sortie.data.funcgroups.Behavior.getNumberOfCombos ( )

Gets the number of species/type combos to which this behavior applies.

Returns
the number of species/type combos.

◆ getNumberOfDataObjects()

int sortie.data.funcgroups.Behavior.getNumberOfDataObjects ( )

Gets the number of managed data objects.

Returns
Number of managed data objects.

◆ getNumberOfGrids()

int sortie.data.funcgroups.Behavior.getNumberOfGrids ( )

Gets the number of grids to which this behavior applies.

Returns
the number of grids.

◆ getNumberOfRequiredDataObjects()

int sortie.data.funcgroups.Behavior.getNumberOfRequiredDataObjects ( )

Gets the number of required data objects for this behavior.

Returns
Number of required data objects.

◆ getParameterFileBehaviorName()

String sortie.data.funcgroups.Behavior.getParameterFileBehaviorName ( )

Gets the parameter file name for this behavior.

Returns
Parameter file name for this behavior.

◆ getRequiredData()

ModelData sortie.data.funcgroups.Behavior.getRequiredData ( int  iIndex)

Returns the required data object at a given index.

Parameters
iIndexIndex.
Returns
Required data.

◆ getSetupType()

setupType sortie.data.funcgroups.Behavior.getSetupType ( )

◆ getSpeciesTypeCombo()

SpeciesTypeCombo sortie.data.funcgroups.Behavior.getSpeciesTypeCombo ( int  iIndex) throws ModelException

Returns the SpeciesTypeCombo at the given index of the species/type combo list.

Parameters
iIndexIndex of combo desired.
Returns
The SpeciesTypeCombo object requested.
Exceptions
ModelExceptionif the index is not valid.

◆ getVersion()

double sortie.data.funcgroups.Behavior.getVersion ( )

Gets behavior's parameter file version.

Returns
Parameter file version.

◆ getWhichSpeciesUsed()

boolean [] sortie.data.funcgroups.Behavior.getWhichSpeciesUsed ( TreePopulation  oPop)

Returns which species to which this behavior is applied.

If multiple tree types are applied, a species is considered applied to if any, not all, of the types goes with that species.

Parameters
oPopTree population.
Returns
An array, sized total number of species, with a boolean for each species number as to whether or not this behavior applies to it.

◆ getXMLParametersRoot()

String sortie.data.funcgroups.Behavior.getXMLParametersRoot ( )

Gets the XML parameter root string.

Returns
XML parameter root string.

◆ readDataFromDisplay()

void sortie.data.funcgroups.Behavior.readDataFromDisplay ( ArrayList< BehaviorParameterDisplay oData,
TreePopulation  oPop 
) throws ModelException

Reads in data from the parameter display window.

The format of the incoming data is the same as that which originally went out to be displayed in a table.

Parameters
oDataData to read in.
oPopTreePopulation object.
Exceptions
ModelExceptionif the data cannot be read into the object.

◆ readXMLParentTag()

void sortie.data.funcgroups.Behavior.readXMLParentTag ( String  sXMLTag,
Attributes  oAttributes 
) throws ModelException

Accepts an XML parent tag (empty, no data) from the parser.

Normally this data would be ignored, but this can be overridden if there is special XML to be captured.

Parameters
sXMLTagThe XML tag.
oAttributesThe attributes of this object.
Exceptions
ModelExceptionif there is a problem reading this data.

◆ setCanApplyTo()

void sortie.data.funcgroups.Behavior.setCanApplyTo ( int  iType,
boolean  bCanApply 
)

Sets whether this behavior can apply to a given tree type.

Parameters
iTypeTree type.
bCanApplyTrue if this can be applied to a tree type; false if not.

◆ setDescriptor()

void sortie.data.funcgroups.Behavior.setDescriptor ( String  s)

Sets the descriptor string.

Parameters
sNew descriptor string.

◆ setListPosition()

void sortie.data.funcgroups.Behavior.setListPosition ( int  iListPosition) throws ModelException

Sets the behavior list position.

Parameters
iListPositionList position.

◆ setSingleValue()

void sortie.data.funcgroups.Behavior.setSingleValue ( ModelData  oDataMember,
Object  oData 
) throws ModelException
protected

Sets the value of a single data member.

The value to set is cast to the proper type.

Parameters
oDataMemberData member to set.
oDataData value to set into data member.
Exceptions
ModelExceptionif data is of the wrong type.

◆ setSingleValueByXMLTag()

boolean sortie.data.funcgroups.Behavior.setSingleValueByXMLTag ( String  sXMLTag,
String  sXMLParentTag,
Attributes  oAttributes,
Object  oData 
) throws ModelException

Sets a data object's value.

Override this to add functionality.

Parameters
sXMLTagXML tag of data object whose value is to be set.
sXMLParentTagThe immediate parent tag that sXMLTag is within.
oAttributesAttributes of the object. Ignored, but may be needed by overriding objects.
oDataData value, either a String or a type appropriate to the data type
Returns
true if the value was set successfully; false if the value could not be found. (This would not be an error, because I need a way to cycle through the objects until one of the objects comes up with a match.)
Exceptions
ModelExceptionif the value could not be assigned to the data object.

◆ setVectorValueByXMLTag()

boolean sortie.data.funcgroups.Behavior.setVectorValueByXMLTag ( String  sXMLTag,
String  sXMLParentTag,
ArrayList< String >  p_oData,
String []  p_sChildXMLTags,
boolean []  p_bAppliesTo,
Attributes  oParentAttributes,
Attributes []  p_oAttributes 
) throws ModelException

Sets a data vector's value.

Override this to add functionality.

Parameters
sXMLTagParent XML tag of data vector whose value is to be set.
sXMLParentTagThe immediate parent tag that sXMLTag is within.
p_oDataVector of data values appropriate to the data type
p_sChildXMLTagsThe XML tags of the child elements
p_bAppliesToArray of booleans saying which of the vector values should be set. This is important in the case of species-specifics - the vector index is the species number but not all species are set.
oParentAttributesAttributes of parent tag. May be useful when overridding this for unusual tags.
p_oAttributesAttributes passed from parser. This may be needed when overriding this function. Basic species-specific values are already handled by this function.
Returns
true if the value was set successfully; false if the value could not be found. (This would not be an error, because I need a way to cycle through the objects until one of the objects comes up with a match.) If a match to a data object is made via XML tag, but the found object is not a ModelVector, this returns false.
Exceptions
ModelExceptionif the value could not be assigned to the data object.

◆ setVectorValues() [1/9]

static void sortie.data.funcgroups.Behavior.setVectorValues ( ModelVector  oData,
Float []  p_fValuesToSet,
boolean []  p_bAppliesTo 
)
static

Sets the values for vector variables.

This method replaces values in the vector with the values passed, in the order in which they are in the array. Only those vector indexes for which p_bApplies = true at that same index are set.

Parameters
oDataVector data variable to set.
p_fValuesToSetArray of values to put into the vector.
p_bAppliesToArray of flags for which values should be set.

◆ setVectorValues() [2/9]

static void sortie.data.funcgroups.Behavior.setVectorValues ( ModelVector  oData,
Float []  p_fValuesToSet 
)
static

Sets the values for vector variables.

This method replaces values in the vector with the values passed, in the order in which they are in the array.

Parameters
oDataVector data variable to set.
p_fValuesToSetArray of values to put into the vector.

◆ setVectorValues() [3/9]

static void sortie.data.funcgroups.Behavior.setVectorValues ( ModelVector  oData,
Double []  p_fValuesToSet,
boolean []  p_bAppliesTo 
)
static

Sets the values for vector variables.

This method replaces values in the vector with the values passed, in the order in which they are in the array. Only those vector indexes for which p_bApplies = true at that same index are set.

Parameters
oDataVector data variable to set.
p_fValuesToSetArray of values to put into the vector.
p_bAppliesToArray of flags for which values should be set.

◆ setVectorValues() [4/9]

static void sortie.data.funcgroups.Behavior.setVectorValues ( ModelVector  oData,
Double []  p_fValuesToSet 
)
static

Sets the values for vector variables.

This method replaces values in the vector with the values passed, in the order in which they are in the array.

Parameters
oDataVector data variable to set.
p_fValuesToSetArray of values to put into the vector.

◆ setVectorValues() [5/9]

static void sortie.data.funcgroups.Behavior.setVectorValues ( ModelVector  oData,
Integer []  p_iValuesToSet,
boolean []  p_bAppliesTo 
)
static

Sets the values for vector variables.

This method replaces all values in the vector with the values passed, in the order in which they are in the array.

Parameters
oDataVector data variable to set.
p_iValuesToSetArray of values to put into the vector.
p_bAppliesToArray of flags for which values should be set.
Todo:
Make this reject the setting of values for non-int vectors.

◆ setVectorValues() [6/9]

static void sortie.data.funcgroups.Behavior.setVectorValues ( ModelVector  oData,
String []  p_sValuesToSet 
)
static

Sets the values for vector variables.

This method replaces values in the vector with the values passed, in the order in which they are in the array.

Parameters
oDataVector data variable to set.
p_sValuesToSetArray of values to put into the vector.

◆ setVectorValues() [7/9]

static void sortie.data.funcgroups.Behavior.setVectorValues ( ModelVector  oData,
String []  p_sValuesToSet,
boolean []  p_bAppliesTo 
)
static

Sets the values for vector variables.

This method replaces all values in the vector with the values passed, in the order in which they are in the array.

Parameters
oDataVector data variable to set.
p_sValuesToSetArray of values to put into the vector.
p_bAppliesToArray of flags for which values should be set.

◆ setVectorValues() [8/9]

static void sortie.data.funcgroups.Behavior.setVectorValues ( ModelVector  oData,
Integer []  p_iValuesToSet 
)
static

Sets the values for vector variables.

This method replaces all values in the vector with the values passed, in the order in which they are in the array.

Parameters
oDataVector data variable to set.
p_iValuesToSetArray of values to put into the vector.

◆ setVectorValues() [9/9]

static void sortie.data.funcgroups.Behavior.setVectorValues ( ModelVector  p_oData,
ArrayList< String >  p_oValuesToSet,
boolean []  p_bAppliesTo 
) throws ModelException
static

Sets the values for vector variables.

The values in the vector which contains the values being assigned are cast to match the data types in the vector to which the values are being assigned. Only those vector indexes for which p_bApplies = true at that same index are set.

Parameters
p_oDataVector data variable to set.
p_oValuesToSetVector of values to put into the vector.
p_bAppliesToArray of flags for which values should be set.
Exceptions
ModelExceptionif the values cannot be cast to the correct type and assigned.

◆ validate()

void sortie.data.funcgroups.Behavior.validate ( ) throws ModelException

Behavior performs an internal check to make sure its settings are consistent and logical.

If m_bMustHaveTrees is set to true, it is enabled, and it has no trees, it throws an error.

Exceptions
ModelExceptionif the above condition is true.

◆ validateData()

abstract void sortie.data.funcgroups.Behavior.validateData ( TreePopulation  oPop) throws ModelException
abstract

Override this to implement data checking.

This will be called after data has been set.

Parameters
oPopTreePopulation object.
Exceptions
ModelExceptionif data doesn't pass validation.

◆ writeBehaviorNode()

void sortie.data.funcgroups.Behavior.writeBehaviorNode ( BufferedWriter  out,
TreePopulation  oPop 
) throws ModelException

Writes behavior tags to the parameter file.

Parameters
outFile stream to write to.
oPopTree population object.
Exceptions
ModelExceptionif there is a problem writing the file.

◆ writeDataToFile()

static void sortie.data.funcgroups.Behavior.writeDataToFile ( BufferedWriter  ojOut,
ModelData  oData 
) throws java.io. IOException
static

Writes a piece of data to an XML file.

If the string value is an empty string, nothing is written. This is static because I needed this particular method to be static. But it's a good idea for other methods as well - maybe I should move all of them to a separate static class? Or move this to ModelData?

Parameters
ojOutThe file to write to.
oDataThe data being written.
Exceptions
java.io.IOExceptionPasses on exceptions from FileWriter

◆ writeParametersToTextFile()

void sortie.data.funcgroups.Behavior.writeParametersToTextFile ( FileWriter  jOut,
TreePopulation  oPop 
) throws IOException

Writes the parameters for the behavior to file, using the same system as the basic parameter display and entry system.

Override this if the behavior has specialized parameters.

The file passed has been opened and should be appended to and then left unclosed.

Parameters
jOutFile to write to.
oPopTreePopulation object.

◆ writeSpeciesSpecificValue() [1/2]

void sortie.data.funcgroups.Behavior.writeSpeciesSpecificValue ( BufferedWriter  jOut,
ModelVector  p_oData,
TreePopulation  oPop 
) throws java.io.IOException, ModelException

Writes a set of species-specific float values to a parameter file.

Parameters
jOutThe file to write to.
p_oDataThe vector of data pieces.
oPopTree population object to get species names
Exceptions
java.io.IOExceptionPasses on exceptions from FileWriter
ModelExceptionPasses on from TreePopulation

◆ writeSpeciesSpecificValue() [2/2]

void sortie.data.funcgroups.Behavior.writeSpeciesSpecificValue ( BufferedWriter  jOut,
ModelVector  p_oData,
TreePopulation  oPop,
boolean []  p_bFlags 
) throws java.io.IOException, ModelException

Writes a set of species-specific values to a parameter file for a certain subset of species.

If none of the species are enabled, nothing is written.

Parameters
jOutThe file to write to.
p_oDataThe vector of data pieces. It should be sized to equal the total number of species, even if it doesn't have values for them all. Each piece of data for a species should be at the element index corresponding to the species number.
oPopTree population object to get species names
p_bFlagsAn array, sized total number of species; for each species number, whether or not to include data for the species in question.
Exceptions
java.io.IOExceptionPasses on exceptions from FileWriter
ModelExceptionPasses on from TreePopulation

◆ writeXML()

void sortie.data.funcgroups.Behavior.writeXML ( BufferedWriter  jOut,
TreePopulation  oPop 
) throws ModelException

Writes the XML data to a parameter file for the behaviors owned by this object.

Parameters
jOutFile stream to write to.
oPopTreePopulation object.
Exceptions
ModelExceptionif there is a problem writing the file or validating the data.

Member Data Documentation

◆ m_bCanBeDuplicated

boolean sortie.data.funcgroups.Behavior.m_bCanBeDuplicated = true
protected

Whether or not this behavior can have multiple copies in a run or not.

◆ m_bMustHaveTrees

boolean sortie.data.funcgroups.Behavior.m_bMustHaveTrees = true

If true, and a tree has no species/type combos, it automatically becomes disabled.

Otherwise, enablement/disablement must be done explicity.

◆ m_fMinVersion

double sortie.data.funcgroups.Behavior.m_fMinVersion = 1.0
protected

Minimum version of this behavior.

◆ m_fVersion

double sortie.data.funcgroups.Behavior.m_fVersion = 1.0
protected

Version of this behavior.

◆ m_iBehaviorSetupType

setupType sortie.data.funcgroups.Behavior.m_iBehaviorSetupType
protected

◆ m_iListPosition

int sortie.data.funcgroups.Behavior.m_iListPosition = -1
protected

This behavior's position in the behavior list.

◆ m_oManager

GUIManager sortie.data.funcgroups.Behavior.m_oManager
protected

GUIManager object.

◆ m_oParent

BehaviorTypeBase sortie.data.funcgroups.Behavior.m_oParent
protected

Parent manager.

◆ m_sDescriptor

String sortie.data.funcgroups.Behavior.m_sDescriptor = ""
protected

This is what will be displayed as the name of a given behavior in the GUI.

Shouldn't be too long - max 5 words or so

◆ m_sHelpFileString

String sortie.data.funcgroups.Behavior.m_sHelpFileString = ""
protected

Help file topic identifier string.

◆ m_sParFileTag

String sortie.data.funcgroups.Behavior.m_sParFileTag = ""
protected

String which is used to identify this behavior in the parameter file.

◆ m_sXMLRootString

String sortie.data.funcgroups.Behavior.m_sXMLRootString = ""
protected

XML tag to surround this behavior's data.

◆ mp_bCanApplyToTreeType

boolean [] sortie.data.funcgroups.Behavior.mp_bCanApplyToTreeType
protected

For each tree type, whether or not this behavior can be applied to it.

This defaults to true for seedlings, saplings, adults, and snags, and false for all others.

◆ mp_iGridsAppliesTo

ArrayList<Integer> sortie.data.funcgroups.Behavior.mp_iGridsAppliesTo = new ArrayList<Integer>(0)
protected

A set of hashcodes of the Grids to which this behavior is applied - or none if it is not applied to grids.

◆ mp_oAllData

ArrayList<ModelData> sortie.data.funcgroups.Behavior.mp_oAllData = new ArrayList<ModelData>()
protected

All data for this object.

It should be placed in the order in which it should be written in XML.

◆ mp_oNewTreeDataMembers

ArrayList<DataMember> sortie.data.funcgroups.Behavior.mp_oNewTreeDataMembers = new ArrayList<DataMember>(0)
protected

The new tree data members that this behavior adds, above and beyond the basic tree population data members.

This is a vector of DataMember objects.

◆ mp_oTreesAppliesTo

ArrayList<SpeciesTypeCombo> sortie.data.funcgroups.Behavior.mp_oTreesAppliesTo = new ArrayList<SpeciesTypeCombo>(0)
protected

A set of SpeciesTypeCombo objects to which this behavior is applied - or none if it is not applied to trees.


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