#include <RandomBrowse.h>
Inheritance diagram for clRandomBrowse:
Public Member Functions | |
clRandomBrowse (clSimManager *p_oSimManager) | |
Constructor. | |
~clRandomBrowse () | |
Destructor. | |
void | Action () |
Decides who is browsed. | |
void | GetData (xercesc::DOMDocument *p_oDoc) |
Does setup for this behavior. | |
void | RegisterTreeDataMembers () |
Registers the "Browsed" bool data member. | |
Protected Attributes | |
float * | mp_fBrowseProb |
Probability of browse. | |
char * | m_cQuery |
String to pass to clTreePopulation::Find() in order to get the trees for which to calculate volume. | |
short int ** | mp_iBrowsedCodes |
Holds data member codes for "Browsed" bool data member. | |
short int | m_iNumSpecies |
For the destructor. |
This class randomly chooses trees to be browsed according to a species specific probability of browse.
This behavior adds a bool data member called "Browsed" to trees that holds whether (true) or not (false) the tree has been browsed.
This class's namestring and parameter call string are both "random browse".
Copyright 2007 Charles D. Canham.
clRandomBrowse::clRandomBrowse | ( | clSimManager * | p_oSimManager | ) |
clRandomBrowse::~clRandomBrowse | ( | ) |
Destructor.
Deletes arrays.
void clRandomBrowse::Action | ( | ) | [virtual] |
Decides who is browsed.
A query is sent to the tree population to get all trees to which this behavior is applied. For each, a random number is compared to that species' browse probability. The result is placed in the "Browsed" bool tree data member.
Reimplemented from clBehaviorBase.
void clRandomBrowse::GetData | ( | xercesc::DOMDocument * | p_oDoc | ) | [virtual] |
Does setup for this behavior.
This gets parameters and formats the query string for getting trees from the tree population.
p_oDoc | DOM tree of parsed input file. |
modelErr | if any probability is not between 0 and 1. |
Implements clWorkerBase.
void clRandomBrowse::RegisterTreeDataMembers | ( | ) | [virtual] |
Registers the "Browsed" bool data member.
The return codes are captured in the mp_iBrowsedCodes array.
Reimplemented from clBehaviorBase.
float* clRandomBrowse::mp_fBrowseProb [protected] |
Probability of browse.
Array size is species.
char* clRandomBrowse::m_cQuery [protected] |
String to pass to clTreePopulation::Find() in order to get the trees for which to calculate volume.
This will instigate a species/type search for all the species and types to which this behavior applies.
short int** clRandomBrowse::mp_iBrowsedCodes [protected] |
Holds data member codes for "Browsed" bool data member.
First array index is # species, second is number types.
short int clRandomBrowse::m_iNumSpecies [protected] |
For the destructor.