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

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

    00001 //=============================================================================
    00002 // ProbRuleGenerator.h: interface for the ProbRuleGenerator 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 // This class is used to extract a set of probability rules (observation and
    00015 // transition rules) from a set of dissents. These rules are then used online
    00016 // in order to properly calculate the component transition and observation
    00017 // probabilities.
    00018 //
    00019 // A transition probability rule is a set of mutually inconsistent modes (a
    00020 // dissent that is always enabled). If all the mutually inconsistent modes are
    00021 // determined online to be enabled target modes, all other transition
    00022 // probabilities should be normalized to compensate for this illegitimate
    00023 // transition. This can be done prior to inserting the component transition
    00024 // probabilities into BFIG.
    00025 //
    00026 // Transition probabilities rules are easily identified as dissents with no
    00027 // antecedents (empty set of observations). Hence, they are always enabled.
    00028 //
    00029 // An observation probability rule identifies the observation probability for a
    00030 // set of assignments to mode variables based on the assumption that the
    00031 // observation probability is 1 if the observation entails the state, 0 if the
    00032 // observation refutes the state, or 1/m where m is the number of consistent
    00033 // observation assignments for that set of mode assignments. The rules that lead
    00034 // to observation probabilities of 0 or 1 are discarded since those values are
    00035 // already automatic in the BFIG search. The other rules are triggered online
    00036 // during the BFIG search.
    00037 //
    00038 // Observation probability rules are identified through the following 3 step
    00039 // process:
    00040 //  1. Determine which observations are dependent on which components and group
    00041 //  them together. Then, within each group:
    00042 //  2. Determine the number of combinations of observation assignments there are
    00043 //  3. Reduce the number of combinations for particular mode assignments using
    00044 //  the dissent information.
    00045 //
    00046 //=============================================================================
    00047
    00048 #if !defined(_PROBRULEGENERATOR_H_)
    00049 #define _PROBRULEGENERATOR_H_
    00050
    00051 #if _MSC_VER > 1000
    00052 #pragma once
    00053 #endif // _MSC_VER > 1000
    00054
    00055
    00056 #include <vector>
    00057 #include <iostream>
    00058
    00059 namespace Mers {
    00060         namespace Models {
    00061                 namespace Base {
    00062                         class BaseModel;
    00063                 }
    00064         }
    00065         namespace Utils {
    00066                 namespace Containers {
    00067                         class IntegerArray;
    00068                 }
    00069         }
    00070         namespace Estimation {
    00071                 namespace Discrete {
    00072                         class Dissent;
    00073
    00074                         namespace ProbabilityRules {
    00075                                 class ObsProbRule;
    00076
    00077                                 namespace RuleGenerator {
    00078
    00085                         class ProbRuleGenerator
    00086                         {
    00087
    00088                                 friend std::ostream &  operator<<(std::ostream &, ProbRuleGenerator const &);
    00089
    00090                         public:
    00091                                 //-----------------------------------------
    00092                                 // Constructors
    00093                                 //-----------------------------------------
    00094
    00104                                 ProbRuleGenerator(const Mers::Models::Base::BaseModel * theBMp,
    00105                                                 const std::vector<const Mers::Estimation::Discrete::Dissent *> theDissentsVec,
    00106                                                 unsigned short db = 0);
    00107
    00108
    00109                                 //-----------------------------------------
    00110                                 // Destructors
    00111                                 //-----------------------------------------
    00112
    00118                                 virtual ~ProbRuleGenerator();
    00119
    00120
    00121                                 //-----------------------------------------
    00122                                 // Functions
    00123                                 //-----------------------------------------
    00124
    00131                                 const std::vector<const Mers::Estimation::Discrete::ProbabilityRules::ObsProbRule *>
    00132                                         getObservationRules(void) const;
    00133
    00139                                 void setDebug(const unsigned short db);
    00140
    00141
    00142                         private:
    00143
    00152                                 bool    getObservationAndComponentDependencies(
    00153                                                 std::vector<Mers::Utils::Containers::IntegerArray *> & obsCompDependencies_vec,
    00154                                                 std::vector<Mers::Utils::Containers::IntegerArray *> & dissentIDgroup) const;
    00155
    00169                                 std::vector<const Mers::Estimation::Discrete::ProbabilityRules::ObsProbRule *>
    00170                                         determineNumConsistentObs(
    00171                                                 const Mers::Utils::Containers::IntegerArray * varIDs,
    00172                                                 const Mers::Utils::Containers::IntegerArray * relevantDissentIDs) const;
    00173
    00185                                 bool incrementCurrentValueArray(
    00186                                                 Mers::Utils::Containers::IntegerArray *& theCurrentValueIDs,
    00187                                                 const Mers::Utils::Containers::IntegerArray * maxDomainSizes,
    00188                                                 unsigned int index, int ignoreIndex = -1) const;
    00189
    00191                                 const Mers::Models::Base::BaseModel *   model_p;
    00192
    00194                                 const std::vector<const Mers::Estimation::Discrete::Dissent *>  dissents_vec;
    00195
    00197                                 unsigned short                  debug;
    00198
    00199                                         };
    00200                                 }
    00201                         }
    00202                 }
    00203         }
    00204 }
    00205
    00206 #endif // !defined(_PROBRULEGENERATOR_H_)