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

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

# Mers::Estimation::Discrete::ModeEstimationPerformance::ModeEstimatorDebug Class Reference

`#include <ModeEstimatorDebug.h>`

Inheritance diagram for Mers::Estimation::Discrete::ModeEstimationPerformance::ModeEstimatorDebug:

[legend]
Collaboration diagram for Mers::Estimation::Discrete::ModeEstimationPerformance::ModeEstimatorDebug:

[legend]
List of all members.

## Public Member Functions
| ModeEstimatorDebug (const Mers::Models::CCA::CCAModel &cca, Mers::Estimation::Discrete::Trajectories *initialTrajectories=NULL)
virtual | ~ModeEstimatorDebug ()
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 opsatNum, const std::vector< double > &allProbs, Mers::Estimation::Discrete::EstimateHeap *nextTrajsEstHeap, bool willWarn=false)
virtual bool | releaseMemoryAndNormalize (Mers::Models::Base::BaseModelClauseArray *currentObservationAssignments, Mers::Estimation::Discrete::EstimateHeap *nextTrajsEstHeap=NULL)
virtual bool | addEstimateToCurrentTrajectories (Mers::Estimation::Discrete::Estimate *anEst, bool createNewCurrentTrajectories=false)

## Detailed Description

The ModeEstimatorDebug 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 Opsat to find the most likely diagnoses. This implimentation of ModeEstimator tracks the k most likely trajectories over time. Debug hooks are placed into the ModeEstimator base class and information is collected in MEPerformanceMonitor.

Definition at line 57 of file ModeEstimatorDebug.h.

## Constructor & Destructor Documentation

ModeEstimatorDebug::ModeEstimatorDebug | ( | const Mers::Models::CCA::CCAModel & | cca,
|  | Mers::Estimation::Discrete::Trajectories * | initialTrajectories = `NULL` |
| ) |  |  |

Creates a new ModeEstimatorDebug. The core functionality is derived from the ModeEstimator. Hooks are placed to collect performance data within the generate trajectories algorithm and all data is stored in the data members of MEPerformanceMonitor.

Parameters:

  | cca | the complete CCAModel of the system including all variables, domains, transitions, and constraints
  | initialTrajectories | the initial probability distribution across states.

Definition at line 46 of file ModeEstimatorDebug.cpp.

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

Destroys the mode estimator

Definition at line 56 of file ModeEstimatorDebug.cpp.

## Member Function Documentation

const Estimate * ModeEstimatorDebug::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 67 of file ModeEstimatorDebug.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 * ModeEstimatorDebug::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 84 of file ModeEstimatorDebug.cpp.

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

Here is the call graph for this function:

unsigned int ModeEstimatorDebug::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 93 of file ModeEstimatorDebug.cpp.

References Mers::Estimation::Discrete::ModeEstimatorBase::currentTrajectories, Mers::Estimation::Discrete::ModeEstimationPerformance::MEPerformanceMonitor::getNumberFaultTransitions(), Mers::Estimation::Discrete::ModeEstimation::ModeEstimator::myCCAmodel, and Mers::Estimation::Discrete::ModeEstimatorBase::nextTrajectories.

Here is the call graph for this function:

unsigned int ModeEstimatorDebug::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 111 of file ModeEstimatorDebug.cpp.

References Mers::Estimation::Discrete::ModeEstimatorBase::currentTrajectories, Mers::Estimation::Discrete::ModeEstimationPerformance::MEPerformanceMonitor::getEstimateFaultTransitions(), Mers::Estimation::Discrete::ModeEstimation::ModeEstimator::myCCAmodel, and Mers::Estimation::Discrete::ModeEstimatorBase::nextTrajectories.

Here is the call graph for this function:

double ModeEstimatorDebug::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 123 of file ModeEstimatorDebug.cpp.

References Mers::Estimation::Discrete::ModeEstimationPerformance::MEPerformanceMonitor::computeAccumulatedBeliefStateUncertainty(), Mers::Estimation::Discrete::ModeEstimatorBase::nextTrajectories, and Mers::Estimation::Discrete::ModeEstimatorBase::objectiveFunction.

Here is the call graph for this function:

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

Initializes numEstimatesGenerated to zero and then calls the base class function shown below:

Calculates the next trajectories using OPSAT

Returns:
  true if successfully generated new trajectories, false otherwise

Reimplemented from Mers::Estimation::Discrete::ModeEstimation::ModeEstimator.

Reimplemented in Mers::Estimation::Discrete::ApproximateBeliefState::BFBSE::BFBSE.

Definition at line 138 of file ModeEstimatorDebug.cpp.

References Mers::Estimation::Discrete::ModeEstimationPerformance::MEPerformanceMonitor::numEstimatesGenerated.

Referenced by findModeEstimate().

virtual bool Mers::Estimation::Discrete::ModeEstimationPerformance::ModeEstimatorDebug::findNextBestStateAndPutInHeap | ( | unsigned int | opsatNum,
|  | 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 OPSAT # opsatNum and (2) places the solution into the heap if it is a valid solution and the probability of the solution is > 0.

Parameters:

  | opsatNum | 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 opsat. The default is false.

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

See also:
  generateTrajectories

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

Referenced by Mers::Estimation::Discrete::ApproximateBeliefState::BFBSE::BFBSE::generateTrajectories().

bool ModeEstimatorDebug::releaseMemoryAndNormalize | ( | Mers::Models::Base::BaseModelClauseArray * | currentObservationAssignments,
|  | Mers::Estimation::Discrete::EstimateHeap * | nextTrajsEstHeap = `NULL` |
| ) |  |  | `[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 deletes currentObservationAssignments, clears the estimate heap, and resets all the opsats.

Parameters:

  | currentObservationAssignments | the observation assignments to delete
  | nextTrajsEstHeap | the heap to clear

Returns:
  true

Reimplemented from Mers::Estimation::Discrete::ModeEstimation::ModeEstimator.

Definition at line 159 of file ModeEstimatorDebug.cpp.

References Mers::Estimation::Discrete::ModeEstimationPerformance::MEPerformanceMonitor::gatherEstimationCycleResults(), and Mers::Estimation::Discrete::ModeEstimation::ModeEstimator::opsats.

Referenced by Mers::Estimation::Discrete::ApproximateBeliefState::BFBSE::BFBSE::generateTrajectories().

Here is the call graph for this function:

bool ModeEstimatorDebug::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 170 of file ModeEstimatorDebug.cpp.

References Mers::Estimation::Discrete::ModeEstimatorBase::addEstimateToCurrentTrajectories(), and Mers::Estimation::Discrete::ModeEstimationPerformance::MEPerformanceMonitor::adjustUncertaintyForNewEstimate().

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/ModeEstimationPerformance/Monitor/ModeEstimatorDebug.h
- /Users/fpy/titan-1-5-MBARI/Mers/Estimation/Discrete/ModeEstimationPerformance/Monitor/ModeEstimatorDebug.cpp