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

# /Users/fpy/titan-1-5-MBARI/Mers/Solvers/SAT/GATSAT/OpSAT/OpSatFactory.cpp

    00001
    00002 //
    00003 // Copyright (c) 2004           Model-based Embedded and Robotic Systems Group
    00004 // All Rights Reserved          Massachusetts Institute of Technology
    00005 //
    00006 // This software is provided as is. Model-based Embedded and Robotic Systems
    00007 // (MERS) group does not assume any responsibility.
    00008 //
    00010
    00011 #include "OpSatFactory.h"
    00012
    00014
    00015 using namespace Mers::Solvers::SAT::GATSAT::OpSAT;
    00016 using Mers::Models::Base::BaseModelVariableArray;
    00017 using Mers::Models::Base::BaseModelSentence;
    00018 using Mers::Utils::Containers::IntegerArray;
    00019 using Mers::Utils::Exceptions::RuntimeException;
    00020 using std::vector;
    00021
    00023
    00024 Opsat * OpSatFactory::createGatsat(const BaseModelVariableArray & searchVars,
    00025         const BaseModelVariableArray & allVars, const BaseModelSentence & theory,
    00026         const IntegerArray & valueMap, const vector<double> & searchVarProbs)
    00027         const throw(RuntimeException)
    00028 {
    00029         // We should check our parameters here and throw a runtime exception
    00030         // if they're invalid.
    00031
    00032         // 1) Should check that searchVars is a subset of allVars.
    00033
    00034         // 2) Could check that all variables in theory are in allVars.
    00035
    00036         // 3) Should check that all searchVars have a valid index in the
    00037         // valueMap that indexes a valid value in the searchVarProbs.
    00038
    00039         return new Opsat(searchVars, valueMap, searchVarProbs, allVars,
    00040                 theory, true);
    00041 }
    00042
    00044