javawrapper.Behavior Class Reference

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

List of all members.

Public Member Functions

 Behavior (String sKey, String sDescriptor, String sParFileTag, float fVersion, float fMinVersion)
 Constructor.
 Behavior (String sKey, String sDescriptor, String sParFileTag, float fVersion)
 Constructor.
void Validate () throws ModelException
 Behavior performs an internal check to make sure its settings are consistent and logical.
void SetCanApplyTo (int iType, boolean bCanApply)
 Sets whether this behavior can apply to a given tree type.
String GetKey ()
 Gets the key string.
String GetParameterFileBehaviorName ()
 Gets the parameter file name for this behavior.
float GetVersion ()
 Gets behavior's parameter file version.
float GetMinimumVersion ()
 Gets behavior's parameter file minimum version.
String GetDescriptor ()
 Gets the descriptor string.
void SetDescriptor (String s)
 Sets the descriptor string.
int GetNumberOfCombos ()
 Gets the number of species/type combos to which this behavior applies.
int GetNumberOfGrids ()
 Gets the number of grids to which this behavior applies.
void DeleteSpeciesTypeCombo (int iIndex) throws ModelException
 Deletes the SpeciesTypeCombo at the given index.
void ClearSpeciesTypeCombos ()
 Empties the species/type combo list.
SpeciesTypeCombo GetSpeciesTypeCombo (int iIndex) throws ModelException
 Returns the SpeciesTypeCombo at the given index of the species/type combo list.
Grid GetGrid (int iIndex) throws ModelException
 Returns the Grid at the given index of the grid applies to list.
Object GetRequiredData (int iIndex)
 Returns the required data object at a given index.
int GetNumberOfRequiredDataObjects ()
 Gets the number of required data objects for this behavior.
void AddSpeciesTypeCombo (SpeciesTypeCombo oCombo) throws ModelException
 Adds a new species/type combo to the list to which this behavior applies.
void AddGrid (Grid oGrid)
 Adds a new Grid to the list to which this behavior applies.
void AddRequiredData (ModelData oData)
 Adds a piece of required data to the list.
boolean[] GetWhichSpeciesUsed (TreePopulation oPop)
 Returns which species to which this behavior is applied.
Object clone ()
 Override to make a clone of this object.

Public Attributes

boolean m_bMustHaveTrees = true
 If true, and a tree has no species/type combos, it automatically becomes disabled.
boolean m_bIsEnabled = false
 Whether or not the current parameter file uses this behavior - and thus whether it will get called during the setup sequence.
boolean m_bCanEditAutomatically = true
 Whether or not this behavior can be edited automatically (true) or must be edited with its own dialog (false).

Protected Attributes

Vector< SpeciesTypeCombomp_oTreesAppliesTo = new Vector<SpeciesTypeCombo>(0)
 A set of SpeciesTypeCombo objects to which this behavior is applied - or none if it is not applied to trees.
Vector< Gridmp_oGridsAppliesTo = new Vector<Grid>(0)
 A set of strings with the name of Grids to which this behavior is applied - or none if it is not applied to grids.
Vector< ModelDatamp_oRequiredData = new Vector<ModelData>(0)
 The data objects which are required when this behavior is enabled (i.e.
Vector< DataMembermp_oNewTreeDataMembers = new Vector<DataMember>(0)
 The new tree data members that this behavior adds, above and beyond the basic tree population data members.
String m_sDescriptor
 This is what will be displayed as the name of a given behavior in the GUI.
String m_sKey
 Key string - short unique identifier.
String m_sParFileTag
 String which is used to identify this behavior in the parameter file.
boolean[] mp_bCanApplyToTreeType
 For each tree type, whether or not this behavior can be applied to it.
float m_fVersion
 Version of this behavior.
float m_fMinVersion = (float) 1.0
 Minimum version of this behavior.


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. Unlike in the core model, however, this class is not meant to be extended and tailored.

Objects of this class act as placeholders for behaviors, keeping track of whether or not they are enabled and to whom they apply. They are "dumb", not performing any additional functions. They rely on their BehaviorTypeBase owners to keep track of their data.

Copyright: Copyright (c) 2003

Company: Institute of Ecosystem Studies

Author:
Lora E. Murphy
Version:
1.0

Edit history:
------------------
April 28, 2004: Submitted in beta version (LEM)
April 30, 2004: Made version into a float (duh) (LEM)
July 20, 2004: Added new tree data members (LEM)
February 4, 2008: Updated to conform to Java 6 compliance (LEM)

Constructor & Destructor Documentation

javawrapper.Behavior.Behavior ( String  sKey,
String  sDescriptor,
String  sParFileTag,
float  fVersion,
float  fMinVersion 
)

Constructor.

Parameters:
sKey Key string - short unique identifier.
sDescriptor Long description that will show up in GUI displays.
sParFileTag Parameter file XML tag (no brackets).
fVersion C++ object version number.
fMinVersion C++ object minimum version number

javawrapper.Behavior.Behavior ( String  sKey,
String  sDescriptor,
String  sParFileTag,
float  fVersion 
)

Constructor.

Parameters:
sKey Key string - short unique identifier.
sDescriptor Long description that will show up in GUI displays.
sParFileTag Parameter file XML tag (no brackets).
fVersion C++ object version number.


Member Function Documentation

void javawrapper.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:
ModelException if the above condition is true.

void javawrapper.Behavior.SetCanApplyTo ( int  iType,
boolean  bCanApply 
)

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

Parameters:
iType Tree type.
bCanApply True if this can be applied to a tree type; false if not.

String javawrapper.Behavior.GetKey (  ) 

Gets the key string.

Returns:
Key string.

String javawrapper.Behavior.GetParameterFileBehaviorName (  ) 

Gets the parameter file name for this behavior.

Returns:
Parameter file name for this behavior.

float javawrapper.Behavior.GetVersion (  ) 

Gets behavior's parameter file version.

Returns:
Parameter file version.

float javawrapper.Behavior.GetMinimumVersion (  ) 

Gets behavior's parameter file minimum version.

Returns:
Parameter file minimum version.

String javawrapper.Behavior.GetDescriptor (  ) 

Gets the descriptor string.

Returns:
The descriptor string.

void javawrapper.Behavior.SetDescriptor ( String  s  ) 

Sets the descriptor string.

Parameters:
s New descriptor string.

int javawrapper.Behavior.GetNumberOfCombos (  ) 

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

Returns:
the number of species/type combos.

int javawrapper.Behavior.GetNumberOfGrids (  ) 

Gets the number of grids to which this behavior applies.

Returns:
the number of grids.

void javawrapper.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:
iIndex The index number of the SpeciesTypeCombo.
Exceptions:
ModelException if the index number is invalid.

void javawrapper.Behavior.ClearSpeciesTypeCombos (  ) 

Empties the species/type combo list.

If this behavior has its m_bMustHaveTrees flag set to true, this sets m_bIsEnabled to false.

SpeciesTypeCombo javawrapper.Behavior.GetSpeciesTypeCombo ( int  iIndex  )  throws ModelException

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

Parameters:
iIndex Index of combo desired.
Returns:
The SpeciesTypeCombo object requested.
Exceptions:
ModelException if the index is not valid.

Grid javawrapper.Behavior.GetGrid ( int  iIndex  )  throws ModelException

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

Parameters:
iIndex Index of grid desired.
Returns:
The Grid object requested.
Exceptions:
ModelException if the index is not valid.

Object javawrapper.Behavior.GetRequiredData ( int  iIndex  ) 

Returns the required data object at a given index.

Parameters:
iIndex Index.
Returns:
Required data.

int javawrapper.Behavior.GetNumberOfRequiredDataObjects (  ) 

Gets the number of required data objects for this behavior.

Returns:
Number of required data objects.

void javawrapper.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:
oCombo The new species/type combo.
Exceptions:
ModelException if the tree type in the combo cannot be applied to this behavior according to mp_bCanApplyToTreeType.

void javawrapper.Behavior.AddGrid ( Grid  oGrid  ) 

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

If this particular grid is already on the list, it's replaced. 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:
oGrid Grid to add.

void javawrapper.Behavior.AddRequiredData ( ModelData  oData  ) 

Adds a piece of required data to the list.

Parameters:
oData Data to add.

boolean [] javawrapper.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:
oPop Tree 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.

Object javawrapper.Behavior.clone (  ) 

Override to make a clone of this object.

Returns:
Deep clone of this object.


Member Data Documentation

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

Vector<Grid> javawrapper.Behavior.mp_oGridsAppliesTo = new Vector<Grid>(0) [protected]

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

Vector<ModelData> javawrapper.Behavior.mp_oRequiredData = new Vector<ModelData>(0) [protected]

The data objects which are required when this behavior is enabled (i.e.

the individual pieces of data that must have values)

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.

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

Otherwise, it has to do with grids and enablement must be specifically set.

Whether or not the current parameter file uses this behavior - and thus whether it will get called during the setup sequence.

Whether or not this behavior can be edited automatically (true) or must be edited with its own dialog (false).

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

String javawrapper.Behavior.m_sKey [protected]

Key string - short unique identifier.

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

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.

Version of this behavior.

float javawrapper.Behavior.m_fMinVersion = (float) 1.0 [protected]

Minimum version of this behavior.


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

Generated on Wed Oct 28 14:01:19 2009 for SORTIE Java Interface by  doxygen 1.5.6