srAlmende::SubsumptionGraph Class Reference

#include <subsumptionGraph.h>

Collaboration diagram for srAlmende::SubsumptionGraph:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Edge GetEdge (Action *pAction)
void AddAction (Action *action, Action *ref_action, positioning_t pos)
ActionGetLowerPriorityAction (Action *action)
ActionGetHighestPriorityAction (Vertex vertex)
ActionExecuteNext (Action *action)
void Execute (CtrlMsg *firstMsg)

Detailed Description

The SubsumptionGraph is built on top of Boost libraries. It is not on top of the developed in-house abbey threading library. This because function pointers do not easily transfer from C++ (member functions) to C (normal/static functions).

Definition at line 113 of file subsumptionGraph.h.


Member Function Documentation

void SubsumptionGraph::AddAction ( Action action,
Action ref_action,
positioning_t  pos 
)

An Action can be added using the position of a previously added (reference) action.

Parameters:
action 
ref_action 
pos Adds action in the form of an edge in a directed acyclic graph. The positioning is in contrast with the reference action.
action the to be inserted action in the subsumption hierarchy
ref_action positioning is done using this action as a reference
pos higher/lower after/before reference action

Definition at line 85 of file subsumptionGraph.cpp.

References GetEdge().

Referenced by srAlmende::SubsumptionAgent::Initialize().

Here is the call graph for this function:

void SubsumptionGraph::Execute ( CtrlMsg firstMsg  ) 
Parameters:
firstMsg 

Definition at line 252 of file subsumptionGraph.cpp.

References ExecuteNext(), and GetEdge().

Referenced by srAlmende::SubsumptionAgent::ProcessMessage().

Here is the call graph for this function:

Action * SubsumptionGraph::ExecuteNext ( Action action  ) 

Execute the action attached to one of the outgoing edges from the target vertex if the edge attached to the given action parameter. If this execution does result in an IDLE message, the corresponding controller is not operational and a lower priority action is executed if it exists.

Parameters:
action 

Definition at line 228 of file subsumptionGraph.cpp.

References SubController::Act(), GetEdge(), GetHighestPriorityAction(), and GetLowerPriorityAction().

Referenced by Execute().

Here is the call graph for this function:

Edge SubsumptionGraph::GetEdge ( Action pAction  ) 

Returns an edge corresponding to an action.

Parameters:
pAction 
Returns:

Returns the proper edge given an action as identifier. The action does not need to have a name or other type of identifier, a reference pointer is enough. So, the same action can be used multiple times using different instances.

Perhaps this can be better done by predicates: action_equals_t < edge_action_map_t > predicate

Parameters:
pAction 
Returns:
Actually I don't know what exactly will be returned if the action can not be found.

Definition at line 60 of file subsumptionGraph.cpp.

Referenced by AddAction(), Execute(), ExecuteNext(), and GetLowerPriorityAction().

Action * SubsumptionGraph::GetHighestPriorityAction ( Vertex  vertex  ) 

Get the highest priority action iterating through the outgoing edges of the given vertex parameter.

Parameters:
vertex 
Returns:

Definition at line 205 of file subsumptionGraph.cpp.

Referenced by ExecuteNext().

Action * SubsumptionGraph::GetLowerPriorityAction ( Action action  ) 

Gets a lower priority action.

Todo:
This is quite cumbersome implemented. Implement an out_edge_iterator that actually returns the edges in the order of their priority.
Parameters:
action 
Returns:

Definition at line 182 of file subsumptionGraph.cpp.

References GetEdge().

Referenced by ExecuteNext().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations

Generated on Thu Feb 4 16:32:07 2010 for Delta3D Plugin by  doxygen 1.6.1