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

# /Users/fpy/titan-1-5-MBARI/Mers/Estimation/Discrete/ApproximateBeliefState/BFBSU/BFBSU.cpp

    00001 //==============================================================================
    00002 // Copyright (c) 2005           Model-based Embedded and Robotic Systems Group
    00003 // All Rights Reserved          Massachusetts Institute of Technology
    00004 //
    00005 // This software is provided as is. Model-based Embedded and Robotic Systems
    00006 // (MERS) group does not assume any responsibility.
    00007 //==============================================================================
    00008
    00009 #include "BFBSU.h"
    00010
    00011 #ifdef _MSC_VER
    00012 #pragma warning( disable : 4786 )
    00013 #endif
    00014
    00015
    00016 #include <Mers/Estimation/Discrete/Trajectories.h>
    00017 #include <Mers/Estimation/Discrete/EstimateHeap.h>
    00018 #include <Mers/Estimation/Discrete/ApproximateBeliefState/BSUObjectiveFunction.h>
    00019 #include <Mers/Estimation/Discrete/ProbabilityRules/RuleTriggering/RuleTrigger.h>
    00020 #include <Mers/Estimation/Discrete/ProbabilityRules/ObsProbRule.h>
    00021 #include <Mers/Estimation/Discrete/ProbabilityRules/Rule.h>
    00022
    00023 #include <Mers/Models/Base/BaseModelAssignmentArray.h>
    00024
    00025 #include <math.h>
    00026 #include <map>
    00027
    00028 using Mers::Estimation::Discrete::ApproximateBeliefState::BFBSU::BFBSU;
    00029 using Mers::Estimation::Discrete::ApproximateBeliefState::BFBSE::BFBSE;
    00030 using Mers::Estimation::Discrete::ApproximateBeliefState::BSUObjectiveFunction;
    00031 using Mers::Estimation::Discrete::ProbabilityRules::RuleTriggering::RuleTrigger;
    00032 using Mers::Estimation::Discrete::ProbabilityRules::ObsProbRule;
    00033 using Mers::Estimation::Discrete::ProbabilityRules::Rule;
    00034 using Mers::Estimation::Discrete::Trajectories;
    00035 using Mers::Models::CCA::CCAModel;
    00036 using Mers::Models::Base::BaseModelAssignmentArray;
    00037 using std::vector;
    00038 using std::map;
    00039 using std::cout;
    00040 using std::endl;
    00041
    00042         //-----------------------------------------------
    00043         //      CONSTRUCTOR
    00044         //-----------------------------------------------
    00045
    00046 BFBSU::BFBSU(const CCAModel &cca, vector<const ObsProbRule *> & theObsProbRules, Trajectories * initialTrajectories)
    00047 : BFBSE(cca, initialTrajectories)
    00048 {
    00049         // Remove base objective function
    00050         delete objectiveFunction;
    00051
    00052         // Probability map that maps UIDs instead of just array indices
    00053         map<unsigned int, unsigned int> varUIDtoProbMap;
    00054
    00055         unsigned int nextVarPos = 0;
    00056         for(unsigned int i=0; i < decisionVariables->getLength(); i++)
    00057         {
    00058                 varUIDtoProbMap[(*decisionVariables)[i]->getUID()] = nextVarPos;
    00059                 nextVarPos += (*decisionVariables)[i]->getDomain()->getLength();
    00060         }
    00061
    00062         vector<double> emptyTransProbs;
    00063         map<unsigned int,double> emptyStateProbs;
    00064
    00065         objectiveFunction = new BSUObjectiveFunction(decisionVariables, varUIDtoProbMap,
    00066                         emptyTransProbs, emptyStateProbs, theObsProbRules);
    00067 }
    00068
    00069
    00070         //-----------------------------------------------
    00071         //      DESTRUCTOR
    00072         //-----------------------------------------------
    00073
    00074
    00075 BFBSU::~BFBSU()
    00076 {
    00077 }
    00078
    00079
    00080         //-----------------------------------------------
    00081         //      PUBLIC METHODS
    00082         //-----------------------------------------------
    00083
    00084         //-----------------------------------------------
    00085         //      PRIVATE METHODS
    00086         //-----------------------------------------------
    00087