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

# /Users/fpy/titan-1-5-MBARI/Mers/Estimation/Discrete/ModeEstimation/ModeEstimator.h

    00001 //=============================================================================
    00002 // ModeEstimator.h: interface for the ModeEstimator class.
    00003 //
    00004 // Copyright (c) 2004           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 // The ModeEstimator is an HHM estimation engine that generates estimates that
    00015 //  are consistent with the CCA model, commands, and observations. Estimates
    00016 //  are generated in best-first order (highest posterior probability first) by
    00017 //  using Opsat to find the most likely diagnoses. This implimentation of
    00018 //  ModeEstimator tracks the k most likely trajectories over time.
    00019 //
    00020 //=============================================================================
    00021
    00022
    00023 #if !defined(_MODEESTIMATOR_H_)
    00024 #define _MODEESTIMATOR_H_
    00025
    00026 #if _MSC_VER > 1000
    00027 #pragma once
    00028 #endif // _MSC_VER > 1000
    00029
    00030
    00031 #include <vector>
    00032 #include <Mers/Models/CCA/CCAModel.h>
    00033 #include <Mers/Utils/Containers/DynamicArrayTemplate.h>
    00034 #include <Mers/Models/Base/BaseModelAssignmentArray.h>
    00035 #include "../ModeEstimatorBase.h"
    00036
    00037
    00038 namespace Mers {
    00039         namespace Models {
    00040                 namespace CCA {
    00041                         class CCAModel;
    00042                         class CCASentance;
    00043                 }
    00044                 namespace Base {
    00045                         class BaseModelVariableArray;
    00046                         class BaseModelAssignment;
    00047                 }
    00048         }
    00049         namespace Solvers {
    00050                 namespace SAT {
    00051                         namespace GATSAT {
    00052                                 namespace OpSAT {
    00053                                         class Opsat;
    00054                                 }
    00055                         }
    00056                 }
    00057         }
    00058         namespace Estimation {
    00059                 namespace Discrete {
    00060
    00061                         class Dissent;
    00062                         class CompiledTransition;
    00063                         class Trajectories;
    00064                         class EstimateHeap;
    00065
    00066                         namespace ModeEstimation {
    00067
    00075                                 class ModeEstimator : public Mers::Estimation::Discrete::ModeEstimatorBase
    00076                                 {
    00077
    00078                                 public:
    00079                                         //-----------------------------------------
    00080                                         // Constructors
    00081                                         //-----------------------------------------
    00082
    00090                                         ModeEstimator(const Mers::Models::CCA::CCAModel &cca,
    00091                                                                 Mers::Estimation::Discrete::Trajectories * initialTrajectories = NULL);
    00092
    00093
    00094                                         //-----------------------------------------
    00095                                         // Destructors
    00096                                         //-----------------------------------------
    00097
    00101                                         virtual ~ModeEstimator();
    00102
    00103
    00104                                         //-----------------------------------------
    00105                                         // Functions
    00106                                         //-----------------------------------------
    00107
    00108
    00114                                         void                            setDebug(const unsigned short db);
    00115
    00116
    00117                                 protected:
    00118
    00123                                         virtual bool            generateTrajectories(void);
    00124
    00134                                         virtual const Mers::Models::Base::BaseModelAssignmentArray *
    00135                                                                                 generateBestSolution(unsigned int generatorNum, long int maximumVisitedNodeCount,
    00136                                                                                 long int maxQueueSize);
    00137
    00147                                         virtual bool            addEstimate(Mers::Estimation::Discrete::Estimate * theEst,
    00148                                                                                         Mers::Estimation::Discrete::EstimateHeap * nextTrajsEstHeap = NULL);
    00149
    00159                                         virtual bool            releaseMemoryAndNormalize(Mers::Models::Base::BaseModelClauseArray * currentObservationAssignments,
    00160                                                                                                                 Mers::Estimation::Discrete::EstimateHeap * nextTrajsEstHeap = NULL);
    00161
    00162
    00168                                         static std::vector<const Mers::Estimation::Discrete::Dissent *>                         emptyDissentVector(void);
    00169
    00177                                         static std::vector<const Mers::Estimation::Discrete::CompiledTransition *>
    00178                                                                         extractTransitionsFromCCA(const Mers::Models::CCA::CCAModel &aCCAmodel);
    00179
    00180
    00191                                         static void                     extractDNFTransitions(const Mers::Models::CCA::CCAAutomaton * auton,
    00192                                                                                         const Mers::Models::CCA::CCATransition * trans,
    00193                                                                                         const Mers::Models::Base::BaseModelAssignmentArray * guards,
    00194                                                                                         std::vector<const Mers::Estimation::Discrete::CompiledTransition *> & compTransitions);
    00195
    00209                                         static bool                     addGuardAssign(const Mers::Models::Base::BaseModelAssignment * constraint,
    00210                                                                                         Mers::Utils::Containers::DynamicArrayTemplate<Mers::Models::Base::BaseModelAssignmentArray> &gv);
    00211
    00216                                         void                            resetOpsats(void);
    00217
    00218                                         //-----------------------------------------
    00219                                         // Data Members
    00220                                         //-----------------------------------------
    00221
    00226                                         std::vector<Mers::Solvers::SAT::GATSAT::OpSAT::Opsat *>         opsats;
    00227
    00228
    00231                                         const Mers::Models::CCA::CCAModel                                                       &myCCAmodel;
    00232
    00236                                         Mers::Models::Base::BaseModelVariableArray *                            observationVariables;
    00237
    00239                                         Mers::Models::CCA::CCASentence *                                                        globalConstraints;
    00240                                 };
    00241                         }
    00242                 }
    00243         }
    00244 }
    00245
    00246 #endif // !defined(_MODEESTIMATOR_H_)