Research Article

Efficient Execution of Service Composition for Content Adaptation in Pervasive Computing

Algorithm 1

The MAGG algorithm structure.
Algorithm: graph ( )
Input: Initial state , final state , adaptation task list and adaptation operators
Output: an adaptation graph
// Global constant
// Limit   maximum number of neutral operators allowed in a connection
// Global variables
// a set of nodes in a graph
// a set of edges in a graph
// start node
// end node
// a set of neutral operators available in the system
// Local variables
// a set of adaptation tasks
// an adaptation task element of
// a set of nodes for adaptation operators realizing an adaptation task
// a set of parent nodes
// a set containing the end node
Var
Begin
= ConstructStartNode( ) // constructs the start node from the initial state
= ConstructEndNode( ) // constructs the end node from the goal state
= ConstructNeutralOperators() // returns the list of the neutral operators available in // the system
// initialization
// initialization
// initialization
for each
Begin
Construct nodes from with operators realizing
// several operators can realize a task
Connect ( )
// after the process holds the value of
End // is processed
Connect ( ) // connects the end node
Return
End // graph