Research Article
Context-Aware Adaptation of Component-Based Systems: An Active Repository Approach
Algorithm 1
The build stage.
| //A - list of system’s access interfaces that are not connected | | P - List of system’s provider interfaces | | C - List with the components that are in the repository | | S = solution graph empty in the beginning | | while A is not empty) do | |
{
| | a = first(A) removes the first element from A | | if (c) in P where c has provider interfaces | | that is compatible with a | | { | | connect a to its compatible interface in c | | continue | | } | | LC = {c in C where c has provider interfaces compatible with a | | = min { g(c) of LC } | | = max{ g(c) of LC } | | LCR = { all c in LC where g(c) + alpha * ( − ) } | | select a random member v in LCR | | S = S + {v} | | add the provider interfaces from v to P | | add the access interfaces from v to A | |
}
| | return S |
|