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

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

# Mers::Solvers::Entailment::GoalInterpreterInterface Class Reference

Inheritance diagram for Mers::Solvers::Entailment::GoalInterpreterInterface:

[legend]
Collaboration diagram for Mers::Solvers::Entailment::GoalInterpreterInterface:

[legend]
List of all members.

## Public Member Functions
| GoalInterpreterInterface (bool initialDebug=false)
virtual bool | updateGoal (unsigned int var, unsigned int val)=0
virtual bool | updateGoal (Mers::Utils::Lang::String var, Mers::Utils::Lang::String val)=0
virtual bool | updateCurrentState (unsigned int variable_id, unsigned int value_id)=0
virtual bool | updateCurrentState (Mers::Utils::Lang::String var, Mers::Utils::Lang::String val)=0
virtual bool | updateReachableStates (Mers::Utils::Containers::intList const *rstates)=0
virtual void | clearGoal ()=0
virtual Mers::Utils::Containers::intList const * | generateGoalState ()=0
virtual void | setDebug (bool debugState)
virtual bool | getDebug () const
virtual void | showVariables () const=0
virtual int | variableAndValueToUID (Mers::Utils::Lang::String var, Mers::Utils::Lang::String val, unsigned int &varUID, unsigned int &valUID) const =0
virtual int | variableAndValueToString (unsigned int var, unsigned int val, Mers::Utils::Lang::String &varString, Mers::Utils::Lang::String &valString) const =0
virtual void | print (std::ostream &out) const =0
## Protected Attributes
bool | debug

## Detailed Description

Definition at line 32 of file GoalInterpreterInterface.h.

## Constructor & Destructor Documentation

Mers::Solvers::Entailment::GoalInterpreterInterface::GoalInterpreterInterface | ( | bool | initialDebug = `false` | ) | `[inline]`

Intiializes a new GoalInterpreter.

Parameters:

  | initialDebug | sets the initial debug flag state. Debug mode turns on debug printing

Definition at line 45 of file GoalInterpreterInterface.h.

References debug.

## Member Function Documentation

virtual bool Mers::Solvers::Entailment::GoalInterpreterInterface::updateGoal | ( | unsigned int | var,
|  | unsigned int | val |
| ) |  |  | `[pure virtual]`

Updates GI's current goal list by adding (var = val)

Parameters:

  | var | the variable of the goal
  | val | the value of the variable of the goal

Returns:
  true if the goal was added, false if this function failed to add the goal

Implemented in Mers::Solvers::Entailment::GI::GoalInterpreter.

Referenced by modeReconfiguration::update_goal().

virtual bool Mers::Solvers::Entailment::GoalInterpreterInterface::updateGoal | ( | Mers::Utils::Lang::String | var,
|  | Mers::Utils::Lang::String | val |
| ) |  |  | `[pure virtual]`

Updates GI's current goal list by adding (var = val)

Parameters:

  | var | the variable of the goal
  | val | the value of the variable of the goal

Returns:
  true if the goal was added, false if this function failed to add the goal

Implemented in Mers::Solvers::Entailment::GI::GoalInterpreter.

virtual bool Mers::Solvers::Entailment::GoalInterpreterInterface::updateCurrentState | ( | unsigned int | variable_id,
|  | unsigned int | value_id |
| ) |  |  | `[pure virtual]`

Updates the current state with the assignment (variable_id = value_id)

Parameters:

  | variable_id | the variable whos state is being updated
  | value_id | the new value of the state

Returns:
  true if the state was updated, false if this function failed to update variable_id's state

Implemented in Mers::Solvers::Entailment::GI::GoalInterpreter.

Referenced by modeReconfiguration::update_current_state().

virtual bool Mers::Solvers::Entailment::GoalInterpreterInterface::updateCurrentState | ( | Mers::Utils::Lang::String | var,
|  | Mers::Utils::Lang::String | val |
| ) |  |  | `[pure virtual]`

Updates the current state with the assignment (var = val)

Parameters:

  | var | the variable whos state is being updated
  | val | the new value of the state

Returns:
  true if the state was updated, false if this function failed to update var's state

Implemented in Mers::Solvers::Entailment::GI::GoalInterpreter.

virtual bool Mers::Solvers::Entailment::GoalInterpreterInterface::updateReachableStates | ( | Mers::Utils::Containers::intList const * | rstates | ) | `[pure virtual]`

Sets the new set of reachable states to rstates All states listed in rstates are reachable, all states not mentioned are assumed to be unreachable

Parameters:

  | rstates | the new set of rechable states. Each state is defined by an integer pair (variableUID, valueUID) so rstates should have an even number of elements in it

Returns:
  true if the update was successfull, false if there was a problem updating the reachable states

Implemented in Mers::Solvers::Entailment::GI::GoalInterpreter.

Referenced by modeReconfiguration::generate_next_command_intList_p().

virtual void Mers::Solvers::Entailment::GoalInterpreterInterface::clearGoal | ( |  | ) | `[pure virtual]`

clears the internal list of goals so subsequent calls to updateGoal will add the goals from scratch

Implemented in Mers::Solvers::Entailment::GI::GoalInterpreter.

Referenced by modeReconfiguration::clear_goal().

virtual Mers::Utils::Containers::intList const* Mers::Solvers::Entailment::GoalInterpreterInterface::generateGoalState | ( |  | ) | `[pure virtual]`

Returns a complete set of state assignments. These state assignments are the least expensive state that entails the current goals

Returns:
  a list of UID pairs (variableUID, valueUID) that represent the set of goal-state assignments.

Implemented in Mers::Solvers::Entailment::GI::GoalInterpreter.

Referenced by modeReconfiguration::generate_next_command_intList_p().

virtual void Mers::Solvers::Entailment::GoalInterpreterInterface::setDebug | ( | bool | debugState | ) | `[inline, virtual]`

sets the debug mode of this goal interpreter to debugState

Parameters:

  | debugState | the new debug state. Set to true to turn debug printing on or false to turn it off

Reimplemented in Mers::Solvers::Entailment::GI::GoalInterpreter.

Definition at line 119 of file GoalInterpreterInterface.h.

References debug.

Referenced by modeReconfiguration::setDebug().

virtual bool Mers::Solvers::Entailment::GoalInterpreterInterface::getDebug | ( |  | ) | const`[inline, virtual]`

returns true if debug printing is on

Returns:
  true if the current debug state is on (true)

Reimplemented in Mers::Solvers::Entailment::GI::GoalInterpreter.

Definition at line 128 of file GoalInterpreterInterface.h.

References debug.

virtual void Mers::Solvers::Entailment::GoalInterpreterInterface::showVariables | ( |  | ) | const`[pure virtual]`

Prints out all of the variables in the GoalInterpreter

Implemented in Mers::Solvers::Entailment::GI::GoalInterpreter.

Referenced by modeReconfiguration::showVariables().

virtual int Mers::Solvers::Entailment::GoalInterpreterInterface::variableAndValueToUID | ( | Mers::Utils::Lang::String | var,
|  | Mers::Utils::Lang::String | val,
|  | unsigned int & | varUID,
|  | unsigned int & | valUID |
| ) |  |  | const`[pure virtual]`

converts the (var = val) string pair into the equivalent pair of integers

Parameters:

  | var | the variable name being converted
  | val | the value name being converted
  | varUID | the variable UID is returned here
  | valUID | the value UID is returned here

Returns:
  0 on success or a positive number if the variable or value could not be found

Implemented in Mers::Solvers::Entailment::GI::GoalInterpreter.

Referenced by modeReconfiguration::update_current_state().

virtual int Mers::Solvers::Entailment::GoalInterpreterInterface::variableAndValueToString | ( | unsigned int | var,
|  | unsigned int | val,
|  | Mers::Utils::Lang::String & | varString,
|  | Mers::Utils::Lang::String & | valString |
| ) |  |  | const`[pure virtual]`

converts the (var = val) integer pair into the equivalent pair of strings

Parameters:

  | var | the variable name being converted
  | val | the value name being converted
  | varString | the variable string is returned here
  | valString | the value string is returned here

Returns:
  0 on success or a positive number if the variable or value could not be found

Implemented in Mers::Solvers::Entailment::GI::GoalInterpreter.

Referenced by modeReconfiguration::generate_next_command_stringlist().

virtual void Mers::Solvers::Entailment::GoalInterpreterInterface::print | ( | std::ostream & | out | ) | const`[pure virtual]`

Prints the Goal Interpreters information to the stream Derived classes should define this function to define what is printed for the GoalInterpreter

Parameters:

  | out | the stream being printed to

Implements Mers::Utils::Lang::BaseModelObject.

Implemented in Mers::Solvers::Entailment::GI::GoalInterpreter.

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

- /Users/fpy/titan-1-5-MBARI/Mers/Solvers/Entailment/GoalInterpreterInterface.h