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

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

# Mers::Estimation::Discrete::ModeEstimatorBase Class Reference

`#include <ModeEstimatorBase.h>`

Inheritance diagram for Mers::Estimation::Discrete::ModeEstimatorBase:

[legend]
Collaboration diagram for Mers::Estimation::Discrete::ModeEstimatorBase:

[legend]
List of all members.

## Public Member Functions
| ModeEstimatorBase (const Mers::Models::Base::BaseModel &bm, std::vector< const Dissent * > dissents, std::vector< const CompiledTransition * > compiledTransitions, Trajectories *initialTrajectories)
virtual | ~ModeEstimatorBase ()
bool | observe (const Mers::Utils::Lang::String var, const Mers::Utils::Lang::String val)
bool | observe (const unsigned int var, const unsigned int val)
bool | command (const Mers::Utils::Lang::String var, const Mers::Utils::Lang::String val, unsigned int estNum=0)
bool | command (const unsigned int var, const unsigned int val, unsigned int estNum=0)
bool | setCurrentState (const Mers::Utils::Lang::String var, const Mers::Utils::Lang::String val)
bool | setCurrentState (const unsigned int var, const unsigned int val)
bool | addTrajectory (Estimate *est)
bool | setTrajectory (Estimate *est)
double | getUncertainty () const
virtual const Estimate * | findModeEstimate (void)
Mers::Utils::Containers::intList const * | findModeEstimateIntList (bool full=true)
virtual const Estimate * | progressToEstimate (void)
const Trajectories * | getCurrentTrajectories (void) const
const Trajectories * | findNextTrajectories (void)
virtual bool | resetCommandsAndObservations (void)
void | showAllVars (std::ostream &out) const
void | showStateVars (std::ostream &out) const
void | showCommandVars (std::ostream &out) const
void | showObservationVars (std::ostream &out) const
void | showDissents (std::ostream &out) const
void | showCompiledTransitions (std::ostream &out) const
void | showEnabled (std::ostream &out) const
void | showConflicts (std::ostream &out) const
void | showCurrentTrajectories (std::ostream &out) const
void | showNextTrajectories (std::ostream &out)
void | setNumberTrajectories (unsigned int k)
virtual void | setDebug (const unsigned short db)
## Protected Member Functions
virtual bool | generateTrajectories (void)=0
virtual bool | findNextBestStateAndPutInHeap (unsigned int generatorNum, const std::vector< double > &allProbs, Mers::Estimation::Discrete::EstimateHeap *nextTrajsEstHeap, bool willWarn=false)
virtual bool | calculateEstimateProbability (double &estProbability, const Mers::Models::Base::BaseModelAssignmentArray *state, unsigned int generatorNum, const std::vector< double > &allProbs) const
virtual const Mers::Models::Base::BaseModelAssignmentArray * | generateBestSolution (unsigned int generatorNum, long int maximumVisitedNodeCount, long int maxQueueSize)=0
virtual bool | addEstimate (Mers::Estimation::Discrete::Estimate *theEst, Mers::Estimation::Discrete::EstimateHeap *nextTrajsEstHeap=NULL)=0
virtual bool | releaseMemoryAndNormalize (Mers::Estimation::Discrete::EstimateHeap *nextTrajsEstHeap)
virtual void | cleanAfterFailure (Mers::Estimation::Discrete::EstimateHeap *nextTrajsEstHeap=NULL)
virtual bool | addEstimateToCurrentTrajectories (Mers::Estimation::Discrete::Estimate *anEst, bool createNewCurrentTrajectories=false)
## Protected Attributes
const Mers::Models::Base::BaseModel & | model
| The variables and domains of the model. Used to set up the decision variables and probability map.
Trigger * | compiledObjectTrigger
| Pointer to the dissent and compiled transition trigger.
Mers::Models::Base::BaseModelVariableArray * | decisionVariables
| Array of decision variables to be used by BFIG. Won't change once loaded.
Mers::Utils::Containers::IntegerArray * | probabilityMap
| A probability map for the decision variables.
MEObjectiveFunction * | objectiveFunction
| The Mode Estimation Objective Function.
Trajectories * | currentTrajectories
| The current trajectories.
Trajectories * | nextTrajectories
| The next trajectories. The current trajectories are set to the next trajectories when progressToEstimate is called.
unsigned int | maxNumberEstimates
| The maximum number of estimates to maintain.
unsigned short | debug
| The debug level.
## Friends
std::ostream & | operator<< (std::ostream &, ModeEstimatorBase const &)

## Detailed Description

The ModeEstimator 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 76 of file ModeEstimatorBase.h.

## Constructor & Destructor Documentation

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

Creates a new ModeEstimatorBase

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.

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

Destroys the estimate

Definition at line 106 of file ModeEstimatorBase.cpp.

References compiledObjectTrigger, currentTrajectories, decisionVariables, nextTrajectories, and probabilityMap.

## Member Function Documentation

bool ModeEstimatorBase::observe | ( | const Mers::Utils::Lang::String | var,
|  | const Mers::Utils::Lang::String | val |
| ) |  |  |

Assigns a value to an observation variable at (t+1)

Parameters:

  | var | observation variable string
  | val | observation value string

Returns:
  true if variable is of type OBSERVABLE, false otherwise

Definition at line 124 of file ModeEstimatorBase.cpp.

Referenced by Mers::Estimation::Discrete::assign(), Mers::Estimation::Discrete::get_directed_assign(), and Mers::Estimation::Discrete::MEInterface::observe().

bool ModeEstimatorBase::observe | ( | const unsigned int | var,
|  | const unsigned int | val |
| ) |  |  |

Assigns a value to an observation variable at (t+1)

Parameters:

  | var | observation variable UID
  | val | observation value UID

Returns:
  true if variable is of type OBSERVABLE, false otherwise

Definition at line 130 of file ModeEstimatorBase.cpp.

bool ModeEstimatorBase::command | ( | const Mers::Utils::Lang::String | var,
|  | const Mers::Utils::Lang::String | val,
|  | unsigned int | estNum = `0` |
| ) |  |  |

Assigns a value to a command variable at (t)

Parameters:

  | var | command variable string
  | val | command value string
  | estNum | the estimate number to apply the assigment to in the trigger. (This parameter should only be used for simulation purposes)

Returns:
  true if variable is of type CONTROL, false otherwise

Definition at line 136 of file ModeEstimatorBase.cpp.

Referenced by Mers::Estimation::Discrete::assign(), Mers::Estimation::Discrete::get_directed_assign(), and Mers::Estimation::Discrete::MEInterface::progress().

bool ModeEstimatorBase::command | ( | const unsigned int | var,
|  | const unsigned int | val,
|  | unsigned int | estNum = `0` |
| ) |  |  |

Assigns a value to a command variable at (t)

Parameters:

  | var | command variable UID
  | val | command value UID
  | estNum | the estimate number to apply the assigment to in the trigger. (This parameter should only be used for simulation purposes)

Returns:
  true if variable is of type CONTROL, false otherwise

Definition at line 142 of file ModeEstimatorBase.cpp.

bool ModeEstimatorBase::setCurrentState | ( | const Mers::Utils::Lang::String | var,
|  | const Mers::Utils::Lang::String | val |
| ) |  |  |

Changes the state variable assignment to the most likely estimate and deletes all the other estimates in the trajectories; setting the single estimate to probability 1

Parameters:

  | var | state variable string
  | val | state value string

Returns:
  true if variable is of type STATE, false otherwise

Definition at line 148 of file ModeEstimatorBase.cpp.

Referenced by Mers::Estimation::Discrete::assign(), Mers::Estimation::Discrete::get_directed_assign(), and Mers::Estimation::Discrete::MEInterface::set_initial_state().

bool ModeEstimatorBase::setCurrentState | ( | const unsigned int | var,
|  | const unsigned int | val |
| ) |  |  |

Changes the state variable assignment to the most likely estimate and deletes all the other estimates in the trajectories; setting the single estimate to probability 1

Parameters:

  | var | state variable string
  | val | state value string

Returns:
  true if variable is of type STATE, false otherwise

Definition at line 154 of file ModeEstimatorBase.cpp.

bool ModeEstimatorBase::addTrajectory | ( | Estimate * | est | ) |

Adds the estimate to the current trajectories. If there is not enough probability space to add the estimate, the trajectories are deleted and the new estimate becomes the single trajectory. Commands and observations are reset.

Parameters:

  | est | the leading estimate of the new trajectory

Returns:
  true if successfully added estimate and reset commands and observations, false otherwise

Definition at line 160 of file ModeEstimatorBase.cpp.

References addEstimateToCurrentTrajectories(), currentTrajectories, Mers::Estimation::Discrete::Trajectories::getBeliefUncertainty(), Mers::Estimation::Discrete::Estimate::getProbability(), and setTrajectory().

Referenced by Mers::Estimation::Discrete::read_trajectory().

Here is the call graph for this function:

bool ModeEstimatorBase::setTrajectory | ( | Estimate * | est | ) |

Clears the current trajectories and sets them to the single estimate provided. Commands and observations are reset.

Parameters:

  | est | the leading estimate of the new trajectory

Returns:
  true if successfully added estimate and reset commands and observations, false otherwise

Definition at line 172 of file ModeEstimatorBase.cpp.

References addEstimateToCurrentTrajectories().

Referenced by addTrajectory(), and Mers::Estimation::Discrete::read_trajectory().

Here is the call graph for this function:

double ModeEstimatorBase::getUncertainty | ( |  | ) | const

Gets the amount of unenumerated probability in the set of trajectories

Returns:
  amount of unused probability space

Definition at line 179 of file ModeEstimatorBase.cpp.

References currentTrajectories, and Mers::Estimation::Discrete::Trajectories::getBeliefUncertainty().

Here is the call graph for this function:

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

Interface function to generate the next trajectories

Returns:
  the most likely estimate in the next trajectories

See also:
  generateTrajectories

Reimplemented in Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug, and Mers::Estimation::Discrete::ModeEstimationPerformance::ModeEstimatorDebug.

Definition at line 188 of file ModeEstimatorBase.cpp.

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

Referenced by findModeEstimateIntList(), findNextTrajectories(), progressToEstimate(), and showNextTrajectories().

Here is the call graph for this function:

intList const * ModeEstimatorBase::findModeEstimateIntList | ( | bool | full = `true` | ) |

Uses findModeEstimate to generate the next trajectories and then converts the leading estimate into an intList for use by the RTAPI

Parameters:

  | full | if false, returns only the mode assignments that have changed. Otherwise, all the mode assignments are places in the intList.

Returns:
  the most likely estimate in the next trajectories at an intList

See also:
  findModeEstimate

Definition at line 202 of file ModeEstimatorBase.cpp.

References currentTrajectories, findModeEstimate(), Mers::Estimation::Discrete::Trajectories::getMostLikelyEstimate(), and nextTrajectories.

Referenced by Mers::Estimation::Discrete::MEInterface::find_mode_estimate(), and Mers::Estimation::Discrete::MEInterface::get_full_state().

Here is the call graph for this function:

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

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 in Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug, and Mers::Estimation::Discrete::ModeEstimationPerformance::ModeEstimatorDebug.

Definition at line 213 of file ModeEstimatorBase.cpp.

References currentTrajectories, findModeEstimate(), Mers::Estimation::Discrete::Trajectories::getMostLikelyEstimate(), nextTrajectories, and resetCommandsAndObservations().

Referenced by Mers::Estimation::Discrete::MEInterface::find_mode_estimate(), Mers::Estimation::Discrete::MEInterface::get_full_state(), Mers::Estimation::Discrete::MEInterface::progress_to_estimate(), Mers::Estimation::Discrete::ModeEstimationPerformance::ModeEstimatorDebug::progressToEstimate(), and Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug::progressToEstimate().

Here is the call graph for this function:

const Trajectories * ModeEstimatorBase::getCurrentTrajectories | ( | void |  | ) | const

Access to the current trajectories

Returns:
  currentTrajectories data member

Definition at line 229 of file ModeEstimatorBase.cpp.

References currentTrajectories.

const Trajectories * ModeEstimatorBase::findNextTrajectories | ( | void |  | ) |

Interface function to generate the next trajectories and return them. ME does not progress into these next trajectories until progressToEstimate is called.

Returns:
  the next trajectories

See also:
  findModeEstimate

Definition at line 236 of file ModeEstimatorBase.cpp.

References findModeEstimate(), and nextTrajectories.

Here is the call graph for this function:

bool ModeEstimatorBase::resetCommandsAndObservations | ( | void |  | ) | `[virtual]`

Clears all the commands and observations as well as resets the trigger. Always called after each progression into the most likely estimate.

Returns:
  true on succussful reset of the trigger, false otherwise

Definition at line 245 of file ModeEstimatorBase.cpp.

References currentTrajectories, and nextTrajectories.

Referenced by addEstimateToCurrentTrajectories(), and progressToEstimate().

void ModeEstimatorBase::showAllVars | ( | std::ostream & | out | ) | const

Interface function to display all the variables in the model to the specified output stream. '>' signifies the current assignment and '+' signifies a reachable assignment.

Parameters:

  | out | the output stream to use

See also:
  showVars

Definition at line 257 of file ModeEstimatorBase.cpp.

References showCommandVars(), showObservationVars(), and showStateVars().

Referenced by Mers::Estimation::Discrete::print_estimator_variables(), and Mers::Estimation::Discrete::MEInterface::printAllVars().

Here is the call graph for this function:

void ModeEstimatorBase::showStateVars | ( | std::ostream & | out | ) | const

Interface function to display all the state variables in the model to the specified output stream. '>' signifies the current assignment and '+' signifies a reachable assignment.

Parameters:

  | out | the output stream to use

See also:
  showVars

Definition at line 267 of file ModeEstimatorBase.cpp.

Referenced by Mers::Estimation::Discrete::print_estimator_variables(), Mers::Estimation::Discrete::MEInterface::printStateVars(), and showAllVars().

void ModeEstimatorBase::showCommandVars | ( | std::ostream & | out | ) | const

Interface function to display all the command variables in the model to the specified output stream. '>' signifies the current assignment

Parameters:

  | out | the output stream to use

See also:
  showVars

Definition at line 275 of file ModeEstimatorBase.cpp.

Referenced by Mers::Estimation::Discrete::print_estimator_variables(), Mers::Estimation::Discrete::MEInterface::printCommandVars(), and showAllVars().

void ModeEstimatorBase::showObservationVars | ( | std::ostream & | out | ) | const

Interface function to display all the observation variables in the model to the specified output stream. '>' signifies the current assignment

Parameters:

  | out | the output stream to use

See also:
  showVars

Definition at line 281 of file ModeEstimatorBase.cpp.

Referenced by Mers::Estimation::Discrete::print_estimator_variables(), Mers::Estimation::Discrete::MEInterface::printObservationVars(), and showAllVars().

void ModeEstimatorBase::showDissents | ( | std::ostream & | out | ) | const

Displays all the dissents to the specified output stream

Parameters:

  | out | the output stream to use

Definition at line 288 of file ModeEstimatorBase.cpp.

References compiledObjectTrigger, and Mers::Estimation::Discrete::Trigger::showDissents().

Referenced by Mers::Estimation::Discrete::print_estimator_variables().

Here is the call graph for this function:

void ModeEstimatorBase::showCompiledTransitions | ( | std::ostream & | out | ) | const

Displays all the compiled transitions to the specified output stream

Parameters:

  | out | the output stream to use

Definition at line 294 of file ModeEstimatorBase.cpp.

References compiledObjectTrigger, and Mers::Estimation::Discrete::Trigger::showCompiledTransitions().

Referenced by Mers::Estimation::Discrete::print_estimator_variables().

Here is the call graph for this function:

void ModeEstimatorBase::showEnabled | ( | std::ostream & | out | ) | const

Displays all the enabled dissents and compiled transitions to the specified output stream

Parameters:

  | out | the output stream to use

Definition at line 300 of file ModeEstimatorBase.cpp.

References compiledObjectTrigger, and Mers::Estimation::Discrete::Trigger::showEnabled().

Referenced by Mers::Estimation::Discrete::print_estimator_variables().

Here is the call graph for this function:

void ModeEstimatorBase::showConflicts | ( | std::ostream & | out | ) | const

Displays all the conflicts generated from enabled dissents and displays them to the specified output stream

Parameters:

  | out | the output stream to use

Definition at line 306 of file ModeEstimatorBase.cpp.

References compiledObjectTrigger, and Mers::Estimation::Discrete::Trigger::getConflicts().

Referenced by Mers::Estimation::Discrete::print_estimator_variables().

Here is the call graph for this function:

void ModeEstimatorBase::showCurrentTrajectories | ( | std::ostream & | out | ) | const

Displays the current trajectories to the specified output stream.

Parameters:

  | out | the output stream to use

Definition at line 315 of file ModeEstimatorBase.cpp.

References currentTrajectories.

Referenced by Mers::Estimation::Discrete::print_estimator_variables().

void ModeEstimatorBase::showNextTrajectories | ( | std::ostream & | out | ) |

Displays the next trajectories to the specified output stream. If the next trajectories haven't been calculated, findModeEstimate is called first.

Parameters:

  | out | the output stream to use

Definition at line 322 of file ModeEstimatorBase.cpp.

References findModeEstimate(), and nextTrajectories.

Here is the call graph for this function:

void ModeEstimatorBase::setNumberTrajectories | ( | unsigned int | k | ) |

Sets the maximum number of trajectories that will be maintained although it is possible to have less than k consistent trajectories. If nextTrajectories exist, they are deleted.

Parameters:

  | k | the maximum number of trajectories

Definition at line 334 of file ModeEstimatorBase.cpp.

References maxNumberEstimates, and nextTrajectories.

void ModeEstimatorBase::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 in Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator, and Mers::Estimation::Discrete::ModeEstimation::ModeEstimator.

Definition at line 351 of file ModeEstimatorBase.cpp.

References compiledObjectTrigger, currentTrajectories, debug, nextTrajectories, Mers::Estimation::Discrete::Trigger::setDebug(), and Mers::Estimation::Discrete::Trajectories::setDebug().

Referenced by Mers::Estimation::Discrete::ModeEstimation::ModeEstimator::setDebug(), and Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator::setDebug().

Here is the call graph for this function:

virtual bool Mers::Estimation::Discrete::ModeEstimatorBase::generateTrajectories | ( | void |  | ) | `[protected, pure virtual]`

Pure virtual function that calculates the next trajectories using BFIG or Opsat

Returns:
  true if successfully generated new trajectories, false otherwise

Implemented in Mers::Estimation::Discrete::ApproximateBeliefState::BFBSE::BFBSE, Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug, Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator, Mers::Estimation::Discrete::ModeEstimation::ModeEstimator, and Mers::Estimation::Discrete::ModeEstimationPerformance::ModeEstimatorDebug.

Referenced by findModeEstimate().

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

This function was designed to only used by generateTrajectories. It (1) extracts the next best solution from generator (OPSAT or BFIG) # generatorNum and (2) places the solution into the heap if it is a valid solution and the probability of the solution is > 0. If a NULL pointer is provided for the heap, the estimate will be inserted into the nextTrajectories instead.

Parameters:

  | generatorNum | 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. If NULL, the estimate will be placed in nextTrajectories.
  | willWarn | if true, a warning will be displayed if there are no next best solutions to the generator. The default is false.

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

See also:
  generateTrajectories

Reimplemented in Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug, and Mers::Estimation::Discrete::ModeEstimationPerformance::ModeEstimatorDebug.

Referenced by Mers::Estimation::Discrete::ModeEstimation::ModeEstimator::generateTrajectories(), and Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator::generateTrajectories().

virtual bool Mers::Estimation::Discrete::ModeEstimatorBase::calculateEstimateProbability | ( | double & | estProbability,
|  | const Mers::Models::Base::BaseModelAssignmentArray * | state,
|  | unsigned int | generatorNum,
|  | const std::vector< double > & | allProbs |
| ) |  |  | const`[protected, virtual]`

This function was designed to only used by findNextBestStateAndPutInHeap. It simply calculates the estimate probability based on the complete set of enabled component transition probabilities. This implementation is only for BFTE and really belongs in a basic BFTE class.

Parameters:

  | estProbability | the result of the estimate probability is passed back here
  | state | the state for which to calculate the probability for
  | generatorNum | the opsat index from which to generate the next most likely state allProbs the probabilities used to extract the next best state probability

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

See also:
  findNextBestStateAndPutInHeap

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

virtual const Mers::Models::Base::BaseModelAssignmentArray* Mers::Estimation::Discrete::ModeEstimatorBase::generateBestSolution | ( | unsigned int | generatorNum,
|  | long int | maximumVisitedNodeCount,
|  | long int | maxQueueSize |
| ) |  |  | `[protected, pure virtual]`

This function was designed to only used by findNextBestStateAndPutInHeap. It is a pure virtual class that should be implemented to use OpSat or BFIG depending on if the estimator is operating on a uncompiled or compiled model.

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 generator # generatorNum

See also:
  findNextBestStateAndPutInHeap

Implemented in Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator, and Mers::Estimation::Discrete::ModeEstimation::ModeEstimator.

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

Simple virtual function that is called by findNextBestStateAndPutInHeap. It can be implemented to insert the estimate into the heap or into nextTrajectories (depending on BFTE or BFBSE).

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

Implemented in Mers::Estimation::Discrete::ApproximateBeliefState::BFBSE::BFBSE, Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator, and Mers::Estimation::Discrete::ModeEstimation::ModeEstimator.

bool ModeEstimatorBase::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 opsats.

Parameters:

  | nextTrajsEstHeap | the heap to clear

Returns:
  true

Reimplemented in Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug, and Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator.

Definition at line 466 of file ModeEstimatorBase.cpp.

References Mers::Utils::Containers::DynamicArray::makeEmpty(), nextTrajectories, and Mers::Estimation::Discrete::Trajectories::normalize().

Referenced by cleanAfterFailure(), Mers::Estimation::Discrete::ModeEstimation::ModeEstimator::releaseMemoryAndNormalize(), and Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator::releaseMemoryAndNormalize().

Here is the call graph for this function:

void ModeEstimatorBase::cleanAfterFailure | ( | Mers::Estimation::Discrete::EstimateHeap * | nextTrajsEstHeap = `NULL` | ) | `[protected, virtual]`

This function releases memory after a failure that occured while in generateTrajectories. In particular, it deletes nextTrajectories, and calls releaseMemoryAndNormalize (although it obviously has nothing to normalize).

Parameters:

  | nextTrajsEstHeap | the heap to clear

See also:
  releaseMemoryAndNormalize

Definition at line 480 of file ModeEstimatorBase.cpp.

References nextTrajectories, and releaseMemoryAndNormalize().

Referenced by Mers::Estimation::Discrete::ModeEstimation::ModeEstimator::generateTrajectories(), Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator::generateTrajectories(), and Mers::Estimation::Discrete::ApproximateBeliefState::BFBSE::BFBSE::generateTrajectories().

Here is the call graph for this function:

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

Adds the provided estimate to currentTrajectories and resets the current commands and observations. This function provides a hook for debug classes to do performance monitoring (i.e. the amount of probability space maintained).

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 in Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug, and Mers::Estimation::Discrete::ModeEstimationPerformance::ModeEstimatorDebug.

Definition at line 492 of file ModeEstimatorBase.cpp.

References Mers::Estimation::Discrete::Trajectories::addEstimate(), currentTrajectories, debug, and resetCommandsAndObservations().

Referenced by Mers::Estimation::Discrete::ModeEstimationPerformance::ModeEstimatorDebug::addEstimateToCurrentTrajectories(), Mers::Estimation::Discrete::CompiledME::CompiledMEDebug::CBFTEDebug::addEstimateToCurrentTrajectories(), addTrajectory(), and setTrajectory().

Here is the call graph for this function:

## Friends And Related Function Documentation

std::ostream& operator<< | ( | std::ostream & | os,
|  | ModeEstimatorBase const & | me |
| ) |  |  | `[friend]`

Displays the most likely current estimate to the output stream

Definition at line 368 of file ModeEstimatorBase.cpp.

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

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