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

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

# Mers::Estimation::Discrete::Trigger Class Reference

`#include <Trigger.h>`

Collaboration diagram for Mers::Estimation::Discrete::Trigger:

[legend]
List of all members.

## Public Member Functions
| Trigger (const Mers::Models::Base::BaseModelVariableArray *stateVarArray, const Mers::Utils::Containers::IntegerArray *pMap, const unsigned int totalNumVars, std::vector< const Dissent * > diss, std::vector< const CompiledTransition * > compT, const Trajectories *trajs, unsigned short db=0)
virtual | ~Trigger ()
bool | insertAssignment (const Mers::Models::Base::BaseModelAssignment *assign)
bool | insertAssignment (const Mers::Models::Base::BaseModelAssignment *assign, unsigned int estNum)
bool | changeTrajectories (const Trajectories *trajs)
std::vector< double > | getNormalizedEnabledTransitionProbabilities (void)
std::vector< const Mers::Models::Base::BaseModelAssignmentArray * > | getConflicts (void)
int | getCurrentCommandObservationValueUID (unsigned int varUID) const
void | showDissents (std::ostream &out) const
void | showCompiledTransitions (std::ostream &out) const
void | showEnabled (std::ostream &out) const
void | setDebug (const unsigned short debugVal)
## Static Public Attributes
static const int | UNDEFINED
| Constant used to determine if the elements of an array have been defined.
## Friends
std::ostream & | operator<< (std::ostream &, Trigger const &)

## Detailed Description

The Trigger class is responsible for determining which dissents and compiled transitions are enabled and disabled based on the current trajectories (mode assignments), observations, and commands. The trigger returns a set of conflicts from the enabled dissents as well as a set of mode assignments with the probability of transitioning into that mode. Probabilities are determined by summing all the enabled incomming transition probabilities as defined by most likely trajectories.

Definition at line 66 of file Trigger.h.

## Constructor & Destructor Documentation

Mers::Estimation::Discrete::Trigger::Trigger | ( | const Mers::Models::Base::BaseModelVariableArray * | stateVarArray,
|  | const Mers::Utils::Containers::IntegerArray * | pMap,
|  | const unsigned int | totalNumVars,
|  | std::vector< const Dissent * > | diss,
|  | std::vector< const CompiledTransition * > | compT,
|  | const Trajectories * | trajs,
|  | unsigned short | db = `0` |
| ) |  |  |

Creates a new Trigger object

Parameters:

  | stateVarArray | all the mode variables in the system
  | pMap | probability map where each element in the array is the start location of the component mode probabilities for each variable in the stateVarArray
  | totalNumVars | is the number of variables in the model (x, o, u)
  | diss | dissents to trigger
  | compT | compiled transitions to trigger
  | trajs | initial trajectories
  | db | debug flag

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

Destroys the dissent

Definition at line 123 of file Trigger.cpp.

## Member Function Documentation

bool Trigger::insertAssignment | ( | const Mers::Models::Base::BaseModelAssignment * | assign | ) |

Interface method to add the assigment to the list of assigments and adjusts trigger counts accordingly Since both commands and observations can act as guards to compiled transitions, their assignment is asserted for all trajectories. The method also checks to make sure that a mode assignement was not passed in (all mode assignments must be passed in as trajectories)

Parameters:

  | assign | the assignment to insert

Returns:
  true if succesfully inserted, false if the assigment is not part of the model

Definition at line 163 of file Trigger.cpp.

References Mers::Estimation::Discrete::assign(), and Mers::Estimation::Discrete::Trajectories::getNumberEstimates().

Referenced by changeTrajectories().

Here is the call graph for this function:

bool Trigger::insertAssignment | ( | const Mers::Models::Base::BaseModelAssignment * | assign,
|  | unsigned int | estNum |
| ) |  |  |

Adds the assigment to the list of assigments and adjusts trigger counts accordingly

Parameters:

  | assign | the assignment to insert
  | estNum | the estimate index to add the assignment to

Returns:
  true if successfully inserted, false if the assigment is not part of the model

Definition at line 193 of file Trigger.cpp.

References Mers::Estimation::Discrete::assign(), and UNDEFINED.

Here is the call graph for this function:

bool Trigger::changeTrajectories | ( | const Trajectories * | trajs | ) |

Change the trajectories. Usually done after ME generates new trajectories or when the user sets new trajectories. Effectively resets all counters in the trigger.

Parameters:

  | trajs | the new trajectories

Returns:
  true if succesfully, false othewise

Definition at line 249 of file Trigger.cpp.

References Mers::Estimation::Discrete::Estimate::getAssignment(), Mers::Estimation::Discrete::Trajectories::getEstimate(), Mers::Estimation::Discrete::Trajectories::getNumberEstimates(), and insertAssignment().

Here is the call graph for this function:

vector< double > Trigger::getNormalizedEnabledTransitionProbabilities | ( | void |  | ) |

Searches over all the enabled transitions to determine what the normalized transition probabilities are for all trajectories. These values are used as admissible heuristics in BFIG.

Returns:
  vector of probabilities for all transitions. Components are ordered according to the order in the BaseModel with the first set corresponding to the first trajectory. (ie [[transition probabilities for trajectory 0] [transition probabilities for trajectory 1]...])

Definition at line 275 of file Trigger.cpp.

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

vector< const BaseModelAssignmentArray * > Trigger::getConflicts | ( | void |  | ) |

Gathers all the conflicts based on the enabled disssents. Used to prune branches of the BFIG A* search.

Returns:
  vector of BaseModelAssignmentArrays where each assignment array is a conflict

Definition at line 284 of file Trigger.cpp.

Referenced by Mers::Estimation::Discrete::CompiledME::CompiledModeEstimator::generateTrajectories(), and Mers::Estimation::Discrete::ModeEstimatorBase::showConflicts().

int Trigger::getCurrentCommandObservationValueUID | ( | unsigned int | varUID | ) | const

Determines if a command or observation variable has been assigned a value

Parameters:

  | varUID | the command or observation variable UID to check for assignment

Returns:
  the UID of the assignment value, -1 if unknown

Definition at line 293 of file Trigger.cpp.

References UNDEFINED.

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

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

Displays all the dissents to the specified output stream

Parameters:

  | out | the output stream to use

Definition at line 302 of file Trigger.cpp.

Referenced by Mers::Estimation::Discrete::ModeEstimatorBase::showDissents().

void Trigger::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 313 of file Trigger.cpp.

Referenced by Mers::Estimation::Discrete::ModeEstimatorBase::showCompiledTransitions().

void Trigger::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 324 of file Trigger.cpp.

Referenced by Mers::Estimation::Discrete::ModeEstimatorBase::showEnabled().

void Trigger::setDebug | ( | const unsigned short | debugVal | ) |

Sets the debug flag to the value specified

Parameters:

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

Definition at line 342 of file Trigger.cpp.

Referenced by Mers::Estimation::Discrete::ModeEstimatorBase::setDebug().

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

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