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

# /Users/fpy/titan-1-5-MBARI/Mers/Models/CCA/CCATransition.h

    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 //
    00009 // Organization:        Model-based Embedded and Robotic Systems Group
    00010 //                                      Massachusetts Institute of Technology
    00011 //
    00013
    00014 #ifndef __CCATransition__
    00015 #define __CCATransition__
    00016
    00017 #ifdef _MSC_VER
    00018 #pragma warning( disable : 4786 )
    00019 #endif
    00020
    00021 #include <Mers/Utils/Lang/BaseModelObject.h>
    00022
    00023 #include "CCAClause.h"
    00024
    00025 namespace Mers {
    00026         namespace Models {
    00027                 namespace CCA {
    00028
    00029                         class CCAState;
    00030                         class CCAModel;
    00031                         class CCAAutomata;
    00032                         class CCAAutomaton;
    00033
    00039                         class CCATransition : public Mers::Utils::Lang::BaseModelObject
    00040                         {
    00041                         public:
    00043                                 // Constructors, Copy Constructors, & Destructors
    00045                                 CCATransition();
    00046                                 CCATransition(const CCAState &from_state, const CCAState &to_state,
    00047                                                                                         const CCAClause &guard, double probability = 0.0);
    00048                                 CCATransition(const CCATransition &other);
    00049                                 ~CCATransition();
    00051                                 // Public Function Members
    00053                                 const CCAAutomaton *            automaton_p()                                                           const;
    00054                                 const CCAAutomata *             ccAutomata_p()                                                          const;
    00055                                 const CCAModel *                        model_p()                                                                       const;
    00056                                 bool                                    set_from_state_p(const CCAState &_state);
    00057                                 const CCAState *                        from_state_p()                                                          const;
    00058                                 bool                                    set_to_state_p(const CCAState &_state);
    00059                                 const CCAState *                        to_state_p()                                                            const;
    00060                                 bool                                    set_guard(const CCAClause &guard);
    00061                                 const CCAClause *                       guard_p()                                                                       const;
    00062                                 double                  probability()                                                           const;
    00063
    00069                                 void setProbability(double prob) {_probability = prob;};
    00070
    00077                                 void setUID(unsigned int newUID);
    00078
    00082                                 unsigned int getUID() const;
    00083
    00084 #ifndef EMBEDDED
    00085
    00090                                 void print(std::ostream &out) const;
    00091 #endif
    00092
    00094                                 // Public Operators
    00096                                 const CCATransition &           operator =(const CCATransition &other);
    00097                                 bool                            operator ==(const CCATransition &other)         const;
    00098                                 bool                            operator !=(const CCATransition &other)         const;
    00099
    00100                         private:
    00102                                 // Private Object Members
    00104                                 const CCAState *                        _from_state_p;
    00105                                 const CCAState *                        _to_state_p;
    00106                                 CCAClause                                       _guard;
    00107                                 double                                  _probability;
    00110                                 unsigned int uid;
    00112                                 // Private Function Members
    00114                                 void                                    destroy();
    00115                                 // Needs to be fixed
    00116                                 void                                    copy(const CCATransition &other);
    00117                         };
    00118                 }
    00119         }
    00120 }
    00121
    00122 #endif