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

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

    00001 //=============================================================================
    00002 // Rule.h: interface for the Rule class.
    00003 //
    00004 // Copyright (c) 2005           Model-based Embedded and Robotic Systems Group
    00005 // All Rights Reserved          Massachusetts Institute of Technology
    00006 //
    00007 // This software is provided as is. Model-based Embedded and Robotic Systems
    00008 // (MERS) group does not assume any responsibility.
    00009 //
    00010 // Author:                      Oliver B. Martin
    00011 // Organization:                Model-based Embedded and Robotic Systems Group
    00012 //                              Massachusetts Institute of Technology
    00013 //
    00014 // A rule contains a set of varaible assignments and a counter. Rules are used
    00015 // by the rule trigger to determine if the rule is enabled (all the rule
    00016 // assignments are satisfied). Alturnatively, the trigger can determine which
    00017 // rules have been partially satisfied.
    00018 //
    00019 //=============================================================================
    00020
    00021 #if !defined(_RULE_H_)
    00022 #define _RULE_H_
    00023
    00024 #if _MSC_VER > 1000
    00025 #pragma once
    00026 #endif // _MSC_VER > 1000
    00027
    00028
    00029 #include <vector>
    00030 #include <iostream>
    00031
    00032 namespace Mers {
    00033         namespace Models {
    00034                 namespace Base {
    00035                         class BaseModelAssignmentArray;
    00036                 }
    00037         }
    00038         namespace Estimation {
    00039                 namespace Discrete {
    00040                         namespace ProbabilityRules {
    00041
    00048                         class Rule
    00049                         {
    00050
    00051                                 friend std::ostream &  operator<<(std::ostream &, Rule const &);
    00052
    00053                         public:
    00054                                 //-----------------------------------------
    00055                                 // Constructors
    00056                                 //-----------------------------------------
    00057
    00063                                 Rule(const Mers::Models::Base::BaseModelAssignmentArray * myAssigmentArray,
    00064                                                 unsigned short db = 0);
    00065
    00066
    00067                                 //-----------------------------------------
    00068                                 // Destructors
    00069                                 //-----------------------------------------
    00070
    00075                                 virtual ~Rule();
    00076
    00077
    00078                                 //-----------------------------------------
    00079                                 // Functions
    00080                                 //-----------------------------------------
    00081
    00085                                 void reset(void);
    00086
    00092                                 bool increment(void);
    00093
    00099                                 unsigned int getNumberSatisfied(void) const;
    00100
    00105                                 unsigned int getNumberNotSatisfied(void) const;
    00106
    00111                                 const Mers::Models::Base::BaseModelAssignmentArray * getAllAssignments(void) const;
    00112
    00117                                 bool isTriggered(void) const;
    00118
    00124                                 void setDebug(const unsigned short db);
    00125
    00126
    00127                         private:
    00129                                 const Mers::Models::Base::BaseModelAssignmentArray *    ruleAssignments;
    00130
    00132                                 int                     numNotSatisfied;
    00133
    00135                                 unsigned short                  debug;
    00136
    00137                                 };
    00138                         }
    00139                 }
    00140         }
    00141 }
    00142
    00143 #endif // !defined(_RULE_H_)