Wiselib
|
Basic Concept for Modular Clustering Algorithms. More...
Inherits concepts::BasicAlgorithm_concept.
Public Types | |
enum | NodeTypes { UNCLUSTERED, SIMPLE, HEAD, GATEWAY } |
enum | ClusterIds { UNKNOWN_CLUSTER_HEAD } |
enum | AlgorithmStatus { FORMED, FORMING, DISABLED } |
enum | CallbackEvents { CLUSTER_HEAD_CHANGED, NODE_JOINED, NODE_LEFT, CLUSTER_FORMED } |
Public Member Functions | |
int | init () |
Reset algorithm. | |
int | destruct () |
Turn off algorithm - and thus all Os facets where possible. | |
Public Attributes | |
typedef | cluster_id_t |
Defines the type of the cluster id (defined by node_id_t). |
Basic Concept for Modular Clustering Algorithms.
The modular clustering algorithm concept basically implements the basic algorithm concept (and thus provides an init() and destruct() method).
There are several kinds of clustering algorithms available. Clustering algorithms consist of 3 different sections that can easily be distinguished. The Cluster Head Decision (CHD) , the Join Decision (JD) and the Iterator (IT). All 3 sections of a clustering algorithm are implemented separately and are coordinated by a 4th module the Core Component (CC). The CHD uses some logic to decide which nodes will serve as cluster heads inside the network. The JD is responsible for deciding whether a node will join a nearby cluster or not. The IT keeps track of the cluster's status and it's neighbors. The CC is responsible for coordinating and initializing all other modules, registering the required callbacks and communicating with any other algorithms running simultaneously with the clustering algorithm.
The modular clustering algorithm concept is therefore as abstract as possible, to cover all kinds of possible algorithms. Thus, a clustering algorithm is supposed to provide some basic methods for interaction with other algorithms. Enable/disable are for starting/initializing/stopping an algorithm. It must also be possible to (un)register a callback method for event notifications.
int concepts::BasicAlgorithm_concept::destruct | ( | ) | [inherited] |
Turn off algorithm - and thus all Os facets where possible.
Do not use any Os facet functionality until init() is called.
Reimplemented in concepts::NodeDistanceEstimation_concept, concepts::Position_concept, and concepts::Routing_concept.
int concepts::BasicAlgorithm_concept::init | ( | ) | [inherited] |
Reset algorithm.
Re-init all states, turn on Os facets (if used and enable function is existent).
Reimplemented in concepts::NodeDistanceEstimation_concept, concepts::Position_concept, and concepts::Routing_concept.
Defines the type of the cluster id (defined by node_id_t).