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

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# Mers::Models::CCA::CCAModel Class Reference

`#include <CCAModel.h>`

Inheritance diagram for Mers::Models::CCA::CCAModel:

[legend]
Collaboration diagram for Mers::Models::CCA::CCAModel:

[legend]
List of all members.

## Public Member Functions
| CCAModel ()
| CCAModel (Mers::Utils::Lang::String const &name)
| CCAModel (CCAModel const &other)
| ~CCAModel ()
virtual int | addVariable (Mers::Models::Base::BaseModelVariable *variable)
int | addVariable (char const *variableName, CCAVariable::VariableType variableType, CCADomain *domain)
int | addAutomaton (Mers::Utils::Lang::String const &variableName, unsigned int topologicalNumber)
int | addAutomaton (CCAVariable *variable, unsigned int topologicalNumber)
int | insert_variable (Mers::Utils::Lang::String const &variable_name, CCAVariable::VariableType type, Mers::Utils::Lang::String const &domain_name, unsigned int topological_numb=0)
void | insert_global_constraint (CCASentence const &constraint)
bool | set_state_type (Mers::Utils::Lang::String const &variable_name, Mers::Utils::Lang::String const &value_name, CCAState::StateType const state_type)
bool | set_state_constraint (Mers::Utils::Lang::String const &variable_name, Mers::Utils::Lang::String const &value_name, CCASentence const &constraint)
void | insert_transition (Mers::Utils::Lang::String const &variable_name, Mers::Utils::Lang::String const &from_value_name, Mers::Utils::Lang::String const &to_value_name, CCAClause const &gaurd, double probability=1.0)
void | insert_transition (unsigned int variableUID, unsigned int fromValueUID, unsigned int toValueUID, CCAClause const &guard, double probability=1.0)
int | addTransition (CCATransition *transition)
int | insert_domain (Mers::Utils::Lang::String const &domainName, CCAValues const &values)
Mers::Models::CCA::CCAAssignment const | get_assignment (unsigned int variableUID, unsigned int valueUID, Mers::Models::CCA::CCAAssignment::OperatorType opType=Mers::Models::CCA::CCAAssignment::Positive) const
Mers::Models::CCA::CCAAssignment const | get_assignment (Mers::Utils::Lang::String const &variable_name, Mers::Utils::Lang::String const &value_name, Mers::Models::CCA::CCAAssignment::OperatorType opType=Mers::Models::CCA::CCAAssignment::Positive) const
CCAAutomata * | get_ccAutomata_p ()
CCAAutomata const * | get_ccAutomata_p () const
CCAAutomaton const * | get_automaton_p (CCAVariable const &_variable) const
CCAAutomaton const * | get_automaton_p (unsigned int variableUID) const
CCAState const * | get_state_p (Mers::Models::CCA::CCAAssignment const &_assignment) const
CCAVariable const * | get_variable_p (Mers::Utils::Lang::String const &variable_name) const
CCAVariable const * | variable_p (Mers::Utils::Lang::String const &variable_name) const
CCAVariable const * | get_variable_p (unsigned int variableUID) const
CCAVariables * | getVariables ()
CCAVariables const * | getVariables () const
CCAVariables const * | get_variables_p () const
CCAVariables const * | variables_p () const
CCADomain const * | get_domain_p (Mers::Utils::Lang::String const &domain_name) const
CCADomain const * | domain_p (Mers::Utils::Lang::String const &domain_name) const
CCADomains * | getDomains ()
CCADomains const * | getDomains () const
CCADomains const * | get_domains_p () const
Mers::Models::CCA::CCAAssignment | assignment_ (Mers::Utils::Lang::String const &variable_name, Mers::Utils::Lang::String const &value_name, Mers::Models::CCA::CCAAssignment::OperatorType opType=Mers::Models::CCA::CCAAssignment::Positive) const
Mers::Models::CCA::CCAAssignment | assignment_ (Mers::Utils::Lang::String const &variable_name, Mers::Utils::Lang::String const &value_name, Mers::Models::CCA::CCAAssignment::OperatorType opType=Mers::Models::CCA::CCAAssignment::Positive)
CCAAutomata const * | ccAutomata_p () const
CCAAutomaton const * | automaton_p (CCAVariable const &_variable) const
CCAAutomaton const * | automaton_p (unsigned int variableUID) const
CCAState const * | state_p (Mers::Models::CCA::CCAAssignment const &_assignment) const
CCASentence * | global_constraint_p ()
CCASentence const * | global_constraint_p () const
CCASentence const | get_all_constraints () const
bool | is_valid (Mers::Models::CCA::CCAAssignment const &_assignment) const
bool | is_valid (CCAAssignments const &_assignments) const
bool | is_valid (CCAClause const &_clause) const
bool | is_valid (CCASentence const &_sentence) const
void | print (std::ostream &out) const
CCAModel const & | operator= (CCAModel const &other)
bool | operator== (CCAModel const &other) const
bool | operator!= (CCAModel const &other) const
## Protected Member Functions
virtual Mers::Models::Base::BaseModelDomainArray * | newDomainArray (Mers::Models::Base::BaseModelDomainArray const *other=NULL)
virtual Mers::Models::Base::BaseModelVariableArray * | newVariableArray (Mers::Models::Base::BaseModelVariableArray const *other=NULL)
void | destroy ()
void | copy (CCAModel const &other)
## Protected Attributes
CCASentence | _global_constraint
CCAAutomata | _ccAutomata

## Detailed Description

A container that holds all the parts of a CCA Model.

Author:
  Seung H. Chung

  Paul H. Elliott

Definition at line 47 of file CCAModel.h.

## Member Function Documentation

int CCAModel::addVariable | ( | Mers::Models::Base::BaseModelVariable * | variable | ) | `[virtual]`

Appends the variable into the model.

Parameters:

  | variable | the variable being added. This model object assumes ownership of the variable object and will delete it when it terminates so do not delete this object elsewhere. The variable should have a unique name for this model.

Returns:
  0 on success or a positive value if there was insufficient memory to complete the requested addition.

Reimplemented from Mers::Models::Base::BaseModel.

Definition at line 63 of file CCAModel.cpp.

References Mers::Models::Base::BaseModelVariable::getName(), and Mers::Models::Base::BaseModel::getVariable().

Here is the call graph for this function:

int Mers::Models::CCA::CCAModel::addVariable | ( | char const * | variableName,
|  | CCAVariable::VariableType | variableType,
|  | CCADomain * | domain |
| ) |  |  | `[inline, virtual]`

This just calls our BaseModel child. This function is only needed for compatibility.

Reimplemented from Mers::Models::Base::BaseModel.

Definition at line 76 of file CCAModel.h.

int CCAModel::addAutomaton | ( | Mers::Utils::Lang::String const & | variableName,
|  | unsigned int | topologicalNumber |
| ) |  |  |

Inserts a new Automaton with the specified topological number into this model.

Parameters:

  | variableName | the name of the state variable for which we're generating a new Automaton.
  | topologicalNumber | the topological ordering of the variable in relation to all other state variables.

Returns:
  0 on success or a positive value if there was insufficient memory to complete the requested addition.

Definition at line 77 of file CCAModel.cpp.

References Mers::Utils::Lang::String::c_str(), and Mers::Models::Base::BaseModel::getVariable().

Referenced by insert_variable().

Here is the call graph for this function:

int CCAModel::addAutomaton | ( | CCAVariable * | variable,
|  | unsigned int | topologicalNumber |
| ) |  |  |

Inserts a new Automaton with the specified topological number into this model.

Parameters:

  | variable | the state variable for which we're generating a new Automaton.
  | topologicalNumber | the topological ordering of the variable in relation to all other state variables.

Returns:
  0 on success or a positive value if there was insufficient memory to complete the requested addition.

Definition at line 91 of file CCAModel.cpp.

References _ccAutomata, Mers::Models::CCA::CCAAutomata::end(), Mers::Models::Base::BaseModelVariable::getName(), Mers::Models::Base::BaseModelVariable::getVariableType(), and Mers::Models::CCA::CCAAutomata::insert_automaton().

Here is the call graph for this function:

int CCAModel::insert_variable | ( | Mers::Utils::Lang::String const & | variable_name,
|  | CCAVariable::VariableType | type,
|  | Mers::Utils::Lang::String const & | domain_name,
|  | unsigned int | topological_numb = `0` |
| ) |  |  |

Inserts a new Variable and possibly (if it's a state variable) a new Automaton with the specified topological number into this model.

Parameters:

  | variable_name | the name of the variable we're inserting.
  | type | the variable type. An Automaton is inserted for this variable if this type is State.
  | domain_name | the name of the domain of this variable.
  | topological_numb | the topological ordering of the variable in relation to all other state variables.

Returns:
  0 on success or a positive value if there was insufficient memory to complete the requested addition.

Definition at line 109 of file CCAModel.cpp.

References addAutomaton(), Mers::Utils::Lang::String::c_str(), and Mers::Models::Base::BaseModel::getDomain().

Referenced by Mers::Models::CCA::createSimpleTechsat21Model(), and Mers::Models::CCA::createValveDriverModel().

Here is the call graph for this function:

int CCAModel::addTransition | ( | CCATransition * | transition | ) |

Inserts the specified transition into the model.

Parameters:

  | transition | the transition should be a pointer between two states in the same automaton. These should all be part of this model.

Definition at line 328 of file CCAModel.cpp.

References _ccAutomata, Mers::Models::CCA::CCATransition::automaton_p(), Mers::Models::CCA::CCATransitions::end(), Mers::Models::CCA::CCAAutomata::insert_transition(), and Mers::Models::CCA::CCAAutomaton::transitions_p().

Here is the call graph for this function:

CCAVariables * CCAModel::getVariables | ( |  | ) |

returns the internal list of variables

Returns:
  a handle to the list of variables maintained by this model

Reimplemented from Mers::Models::Base::BaseModel.

Definition at line 441 of file CCAModel.cpp.

Referenced by Mers::Estimation::Discrete::ModeEstimation::ModeEstimator::generateTrajectories(), Mers::Estimation::Discrete::ApproximateBeliefState::BFBSE::BFBSE::generateTrajectories(), get_variables_p(), Mers::Solvers::Entailment::GI::GoalInterpreter::GoalInterpreter(), Mers::Estimation::Discrete::ModeEstimation::ModeEstimator::ModeEstimator(), operator==(), Mers::Solvers::Entailment::GI::GoalInterpreter::print(), print(), Mers::Models::CCA::Io::Mof::MOFReader::saveCCAModel(), Mers::Solvers::Entailment::GI::GoalInterpreter::showVariables(), Mers::Solvers::Entailment::GI::GoalInterpreter::variableAndValueToString(), and Mers::Solvers::Entailment::GI::GoalInterpreter::variableAndValueToUID().

CCAVariables const * CCAModel::getVariables | ( |  | ) | const

returns the internal list of variables

Returns:
  a handle to the list of variables maintained by this model

Reimplemented from Mers::Models::Base::BaseModel.

Definition at line 446 of file CCAModel.cpp.

CCADomains * CCAModel::getDomains | ( |  | ) |

returns a handle to the list of domains maintained by this model.object

Returns:
  the handle to the internal list of domains maintained by this model object

Reimplemented from Mers::Models::Base::BaseModel.

Definition at line 471 of file CCAModel.cpp.

Referenced by get_domains_p(), Mers::Models::CCA::Io::Mof::MOFReader::loadMOFFromString(), operator==(), print(), and Mers::Models::CCA::Io::Mof::MOFReader::saveCCAModel().

CCADomains const * CCAModel::getDomains | ( |  | ) | const

returns a handle to the list of domains maintained by this model.object

Returns:
  the handle to the internal list of domains maintained by this model object

Reimplemented from Mers::Models::Base::BaseModel.

Definition at line 476 of file CCAModel.cpp.

void CCAModel::print | ( | std::ostream & | out | ) | const`[virtual]`

Prints out the details of this CCAModel.

Parameters:

  | out | the stream that this model should print to

Reimplemented from Mers::Models::Base::BaseModel.

Definition at line 648 of file CCAModel.cpp.

References _ccAutomata, _global_constraint, getDomains(), Mers::Models::Base::BaseModel::getName(), and getVariables().

Here is the call graph for this function:

BaseModelDomainArray * CCAModel::newDomainArray | ( | Mers::Models::Base::BaseModelDomainArray const * | other = `NULL` | ) | `[protected, virtual]`

Returns a new BaseModelDomainArray for use by this model object. Derived classes should override this function to use a different BaseModelDomainArray class. A parameter of NULL indicates that the an empty array should be created.

Parameters:

  | other | if NULL, create an empty BaseModelDomainArray, otherwise use the data in BaseModelDomainArray to create the BaseModelDomainArray.

Returns:
  the new BaseModelDomainArray

Reimplemented from Mers::Models::Base::BaseModel.

Definition at line 709 of file CCAModel.cpp.

BaseModelVariableArray * CCAModel::newVariableArray | ( | Mers::Models::Base::BaseModelVariableArray const * | other = `NULL` | ) | `[protected, virtual]`

Returns a new BaseModelVariableArray for use by this model object. Derived classes should override this function to use a different BaseModelVariableArray class. A parameter of NULL indicates that the an empty array should be created.

Parameters:

  | other | if NULL, create an empty BaseModelVariableArray, otherwise use the data in BaseModelVariableArray to create the BaseModelVariableArray.

Returns:
  the new BaseModelVariableArray

Reimplemented from Mers::Models::Base::BaseModel.

Definition at line 719 of file CCAModel.cpp.

void CCAModel::destroy | ( |  | ) | `[protected, virtual]`

Destroys the contents of this model object, freeing all allocated memory and reseting all values in preperation for a copy or delete operation. Derived classes should ensure this function is called as well

Reimplemented from Mers::Models::Base::BaseModel.

Definition at line 729 of file CCAModel.cpp.

References _ccAutomata, _global_constraint, and Mers::Utils::Containers::DynamicArray::makeEmpty().

Referenced by operator=(), and ~CCAModel().

Here is the call graph for this function:

The documentation for this class was generated from the following files:

- /Users/fpy/titan-1-5-MBARI/Mers/Models/CCA/CCAModel.h
- /Users/fpy/titan-1-5-MBARI/Mers/Models/CCA/CCAModel.cpp