- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator Class Reference

`#include <CompiledModeEstimator.h>`

Inheritance diagram for Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator:

[legend]
Collaboration diagram for Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator:

[legend]
List of all members.

## Public Member Functions
| CompiledModeEstimator (const Mers::Models::Base::BaseModel &bm, std::vector< const Mers::Estimation::Discrete::Dissent * > dissents, std::vector< const Mers::Estimation::Discrete::CompiledTransition * > compiledTransitions, Mers::Estimation::Discrete::Trajectories *initialTrajectories=NULL)
virtual | ~CompiledModeEstimator ()
virtual void | setDebug (const unsigned short db)
## Protected Member Functions
virtual bool | generateTrajectories (void)
virtual const Mers::Models::Base::BaseModelAssignmentArray * | generateBestSolution (unsigned int generatorNum, long int maximumVisitedNodeCount, long int maxQueueSize)
virtual bool | addEstimate (Mers::Estimation::Discrete::Estimate *theEst, Mers::Estimation::Discrete::EstimateHeap *nextTrajsEstHeap=NULL)
virtual bool | releaseMemoryAndNormalize (Mers::Estimation::Discrete::EstimateHeap *nextTrajsEstHeap)
void | resetBFIGs (void)
## Protected Attributes
std::vector< Mers::Generators::BFIG::BFIGGenerator * > | bfigGen
| A vector of BFIG Generators; one for each trajectory. BFIG memory is allocated as the number of trajectories grows and is freed only on deletion of ModeEstimation. For a well formed model, there should always be at least one consistent state transition so the total number of trajectories should not decrease without intervension.

## Detailed Description

The CompiledModeEstimator is an HHM estimation engine that generates estimates that are consistent with the CCA model, commands, and observations. Estimates are generated in best-first order (highest posterior probability first) by using BFIG to find the most likely diagnoses. This implimentation of ModeEstimator tracks the most likely trajectories using a compiled CCA model consisting of dissents and compiled transitions.

Definition at line 60 of file CompiledModeEstimator.h.

## Constructor & Destructor Documentation

Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator::CompiledModeEstimator | ( | const Mers::Models::Base::BaseModel & | bm,
|  | std::vector< const Mers::Estimation::Discrete::Dissent * > | dissents,
|  | std::vector< const Mers::Estimation::Discrete::CompiledTransition * > | compiledTransitions,
|  | Mers::Estimation::Discrete::Trajectories * | initialTrajectories = `NULL` |
| ) |  |  |

Creates a new CompiledModeEstimator The core functionality is derived from the ModeEstimatorBase. The only major addition to the base class is the generateTrajectories method using BFIG to enumerate estimates in best-first order instead of OPSAT.

Parameters:

  | bm | the complete model of the system including all variables and domains
  | dissents | a vector containing all the dissents of the model
  | compiledTransitions | a vector containing all the compiled transitions for the model
  | initialTrajectories | the initial probability distribution across states.

CompiledModeEstimator::~CompiledModeEstimator | ( |  | ) | `[virtual]`

Destroys the CompiledModeEstimator

Definition at line 78 of file CompiledModeEstimator.cpp.

References bfigGen.

## Member Function Documentation

void CompiledModeEstimator::setDebug | ( | const unsigned short | db | ) | `[virtual]`

Sets the debug flag to the value specified

Parameters:

  | db | the value to set the debug flag to (higher numbers are more output)

Reimplemented from Mers::Estimation::Discrete::ModeEstimatorBase.

Definition at line 96 of file CompiledModeEstimator.cpp.

References bfigGen, and Mers::Estimation::Discrete::ModeEstimatorBase::setDebug().

Here is the call graph for this function:

bool CompiledModeEstimator::generateTrajectories | ( | void |  | ) | `[protected, virtual]`

Calculates the next trajectories using BFIG. The enabled transitions are used to update probabilities of transitioning into the next state and enabled dissents are inserted into BFIG as the complete set of conflicts.

Returns:
  true if successfully generated new trajectories, false otherwise

Implements Mers::Estimation::Discrete::ModeEstimatorBase.

Reimplemented in Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug.

Definition at line 114 of file CompiledModeEstimator.cpp.

References Mers::Estimation::Discrete::Trajectories::addEstimate(), bfigGen, Mers::Estimation::Discrete::ModeEstimatorBase::cleanAfterFailure(), Mers::Estimation::Discrete::ModeEstimatorBase::compiledObjectTrigger, Mers::Estimation::Discrete::ModeEstimatorBase::currentTrajectories, Mers::Estimation::Discrete::ModeEstimatorBase::debug, Mers::Estimation::Discrete::ModeEstimatorBase::findNextBestStateAndPutInHeap(), Mers::Estimation::Discrete::Trajectories::getAccumulatedUncertainty(), Mers::Estimation::Discrete::Trigger::getConflicts(), Mers::Estimation::Discrete::Trajectories::getEstimate(), Mers::Estimation::Discrete::EstimateHeap::getFirst(), Mers::Estimation::Discrete::Trigger::getNormalizedEnabledTransitionProbabilities(), Mers::Estimation::Discrete::Trajectories::getNumberEstimates(), Mers::Estimation::Discrete::Estimate::getOriginatedTrajectoryNumber(), Mers::Estimation::Discrete::Estimate::getProbability(), Mers::Models::Base::BaseModel::getVariables(), Mers::Utils::Containers::DynamicArray::isEmpty(), Mers::Estimation::Discrete::ModeEstimatorBase::maxNumberEstimates, Mers::Estimation::Discrete::ModeEstimatorBase::model, Mers::Estimation::Discrete::ModeEstimatorBase::nextTrajectories, Mers::Estimation::Discrete::ModeEstimatorBase::objectiveFunction, Mers::Estimation::Discrete::ModeEstimatorBase::probabilityMap, releaseMemoryAndNormalize(), and Mers::Estimation::Discrete::MEObjectiveFunction::updateProbabilities().

Referenced by Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug::generateTrajectories().

Here is the call graph for this function:

const BaseModelAssignmentArray * CompiledModeEstimator::generateBestSolution | ( | unsigned int | generatorNum,
|  | long int | maximumVisitedNodeCount,
|  | long int | maxQueueSize |
| ) |  |  | `[protected, virtual]`

This function was designed to only used by findNextBestStateAndPutInHeap. This virtual function is implemented using BFIG to generate the next most likely solution.

Parameters:

  | generatorNum | the generator index from which to generate the next most likely state maximumVisitedNodeCount the maximum number of nodes to examine before giving up.
  | maxQueueSize | the largest number of nodes that can be kept in memory

Returns:
  the next best state found by BFIG # generatorNum

See also:
  ModeEstimatorBase::findNextBestStateAndPutInHeap

Implements Mers::Estimation::Discrete::ModeEstimatorBase.

Definition at line 230 of file CompiledModeEstimator.cpp.

References bfigGen.

bool CompiledModeEstimator::addEstimate | ( | Mers::Estimation::Discrete::Estimate * | theEst,
|  | Mers::Estimation::Discrete::EstimateHeap * | nextTrajsEstHeap = `NULL` |
| ) |  |  | `[protected, virtual]`

Simple function that is called by findNextBestStateAndPutInHeap to insert the estimate into the best-first heap. This function should really be placed in a general BFTE class.

Parameters:

  | theEst | the estimate to add to the heap or trajectories
  | nextTrajsEstHeap | the Estimate Heap to add the estimate to. If NULL, the estimate will be placed in nextTrajectories.

Returns:
  true if successful, false otherwise

See also:
  findNextBestStateAndPutInHeap

Implements Mers::Estimation::Discrete::ModeEstimatorBase.

Definition at line 240 of file CompiledModeEstimator.cpp.

References Mers::Estimation::Discrete::EstimateHeap::insert().

Here is the call graph for this function:

bool CompiledModeEstimator::releaseMemoryAndNormalize | ( | Mers::Estimation::Discrete::EstimateHeap * | nextTrajsEstHeap | ) | `[protected, virtual]`

This function was designed to only used by generateTrajectories. Once all the next best estimates have been generated and places into nextTrajectories, this function is called to normalize the trajectories and release the extra memory that was allocated and no longer needed. Specifically it clears the estimate heap and resets all the bfigs.

Parameters:

  | nextTrajsEstHeap | the heap to clear

Returns:
  true

Reimplemented from Mers::Estimation::Discrete::ModeEstimatorBase.

Reimplemented in Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug.

Definition at line 249 of file CompiledModeEstimator.cpp.

References Mers::Estimation::Discrete::ModeEstimatorBase::releaseMemoryAndNormalize(), and resetBFIGs().

Referenced by generateTrajectories(), and Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug::releaseMemoryAndNormalize().

Here is the call graph for this function:

void CompiledModeEstimator::resetBFIGs | ( | void |  | ) | `[protected]`

Resets all the BFIG Generator objects by reseting the BFIG search. Deletion of the BFIG objects only occures when CompiledModeEstimator is deleted.

Definition at line 260 of file CompiledModeEstimator.cpp.

References bfigGen.

Referenced by releaseMemoryAndNormalize().

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

- /Users/fpy/titan-1-5-MBARI/Mers/Estimation/Discrete/CompiledME/CompiledModeEstimator.h
- /Users/fpy/titan-1-5-MBARI/Mers/Estimation/Discrete/CompiledME/CompiledModeEstimator.cpp