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

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

# Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug Class Reference

`#include <CBFTEDebug.h>`

Inheritance diagram for Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug:

[legend]
Collaboration diagram for Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug:

[legend]
List of all members.

## Public Member Functions
| CBFTEDebug (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 | ~CBFTEDebug ()
virtual const Estimate * | findModeEstimate (void)
virtual const Estimate * | progressToEstimate (void)
virtual unsigned int | getNumberFaultTransitions (void)
virtual unsigned int | getEstimateFaultTransitions (unsigned int estIndex)
double | getAccumulatedUncertainty (void) const
## Protected Member Functions
virtual bool | generateTrajectories (void)
virtual bool | findNextBestStateAndPutInHeap (unsigned int bfigNum, const std::vector< double > &allProbs, Mers::Estimation::Discrete::EstimateHeap *nextTrajsEstHeap, bool willWarn=false)
virtual bool | releaseMemoryAndNormalize (Mers::Estimation::Discrete::EstimateHeap *nextTrajsEstHeap)
virtual bool | addEstimateToCurrentTrajectories (Mers::Estimation::Discrete::Estimate *anEst, bool createNewCurrentTrajectories=false)

## Detailed Description

The CBFTEDebug 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. This class inherits from MEPerformanceMonitor to gather data necessary for performance testing.

Definition at line 62 of file CBFTEDebug.h.

## Constructor & Destructor Documentation

Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug::CBFTEDebug | ( | 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 CBFTEDebug 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.

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

Destroys the CBFTEDebug

Definition at line 61 of file CBFTEDebug.cpp.

## Member Function Documentation

const Estimate * CBFTEDebug::findModeEstimate | ( | void |  | ) | `[virtual]`

Interface function to ALWAYS generate the next trajectories Differs from the base class function by not checking to see if new trajectories have already been generated. Used for performance testing.

Returns:
  the most likely estimate in the next trajectories

See also:
  generateTrajectories

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

Definition at line 71 of file CBFTEDebug.cpp.

References generateTrajectories(), Mers::Estimation::Discrete::Trajectories::getMostLikelyEstimate(), and Mers::Estimation::Discrete::ModeEstimatorBase::nextTrajectories.

Referenced by progressToEstimate().

Here is the call graph for this function:

const Estimate * CBFTEDebug::progressToEstimate | ( | void |  | ) | `[virtual]`

For the purpose of performance monitoring, it is important to know when a progress have been requested. This function sets the current prior state probabilities to the next prior state probabilities.

Interface function to generate the next trajectories and then progress ME into the most likely estimate of the new trajectories

Returns:
  the most likely estimate in the next trajectories

See also:
  findModeEstimate

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

Definition at line 87 of file CBFTEDebug.cpp.

References findModeEstimate(), Mers::Estimation::Discrete::ModeEstimatorBase::nextTrajectories, Mers::Estimation::Discrete::ModeEstimatorBase::objectiveFunction, and Mers::Estimation::Discrete::ModeEstimatorBase::progressToEstimate().

Here is the call graph for this function:

unsigned int CBFTEDebug::getNumberFaultTransitions | ( | void |  | ) | `[virtual]`

Interface function that calls MEPerformanceMonitor::getNumberFaultTransitions

Returns:
  the number of component fault transitions from the current trajectories to the next trajectories

Implements Mers::Estimation::Discrete::ModeEstimationPerformance::MEPerformanceMonitor.

Definition at line 95 of file CBFTEDebug.cpp.

unsigned int CBFTEDebug::getEstimateFaultTransitions | ( | unsigned int | estIndex | ) | `[virtual]`

Interface function that calls MEPerformanceMonitor::getEstimateFaultTransitions

Parameters:

  | estIndex | the estimate index number in nextTrajectories to determine the number of fault transitions for

Returns:
  the number of component fault transitions when transitioning into estIndex

Implements Mers::Estimation::Discrete::ModeEstimationPerformance::MEPerformanceMonitor.

Definition at line 103 of file CBFTEDebug.cpp.

double CBFTEDebug::getAccumulatedUncertainty | ( | void |  | ) | const`[virtual]`

Interface function that calls MEPerformanceMonitor::computeAccumulatedBeliefStateUncertainty

Returns:
  the amount of lost belief state probability space over time

Implements Mers::Estimation::Discrete::ModeEstimationPerformance::MEPerformanceMonitor.

Definition at line 110 of file CBFTEDebug.cpp.

References Mers::Estimation::Discrete::ModeEstimatorBase::nextTrajectories, and Mers::Estimation::Discrete::ModeEstimatorBase::objectiveFunction.

bool CBFTEDebug::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

Reimplemented from Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator.

Definition at line 126 of file CBFTEDebug.cpp.

References Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator::generateTrajectories(), and Mers::Estimation::Discrete::ModeEstimationPerformance::MEPerformanceMonitor::numEstimatesGenerated.

Referenced by findModeEstimate().

Here is the call graph for this function:

virtual bool Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug::findNextBestStateAndPutInHeap | ( | unsigned int | bfigNum,
|  | const std::vector< double > & | allProbs,
|  | Mers::Estimation::Discrete::EstimateHeap * | nextTrajsEstHeap,
|  | bool | willWarn = `false` |
| ) |  |  | `[protected, virtual]`

Increments numEstimatesGenerated for performance results and then calls the base function shown below:

This function was designed to only used by generateTrajectories. It (1) extracts the next best solution from BFIG # bfigNum and (2) places the solution into the heap if it is a valid solution and the probability of the solution is > 0.

Parameters:

  | bfigNum | the opsat index from which to generate the next most likely state allProbs the probabilities used to extract the next best state probability
  | nextTrajsEstHeap | the Estimate Heap to add the estimate to.
  | willWarn | if true, a warning will be displayed if there are no next best solutions to bfig. The default is false.

Returns:
  false if there is a major error, true otherwise.

See also:
  generateTrajectories

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

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

Gathers all the performance information and then calls the base class function shown below:

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::CompiledME::CompiledModeEstimator.

Definition at line 147 of file CBFTEDebug.cpp.

References Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator::bfigGen, Mers::Estimation::Discrete::ModeEstimationPerformance::MEPerformanceMonitor::gatherEstimationCycleResults(), and Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator::releaseMemoryAndNormalize().

Here is the call graph for this function:

bool CBFTEDebug::addEstimateToCurrentTrajectories | ( | Mers::Estimation::Discrete::Estimate * | anEst,
|  | bool | createNewCurrentTrajectories = `false` |
| ) |  |  | `[protected, virtual]`

This function is a hook into the ModeEstimatorBase function that allows for monitoring the amount of probability space maintained. The base function is specified below:

Adds the provided estimate to currentTrajectories and resets the current commands and observations.

Parameters:

  | anEst | the estimate to add to the currentTrajectories
  | createNewCurrentTrajectories | deletes and creates new currentTrajectories if true.

Returns:
  false if unable to add the estimate or unable to reset the commands and observations, true otherwise.

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

Definition at line 157 of file CBFTEDebug.cpp.

References Mers::Estimation::Discrete::ModeEstimatorBase::addEstimateToCurrentTrajectories().

Here is the call graph for this function:

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

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