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

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

# Mers::Executives::DeductiveController::DCInterface Class Reference

`#include <DCInterface.h>`

Inheritance diagram for Mers::Executives::DeductiveController::DCInterface:

[legend]
Collaboration diagram for Mers::Executives::DeductiveController::DCInterface:

[legend]
List of all members.

## Public Types
typedef ::Mers::Utils::Containers::SharedPointer< Task > | t_DCTaskSharedPointer
| The type of task shared pointer used for the DC.
## Public Member Functions
| DCInterface (Mers::Estimation::Discrete::ME_connection *me_connection_p, Mers::Reconfiguration::Discrete::MR_connection *mr_connection_p, Mers::Models::Base::BaseModel *model, bool initialEstimate=true)
virtual | ~DCInterface ()
void | setExecutionInterface (Mers::Interfaces::ExecutionInterfaceBase *execInterface)
void | addObservationInterface (Mers::Interfaces::ObservationInterface *obsInterface)
virtual bool | start (TaskIdentifier task)
virtual bool | stop ()
virtual bool | stop (TaskIdentifier task)
virtual int | step (bool block=true)
virtual bool | isDone ()
virtual bool | isDone (TaskIdentifier task)
virtual Mers::Utils::Lang::String | getActiveTasksString () const
virtual TaskIdentifier | createTask (const Mers::Utils::Lang::String &taskName)
| this code is only necessary to pass through commands we can't handle.
virtual t_TaskSharedPointer | getTask (TaskIdentifier task) const
virtual TaskIdentifier | createTask (const Mers::Utils::Lang::String &taskName, std::vector< const Mers::Utils::Lang::String * > const &parameters)
virtual std::set< TaskIdentifier > | getRecentlyFailedTasks ()
virtual std::set< TaskIdentifier > | getRecentlyCompletedTasks ()
virtual void | update (ObservationInterface::ValueIdentifier value)
virtual void | update (ObservationInterface::ContinuousVariableIdentifier varID, double value)
virtual DiscreteVariableIdentifier | getDiscreteVariable (const char *varName)
virtual ValueIdentifier | getValue (DiscreteVariableIdentifier varID, const char *value)
virtual bool | isValid (DiscreteVariableIdentifier varID)
virtual bool | isValid (ValueIdentifier value)
virtual ValueIdentifier | getCurrentState (DiscreteVariableIdentifier varID)
virtual double | getCurrentState (ContinuousVariableIdentifier varID)
Mers::Utils::Lang::String | getCurrentStateStr () const
virtual void | setInitialState (unsigned int state_index, unsigned int value_index)
virtual void | requestAbort ()
virtual void | requestFullState ()
int | loadInitialState (char const *initFile, Mers::Models::Base::BaseModel const *model)
virtual void | requestMR ()
## Protected Types
typedef std::pair< int, int > | t_VarValPair
typedef std::map< ObservationInterface::ValueIdentifier, t_VarValPair > | t_ValueMap
## Protected Member Functions
void | post_mode_estimate (Mers::Utils::Containers::intList const &updated_mode_estimate)
void | post_full_state (Mers::Utils::Containers::intList const &full_mode_estimate)
virtual void | post_observation (unsigned int varUID, unsigned int valUID)
virtual void | process_next_control_cmd (Mers::Utils::Containers::intList const &commands)
DiscreteValue * | getDiscreteValue (int varIndex, int valIndex)
int | getAbsoluteIndex (int varIndex, int valIndex)
| DCInterface (Mers::Models::Base::BaseModel *model)
void | init (Mers::Models::Base::BaseModel *model)
## Protected Attributes
Mers::Interfaces::ExecutionInterfaceBase * | mExecInterface
| The interface to which we issue commands.
std::map< int, TaskIdentifier > | mTasks
Mers::Utils::Containers::IntegerArray | mBaseOffset
Mers::Models::Base::BaseModel * | mModel
std::vector< DiscreteVariable * > | mDVars
| A list of all of our Discrete Variables.
std::vector< DiscreteValue * > | mDVals
| A list of all of our Discrete Values.
t_ValueMap | mValueIDMap
| A map that lets us convert ValueIdentifiers into VarValPairs.
bool | mMrFailed
std::set< t_TaskSharedPointer > | mActiveGoals
| A list of active MR goals.
std::vector< DiscreteValue * > | mCurrentState
| The current state, indexed by variable index.
Mers::Executives::DeductiveController::Rtapi::ME::ME_rtapi * | mMeRtapi
| The ME RTAPI interface for this engine interface.
Mers::Executives::DeductiveController::Rtapi::MR::MR_rtapi * | mMrRtapi
| The MR RTAPI interface for this engine interface.
bool | m_MRIdle
bool | m_MEIdle
std::set< TaskIdentifier > | m_recentlyFailedTasks
std::set< TaskIdentifier > | m_recentlyCompletedTasks

## Detailed Description

From the perspective of an external/client application, this object could be thought of as "the" (ME/MR) Deductive Controller engine.

A client application wishing to interface with the DC engine should do the following:

- Create an object that implements the DCCallback interface. DCCallback methods will be invoked asynchronously by the RTAPI thread(s) at the appropriate times.
- Instantiate a DCInterface object (ex: see swbus/titan.cpp)
  - load a model
  - create a ModeEstimator/MEInterface pair
  - create a modeReconfiguration/mrInterface pair
  - use the ME/MR interfaces and DCCallback implementation as parameters in the constructor of the DCInterface.

At runtime: Observations, goals and issued commands should be passed to the DC engine through the appropriate DCInterface methods.

Mode estimates and reconfiguration commands/suggestions will be received asynchronously via. the DCCallback methods.

Comments:

- multiple (concurrent) DC listener support would be nice...

Author:
  Seung H. Chung

Definition at line 83 of file DCInterface.h.

## Constructor & Destructor Documentation

DCInterface::DCInterface | ( | Mers::Estimation::Discrete::ME_connection * | me_connection_p,
|  | Mers::Reconfiguration::Discrete::MR_connection * | mr_connection_p,
|  | Mers::Models::Base::BaseModel * | model,
|  | bool | initialEstimate = `true` |
| ) |  |  |

Creates a new DC Interface.

Parameters:

  | me_connection_p | Interface to ME (Mode Estimation)
  | mr_connection_p | Interface to MR (Mode Reconfiguration)
  | model | The model that this interface will use to translate message from ME and MR into messages to other components.
  | initialEstimate | If true, DCI will ask ME for an initial state estimate. Otherwise, it will skip asking ME for an estimate at this point. A request for a mode estimate must be made before using this interface.

Definition at line 63 of file DCInterface.cpp.

References init(), mMeRtapi, mMrRtapi, and requestFullState().

Here is the call graph for this function:

DCInterface::~DCInterface | ( |  | ) | `[virtual]`

Destroys this object.

Definition at line 82 of file DCInterface.cpp.

References Mers::Interfaces::ExecutionInterfaceBase::deleteTask(), mDVals, mDVars, mExecInterface, mMeRtapi, mMrRtapi, and mTasks.

Here is the call graph for this function:

DCInterface::DCInterface | ( | Mers::Models::Base::BaseModel * | model | ) | `[protected]`

Creates a default DC Interface. This constructor is used for stubs.

Parameters:

  | model | The model to use to initialize this object.

Definition at line 1079 of file DCInterface.cpp.

References init().

Here is the call graph for this function:

## Member Function Documentation

void DCInterface::setExecutionInterface | ( | Mers::Interfaces::ExecutionInterfaceBase * | execInterface | ) |

Sets the ExecutionInterfaceBase that should be used by this Deductive Controller. All commands will be issued to this interface.

Parameters:

  | execInterface | The ExecutionInterfaceBase that will be called with requested commands by this interface.

Definition at line 122 of file DCInterface.cpp.

References Mers::Interfaces::ExecutionInterfaceBase::createTask(), Mers::Interfaces::ExecutionInterfaceBase::deleteTask(), getAbsoluteIndex(), Mers::Utils::Containers::DynamicArray::getLength(), Mers::Models::Base::BaseModel::getVariables(), mExecInterface, mModel, and mTasks.

Here is the call graph for this function:

void Mers::Executives::DeductiveController::DCInterface::addObservationInterface | ( | Mers::Interfaces::ObservationInterface * | obsInterface | ) |

Adds an observation interface that should be used by this Deductive Controller. Observations will be expected from this interface and this object will register for observations from obsInterface. This function should only be called once per interface.

Parameters:

  | obsInterface | The ObservationInterface that will issue observations to this object.

void DCInterface::post_mode_estimate | ( | Mers::Utils::Containers::intList const & | updated_mode_estimate | ) | `[protected, virtual]`

The ME dispatcher will call this function with the results of the last state estimate. Those states that have changed will be posted, and possibly some that have not. The data takes the form (VariableUID_0, ValueUID_0, VariableUID_1, ValueUID_1, ...).

Parameters:

  | updated_mode_estimate | The set of modes that have new values. Contains pairs of UIDs, (VariableUID = ValueUID).

Implements Mers::Executives::DeductiveController::Rtapi::RTAPICallback.

Definition at line 219 of file DCInterface.cpp.

References Mers::Utils::Containers::intList::begin(), Mers::Utils::Containers::intList::end(), getDiscreteValue(), m_MEIdle, mCurrentState, mMrRtapi, Mers::Executives::DeductiveController::Rtapi::MR::MR_rtapi::queue_state_update(), Mers::Utils::Containers::intList::size(), and Mers::Interfaces::ObservationInterface::updateListeners().

Referenced by post_full_state().

Here is the call graph for this function:

void DCInterface::post_full_state | ( | Mers::Utils::Containers::intList const & | full_mode_estimate | ) | `[protected, virtual]`

The ME dispatcher will call this function with the results of the last state estimate. The estimate for every state is included. The data takes the form (VariableUID_0, ValueUID_0, VariableUID_1, ValueUID_1, ...).

Parameters:

  | full_mode_estimate | The set of modes that have new values. Contains pairs of UIDs, (VariableUID = ValueUID).

Implements Mers::Executives::DeductiveController::Rtapi::RTAPICallback.

Definition at line 256 of file DCInterface.cpp.

References post_mode_estimate().

Here is the call graph for this function:

void DCInterface::post_observation | ( | unsigned int | varUID,
|  | unsigned int | valUID |
| ) |  |  | `[protected, virtual]`

The ME dispatcher will call this function with any observations or commands received. They represent the best know state for each observable and commandable variable.

Parameters:

  | varUID | The variable UID of the variable being updated.
  | valUID | The value UID of the value of the variable being updated.

Implements Mers::Executives::DeductiveController::Rtapi::RTAPICallback.

Definition at line 263 of file DCInterface.cpp.

References getDiscreteValue(), and Mers::Interfaces::ObservationInterface::updateListeners().

Referenced by Mers::Executives::DeductiveController::Stub::DCStub::setInitialState(), and Mers::Executives::DeductiveController::Stub::DCStub::step().

Here is the call graph for this function:

void DCInterface::process_next_control_cmd | ( | Mers::Utils::Containers::intList const & | commands | ) | `[protected, virtual]`

The MR interface dispatcher will call this function with the next control message from MR.

Implements Mers::Executives::DeductiveController::Rtapi::RTAPICallback.

Definition at line 272 of file DCInterface.cpp.

References Mers::Utils::Containers::intList::begin(), Mers::Utils::Containers::intList::end(), Mers::Utils::Containers::intList::front(), getAbsoluteIndex(), m_MEIdle, m_MRIdle, mExecInterface, mMeRtapi, mMrFailed, mTasks, Mers::Executives::DeductiveController::Rtapi::ME::ME_rtapi::queue_find_mode_estimate(), Mers::Executives::DeductiveController::Rtapi::ME::ME_rtapi::queue_start_command_and_time(), and Mers::Interfaces::ExecutionInterfaceBase::start().

Here is the call graph for this function:

bool DCInterface::start | ( | TaskIdentifier | task | ) | `[virtual]`

Starts an additional task. The task will continue until it has either completed or is told to stop. The execution status of tasks can generally be queried, so the termination of the task can be determined. This routine should generally do as little work as possible.

Parameters:

  | task | The name of the task that should be started.

Returns:
  True if the task was found and started, otherwise false. False may be returned for many reasons, including the inability of finding the task, the inability of starting the task (due to limitations in the conditions on the task, the number of times it can be run, the total number of tasks that can be run, etc), etc.

Implements Mers::Interfaces::ExecutionInterfaceBase.

Definition at line 347 of file DCInterface.cpp.

References Mers::Utils::Containers::SharedPointer< t_Object >::get(), mActiveGoals, mExecInterface, and Mers::Interfaces::ExecutionInterfaceBase::start().

Here is the call graph for this function:

bool DCInterface::stop | ( |  | ) | `[virtual]`

Stops all current activities. Every command that was started will be stopped, if possible.

Implements Mers::Interfaces::ExecutionInterfaceBase.

Definition at line 399 of file DCInterface.cpp.

References mActiveGoals, mExecInterface, and Mers::Interfaces::ExecutionInterfaceBase::stop().

Here is the call graph for this function:

bool DCInterface::stop | ( | TaskIdentifier | task | ) | `[virtual]`

Stops the task, if currently active. Has no effect if the task was already stopped or already complete.

Parameters:

  | task | The task that should be stopped. A task will be stopped if it is still running and the task can be stopped.

Returns:
  true If the task was successfully stopped or was already stopped, false if it could not be stopped.

Implements Mers::Interfaces::ExecutionInterfaceBase.

Definition at line 414 of file DCInterface.cpp.

References Mers::Utils::Containers::SharedPointer< t_Object >::get(), mActiveGoals, mExecInterface, and Mers::Interfaces::ExecutionInterfaceBase::stop().

Here is the call graph for this function:

int DCInterface::step | ( | bool | block = `true` | ) | `[virtual]`

Takes a single processing step. If block is false, then this executive will only progress if it is ready to progress. If block is true, then this executive will wait until progress can be made before returning. Generally, block should be false for reactive systems, and should be true when running this task-step process on a seperate thread.

Parameters:

  | block | If true, this procedure will always progress before returning. If false, this procedure will not block but will return an error if blocking is required to make progress.

Returns:
  the following values:
  * -1: no progress could be made w/o blocking
  * 0: successfully progressed
  * 1: execution failure
  * 2: exception (designers intent)

Implements Mers::Interfaces::ExecutionInterfaceBase.

Reimplemented in Mers::Executives::DeductiveController::Stub::DCStub.

Definition at line 446 of file DCInterface.cpp.

References Mers::Models::Base::BaseModelValue::getName(), Mers::Models::Base::BaseModelVariable::getName(), Mers::Models::Base::BaseModelValue::getUID(), Mers::Models::Base::BaseModelVariable::getUID(), Mers::Executives::DeductiveController::Task::getValue(), Mers::Executives::DeductiveController::Task::getVariable(), isDone(), m_MEIdle, m_MRIdle, m_recentlyCompletedTasks, m_recentlyFailedTasks, mActiveGoals, mExecInterface, mMrFailed, mMrRtapi, Mers::Executives::DeductiveController::Rtapi::MR::MR_rtapi::queue_goal(), Mers::Executives::DeductiveController::Rtapi::MR::MR_rtapi::queue_request_MR(), and Mers::Interfaces::ExecutionInterfaceBase::step().

Here is the call graph for this function:

bool DCInterface::isDone | ( |  | ) | `[virtual]`

Returns true if all procedures have completed.

Returns:
  true if all procedures have completed.

Implements Mers::Interfaces::ExecutionInterfaceBase.

Definition at line 521 of file DCInterface.cpp.

References Mers::Interfaces::ExecutionInterfaceBase::isDone(), mActiveGoals, and mExecInterface.

Referenced by getRecentlyCompletedTasks(), isDone(), and step().

Here is the call graph for this function:

bool DCInterface::isDone | ( | TaskIdentifier | task | ) | `[virtual]`

Returns true if a specific task has completed.

Parameters:

  | task | The task whos status is desired

Returns:
  True if a specific procedure is done, false otherwise.

Implements Mers::Interfaces::ExecutionInterfaceBase.

Definition at line 543 of file DCInterface.cpp.

References isDone(), Mers::Interfaces::ExecutionInterfaceBase::isDone(), and mExecInterface.

Here is the call graph for this function:

String DCInterface::getActiveTasksString | ( |  | ) | const`[virtual]`

Returns a string representing all of the active tasks, where each task is seperated by a return character.

Returns:
  a printable list of all active tasks, one per line.

Note that this function does nothing by default.

Reimplemented from Mers::Interfaces::ExecutionInterfaceBase.

Definition at line 598 of file DCInterface.cpp.

References Mers::Utils::Lang::String::c_str(), and mActiveGoals.

Here is the call graph for this function:

DCInterface::TaskIdentifier DCInterface::createTask | ( | const Mers::Utils::Lang::String & | taskName | ) | `[virtual]`

this code is only necessary to pass through commands we can't handle.

Creates a new Task that can be later referenced.

This function is only necessary so long as we want to pass tasks to our child execution interface that we cannot handle.

Parameters:

  | taskName | The name of the task that should be created.

Returns:
  a new TaskIdentifier of the created task, or an invalid identifier if the task could not be created. Use isValid() to verify the validity of this task.

Reimplemented from Mers::Interfaces::ExecutionInterfaceBase.

Definition at line 616 of file DCInterface.cpp.

References Mers::Interfaces::ExecutionInterfaceBase::createTask(), and mExecInterface.

Here is the call graph for this function:

ExecutionInterfaceBase::t_TaskSharedPointer DCInterface::getTask | ( | TaskIdentifier | task | ) | const`[virtual]`

Returns a Task object from an identifier, if the identifier is valid. Otherwise, returns NULL.

Parameters:

  | task | The identifier of the task being sought.

Returns:
  A handle to the task that corresponds to the task identifier.

Reimplemented from Mers::Interfaces::ExecutionInterfaceBase.

Definition at line 648 of file DCInterface.cpp.

References Mers::Interfaces::ExecutionInterfaceBase::getTask(), and mExecInterface.

Here is the call graph for this function:

virtual TaskIdentifier Mers::Executives::DeductiveController::DCInterface::createTask | ( | const Mers::Utils::Lang::String & | taskName,
|  | std::vector< const Mers::Utils::Lang::String * > const & | parameters |
| ) |  |  | `[virtual]`

Creates a new Task that can be later referenced.

This function is only necessary so long as we want to pass tasks to our child execution interface that we cannot handle.

Parameters:

  | taskName | The name of the task that should be created.
  | parameters | The parameters of this task.

Returns:
  a new TaskIdentifier of the created task, or an invalid identifier if the task could not be created. Use isValid() to verify the validity of this task.

Reimplemented from Mers::Interfaces::ExecutionInterfaceBase.

set< DCInterface::TaskIdentifier > DCInterface::getRecentlyFailedTasks | ( |  | ) | `[virtual]`

Returns:
  the set of tasks that were determined to have failed by the last call to step. Typically called when step returns with status 1 indicating that there was an execution failure

Implements Mers::Interfaces::ExecutionInterfaceBase.

Definition at line 673 of file DCInterface.cpp.

References Mers::Interfaces::ExecutionInterfaceBase::getRecentlyFailedTasks(), m_recentlyFailedTasks, and mExecInterface.

Here is the call graph for this function:

set< DCInterface::TaskIdentifier > DCInterface::getRecentlyCompletedTasks | ( |  | ) | `[virtual]`

Returns:
  the set of tasks that were determined to have completed by the last call to step.

Implements Mers::Interfaces::ExecutionInterfaceBase.

Definition at line 689 of file DCInterface.cpp.

References Mers::Interfaces::ExecutionInterfaceBase::getRecentlyCompletedTasks(), isDone(), m_recentlyCompletedTasks, and mExecInterface.

Here is the call graph for this function:

virtual void Mers::Executives::DeductiveController::DCInterface::update | ( | ObservationInterface::ValueIdentifier | value | ) | `[virtual]`

Updates all listeners that the variable associated with value has changed state such that value is the most likely state.

Parameters:

  | value | The new value of the variable.

virtual void Mers::Executives::DeductiveController::DCInterface::update | ( | ObservationInterface::ContinuousVariableIdentifier | varID,
|  | double | value |
| ) |  |  | `[virtual]`

Updates all listeners that the variable varID has changed state such that value is the most likely state.

Parameters:

  | varID | The variable who's value has changed.
  | value | The new value of the variable.

DCInterface::DiscreteVariableIdentifier DCInterface::getDiscreteVariable | ( | const char * | varName | ) | `[virtual]`

Obtains the DiscreteVariableIdentifier for the named discrete variable.

Parameters:

  | varName | The name of the descrete variable desired.

Returns:
  The variable identifier of the requested variable or an invalid variable identifier if the variable did not exist. The validity of an identifier can be checked with isValid().

Reimplemented from Mers::Interfaces::ObservationInterface.

Definition at line 744 of file DCInterface.cpp.

References mDVars.

DCInterface::ValueIdentifier DCInterface::getValue | ( | DiscreteVariableIdentifier | varID,
|  | const char * | value |
| ) |  |  | `[virtual]`

Returns the value identifier requested from the specified variable identifier, if it exists.

Parameters:

  | varID | The DiscreteVariableIdentifier of the variable for which we wish to obtain the named value.
  | value | The name of the value we wish to look up.

Returns:
  The value identifier of the requested value associated with the specified variable or an invalid value of the variable contained no such named value. The validity of an identifier can be checked with isValid();

Reimplemented from Mers::Interfaces::ObservationInterface.

Definition at line 760 of file DCInterface.cpp.

References Mers::Models::Base::BaseModelVariable::getDomain(), Mers::Models::Base::BaseModelVariable::getUID(), Mers::Executives::DeductiveController::DiscreteVariable::getVariable(), mBaseOffset, mDVals, and Mers::Utils::Containers::DynamicArray::size().

Here is the call graph for this function:

bool DCInterface::isValid | ( | DiscreteVariableIdentifier | varID | ) | `[virtual]`

Returns true if this is a valid variable.

Parameters:

  | varID | The variable identifier that is being verified.

Returns:
  True if the VariableIdentifier reflects a valid variable.

Reimplemented from Mers::Interfaces::ObservationInterface.

Definition at line 786 of file DCInterface.cpp.

bool DCInterface::isValid | ( | ValueIdentifier | value | ) | `[virtual]`

Returns true if this is a valid value.

Parameters:

  | value | The value identifier that is being verified.

Returns:
  True if the ValueIdentifier reflects a valid task.

Reimplemented from Mers::Interfaces::ObservationInterface.

Definition at line 794 of file DCInterface.cpp.

DCInterface::ValueIdentifier DCInterface::getCurrentState | ( | DiscreteVariableIdentifier | varID | ) | `[virtual]`

Returns the most likely state of the specified variable. Note that it is guaranteed that this ValueIdentifier will be equal using == to another ValueIdentifier if and only if the states are the same.

Parameters:

  | varID | The identifier of the variable.

Returns:
  The ValueIdentifier of the most likely state.

Implements Mers::Interfaces::ObservationInterface.

Definition at line 802 of file DCInterface.cpp.

References Mers::Models::Base::BaseModelVariable::getUID(), Mers::Executives::DeductiveController::DiscreteVariable::getVariable(), and mCurrentState.

Here is the call graph for this function:

double DCInterface::getCurrentState | ( | ContinuousVariableIdentifier | varID | ) | `[virtual]`

Returns the most likely state of the specified variable. Note that it is guaranteed that this ValueIdentifier will be equal using == to another ValueIdentifier if and only if the states are the same.

Parameters:

  | varID | The identifier of the variable.

Returns:
  The ValueIdentifier of the most likely state.

Implements Mers::Interfaces::ObservationInterface.

Definition at line 811 of file DCInterface.cpp.

Mers::Utils::Lang::String DCInterface::getCurrentStateStr | ( |  | ) | const

Returns the current state of all variables in a string format. This is really intended only for debugging...

Definition at line 824 of file DCInterface.cpp.

References Mers::Utils::Lang::String::append(), mCurrentState, and mDVars.

Here is the call graph for this function:

void DCInterface::setInitialState | ( | unsigned int | state_index,
|  | unsigned int | value_index |
| ) |  |  | `[virtual]`

Adds monitor state value to the message queue for assignment. This method does NOT use RTAPI timers.

Parameters:

  | state_index | The index of the state variable
  | value_index | The index of the state's new value

Reimplemented in Mers::Executives::DeductiveController::Stub::DCStub.

Definition at line 853 of file DCInterface.cpp.

References mMeRtapi, and Mers::Executives::DeductiveController::Rtapi::ME::ME_rtapi::queue_initial_state().

Referenced by loadInitialState().

Here is the call graph for this function:

void DCInterface::requestAbort | ( |  | ) | `[virtual]`

Terminates estimation as soon as it has finished with its current work.

Reimplemented in Mers::Executives::DeductiveController::Stub::DCStub.

Definition at line 861 of file DCInterface.cpp.

References mMeRtapi, and Mers::Executives::DeductiveController::Rtapi::ME::ME_rtapi::queue_abort_command().

Here is the call graph for this function:

void DCInterface::requestFullState | ( |  | ) | `[virtual]`

This method can be used to request the transmission of a full state estimate. This is different from the default "partial" state estimate produced, which only shows items that have changed since the previous timestep. These updates are sent to any listeners when they are available.

Reimplemented in Mers::Executives::DeductiveController::Stub::DCStub.

Definition at line 868 of file DCInterface.cpp.

References m_MEIdle, mMeRtapi, and Mers::Executives::DeductiveController::Rtapi::ME::ME_rtapi::queue_report_full_state().

Referenced by DCInterface(), and loadInitialState().

Here is the call graph for this function:

int DCInterface::loadInitialState | ( | char const * | initFile,
|  | Mers::Models::Base::BaseModel const * | model |
| ) |  |  |

Load the state initialization file and set each variable to the specified value.

Parameters:

  | initFile | The initialization file name that will be loaded.

Takes the format: <variable name>=""> =

Parameters:

  | model | handle to the model used to translate the initFile to an integer list.

Definition at line 876 of file DCInterface.cpp.

References Mers::Models::Base::BaseModel::getAssignment(), Mers::Models::Base::BaseModelValue::getUID(), Mers::Models::Base::BaseModelVariable::getUID(), Mers::Models::Base::BaseModelAssignment::getValue(), Mers::Models::Base::BaseModelAssignment::getVariable(), requestFullState(), and setInitialState().

Here is the call graph for this function:

void DCInterface::requestMR | ( |  | ) | `[virtual]`

This method must be called once the goal state has been completely specified, and the client wishes to receive the next command that should be issued to the plant.

This method is needed as MR cannot determine how many goals need to be queued to define the full goal state.

On the other hand, if there were a method that took an array of goals (i.e. a goal state), this method would be unnecessary?

Reimplemented in Mers::Executives::DeductiveController::Stub::DCStub.

Definition at line 1056 of file DCInterface.cpp.

References mMrRtapi, and Mers::Executives::DeductiveController::Rtapi::MR::MR_rtapi::queue_request_MR().

Here is the call graph for this function:

DiscreteValue * DCInterface::getDiscreteValue | ( | int | varIndex,
|  | int | valIndex |
| ) |  |  | `[protected]`

Retrieves a DiscreteValue based on a pair of indices.

Parameters:

  | varIndex | The index of the variable.
  | valIndex | The index of the value associated with the variable.

Returns:
  The corresponding DiscreteValue, given the pairs.

Definition at line 1065 of file DCInterface.cpp.

References getAbsoluteIndex(), and mDVals.

Referenced by post_mode_estimate(), and post_observation().

Here is the call graph for this function:

int DCInterface::getAbsoluteIndex | ( | int | varIndex,
|  | int | valIndex |
| ) |  |  | `[protected]`

Returns the absolute index of the variable/value pair of indices.

Parameters:

  | varIndex | The index of the variable.
  | valIndex | The index of the value associated with the variable.

Definition at line 1072 of file DCInterface.cpp.

References mBaseOffset.

Referenced by getDiscreteValue(), process_next_control_cmd(), and setExecutionInterface().

void DCInterface::init | ( | Mers::Models::Base::BaseModel * | model | ) | `[protected]`

Initializes the Interface with the model.

Parameters:

  | model | The model to use to initialize this object.

Definition at line 1091 of file DCInterface.cpp.

References Mers::Utils::Containers::DynamicArray::getLength(), Mers::Models::Base::BaseModel::getVariables(), mBaseOffset, mCurrentState, mDVals, mDVars, Mers::Utils::Containers::IntegerArray::pushBack(), and Mers::Interfaces::ExecutionInterfaceBase::setTaskFactory().

Referenced by DCInterface().

Here is the call graph for this function:

## Member Data Documentation

std::map<int, TaskIdentifier> Mers::Executives::DeductiveController::DCInterface::mTasks`[protected]`

This object maps our desired command index to a Task for the execution interface below us.

Reimplemented from Mers::Interfaces::ExecutionInterfaceBase.

Definition at line 546 of file DCInterface.h.

Referenced by process_next_control_cmd(), setExecutionInterface(), and ~DCInterface().

Mers::Utils::Containers::IntegerArray Mers::Executives::DeductiveController::DCInterface::mBaseOffset`[protected]`

This class is used to map a variable index to an offset which is the base for values. Thus, the absolute index i = mBaseOffset[variableIndex] + valueIndex

Definition at line 551 of file DCInterface.h.

Referenced by getAbsoluteIndex(), getValue(), and init().

Mers::Models::Base::BaseModel* Mers::Executives::DeductiveController::DCInterface::mModel`[protected]`

A handle to the model we use to translate indices into names. This should be the same model used by ME and MR.

Definition at line 555 of file DCInterface.h.

Referenced by setExecutionInterface().

bool Mers::Executives::DeductiveController::DCInterface::mMrFailed`[protected]`

A boolean value that is true when MR has recently indicated failure.

Definition at line 568 of file DCInterface.h.

Referenced by process_next_control_cmd(), and step().

bool Mers::Executives::DeductiveController::DCInterface::m_MRIdle`[protected]`

This flag is true when MR is idle. An idle MR can be sent a new set of goals.

Definition at line 586 of file DCInterface.h.

Referenced by process_next_control_cmd(), and step().

bool Mers::Executives::DeductiveController::DCInterface::m_MEIdle`[protected]`

This flag is true when ME is idle. ME is idle when it has responded to an MR Command.

Definition at line 590 of file DCInterface.h.

Referenced by post_mode_estimate(), process_next_control_cmd(), requestFullState(), and step().

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

- /Users/fpy/titan-1-5-MBARI/Mers/Executives/DeductiveController/DCInterface.h
- /Users/fpy/titan-1-5-MBARI/Mers/Executives/DeductiveController/DCInterface.cpp