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

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

# Mers::Estimation::Discrete::ProbabilityRules::Rule Class Reference

`#include <Rule.h>`

Inheritance diagram for Mers::Estimation::Discrete::ProbabilityRules::Rule:

[legend]
Collaboration diagram for Mers::Estimation::Discrete::ProbabilityRules::Rule:

[legend]
List of all members.

## Public Member Functions
| Rule (const Mers::Models::Base::BaseModelAssignmentArray *myAssigmentArray, unsigned short db=0)
virtual | ~Rule ()
void | reset (void)
bool | increment (void)
unsigned int | getNumberSatisfied (void) const
unsigned int | getNumberNotSatisfied (void) const
const Mers::Models::Base::BaseModelAssignmentArray * | getAllAssignments (void) const
bool | isTriggered (void) const
void | setDebug (const unsigned short db)
## Friends
std::ostream & | operator<< (std::ostream &, Rule const &)

## Detailed Description

A rule contains a set of varaible assignments and a counter. Rules are used by the rule trigger to determine if the rule is enabled (all the rule assignments are satisfied). Alturnatively, the trigger can determine which rules have been partially satisfied.

Definition at line 48 of file Rule.h.

## Constructor & Destructor Documentation

Rule::Rule | ( | const Mers::Models::Base::BaseModelAssignmentArray * | myAssigmentArray,
|  | unsigned short | db = `0` |
| ) |  |  |

Creates new Rule

Parameters:

  | myAssigmentArray | is the set of rule assignments
  | db | the initial debug value (0 if unassigned)

Definition at line 27 of file Rule.cpp.

References Mers::Utils::Containers::DynamicArray::getLength().

Here is the call graph for this function:

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

Destroys all the probability rule. Deletes the rule assigments' memory

Definition at line 38 of file Rule.cpp.

## Member Function Documentation

void Rule::reset | ( | void |  | ) |

Resets the number of assignments not satisfied to the length of ruleAssignments

Definition at line 50 of file Rule.cpp.

References Mers::Utils::Containers::DynamicArray::getLength().

Here is the call graph for this function:

bool Rule::increment | ( | void |  | ) |

Increments the number of satisfied assignments

Returns:
  false if all assignments have already been satisfied (the number satisfied stays at 0), true otherwise

Definition at line 57 of file Rule.cpp.

unsigned int Rule::getNumberSatisfied | ( | void |  | ) | const

Gets the number of satisfied variable assignments

Returns:
  number of variable assignments satisfied (length of ruleAssignments - numNotSatisfied)

Definition at line 68 of file Rule.cpp.

References Mers::Utils::Containers::DynamicArray::getLength().

Here is the call graph for this function:

unsigned int Rule::getNumberNotSatisfied | ( | void |  | ) | const

Gets the number of unsatisfied variable assignments

Returns:
  number of variable assignments not satisfied (numNotSatisfied)

Definition at line 75 of file Rule.cpp.

const BaseModelAssignmentArray * Rule::getAllAssignments | ( | void |  | ) | const

Gets the assignment array

Returns:
  a pointer to the ruleAssignments

Definition at line 81 of file Rule.cpp.

bool Rule::isTriggered | ( | void |  | ) | const

Determines if all the assignments have been satisfied

Returns:
  true if all assignments have been satisfied, false otherwise

Definition at line 88 of file Rule.cpp.

void Rule::setDebug | ( | const unsigned short | db | ) |

Sets the debug flag to the value specified

Parameters:

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

Definition at line 98 of file Rule.cpp.

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

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