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

# /Users/fpy/titan-1-5-MBARI/Mers/Reconfiguration/Discrete/modeReconfiguration.h

    00001 //==============================================================================
    00002 //
    00003 // Copyright (c) 2001           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 //
    00009 // Author:                      Seung H. Chung
    00010 // Organization:        Model-based Embedded and Robotic Systems Group
    00011 //                                      Massachusetts Institute of Technology
    00012 //
    00013 // modeReconfiguration class
    00014 //
    00015 //==============================================================================
    00016 #ifndef __MODE_RECONFIGURATION__
    00017 #define __MODE_RECONFIGURATION__
    00018
    00019 #ifdef _MSC_VER
    00020 #pragma warning( disable : 4786 )
    00021 #endif
    00022
    00023 #include <iostream>
    00024 #include <list>
    00025
    00026 #include <Mers/Models/CCA/CCAModel.h>
    00027
    00028 namespace Mers {
    00029         namespace Solvers {
    00030                 namespace Entailment {
    00031                         class GoalInterpreterInterface;
    00032                 }
    00033         }
    00034 }
    00035
    00036 class reactivePlanner;
    00037 class rpInterface;
    00038
    00039 class modeReconfiguration
    00040 {
    00041 public:
    00042         //--------------------------------------------------------------------------
    00043         // Type Definitions & Constants
    00044         //--------------------------------------------------------------------------
    00045
    00046         //enum rpResultType    {ACHIEVED, COMMAND, FAILED};
    00047
    00048         //--------------------------------------------------------------------------
    00049         // Constructors, Copy Constructors, & Destructors
    00050         //--------------------------------------------------------------------------
    00051
    00052         //modeReconfiguration();
    00053         modeReconfiguration(const Mers::Models::CCA::CCAModel &_model, Mers::Solvers::Entailment::GoalInterpreterInterface * giInterface);
    00054         ~modeReconfiguration();
    00055
    00056         //--------------------------------------------------------------------------
    00057         // Public Function Members
    00058         //--------------------------------------------------------------------------
    00059
    00060                 // update methods return 'false' on failure:
    00061         bool                  update_current_state(unsigned int variable_id,
    00062                                                    unsigned int value_id);
    00063         bool                  update_current_state(Mers::Utils::Lang::String variable_name,
    00064                                                    Mers::Utils::Lang::String value_name);
    00065                 // makes multiple update_current_state calls:
    00066         bool                  update_current_state(Mers::Utils::Containers::intList const * updates);
    00067         bool                  update_current_state(std::list<Mers::Utils::Lang::String> const & updates);
    00068         bool                  update_goal(unsigned int variable_id,
    00069                                           unsigned int value_id);
    00070         bool                  update_goal(Mers::Utils::Lang::String variable_name,
    00071                                           Mers::Utils::Lang::String value_name);
    00072         void                  clear_goal();
    00073                 // do *not* free this memory - it is owned by RP. It is also *not*
    00074                 // reentrant, so keep a copy around if needed.
    00075         Mers::Utils::Containers::intList const * const generate_next_command_intList_p();
    00076         std::list<Mers::Utils::Lang::String>          generate_next_command_stringlist();
    00077         Mers::Utils::Containers::intList const * const generate_reachable_states_intList_p();
    00078
    00079         void                  setDebug(bool debugState);
    00080         bool                  getDebug()  const;
    00081
    00082         void                  showVariables()  const;
    00083
    00084         //--------------------------------------------------------------------------
    00085         // Public Operators
    00086         //--------------------------------------------------------------------------
    00087
    00088         friend std::ostream & operator <<(std::ostream &_ostream,
    00089                                           modeReconfiguration const & _modeReconfiguration);
    00090
    00091 private:
    00092         //--------------------------------------------------------------------------
    00093         // Private Object Members
    00094         //--------------------------------------------------------------------------
    00095
    00096         Mers::Models::CCA::CCAModel const *               _model_p;
    00097         reactivePlanner *           _reactivePlanner;
    00098         rpInterface *               _rpInterface;
    00099         Mers::Solvers::Entailment::GoalInterpreterInterface *  goalInterpreter;
    00100
    00101         bool                        debug;
    00102
    00103         //--------------------------------------------------------------------------
    00104         // Private Function Members
    00105         //--------------------------------------------------------------------------
    00106
    00107         void                   destroy();
    00108
    00109 };
    00110
    00111 #endif
    00112