Wiselib
Public Member Functions | Public Attributes
concepts::JoinDecision_concept Class Reference

Basic Concept for Join Decision Modules. More...

List of all members.

Public Member Functions

void init ()
 Initialize module and pass pointers to the os modules.
cluster_id_t cluster_id ()
 Returns the id of the cluster that was joined.
int hops ()
 Returns the distance from the cluster head.
void reset ()
 Resets module to prepare it to run the algorithm.
MsgType get_payload ()
 Generates a new payload to be sent from the JD module.
void set_parent (node_id_t parent)
 Set the parent node in the cluster.
void set_cluster_id (cluster_id_t cluster_id)
 Set the cluster id of the node.
void set_node_type (int node_type)
 Set the type of the node that can be HEAD, SIMPLE, GATEWAY or UNCLUSTERED.
void set_hops (int hops)
 Set the hop distance form cluster head.
void clear_any_joined ()
 Set the any_joined condition to false.
void did_joined ()
 Set the any_joined condition to true.Means that at least on node joined under the selected node.
node_id_t parent ()
 Returns the id of the parent node.
int node_type ()
 Returns the type of the node inside the cluster.
bool any_joined ()
 Returns true if any nodes joined as children under the selected node.
void node_joined (node_id_t node)
 Add the node as a cluster neighbor.
void node_not_joined (node_id_t node)
 Add the node as non-cluster neighbor.
void drop_node (node_id_t node)
 Remove the node from all structs (possibly because contact was lost).
int node_count (int type)
 Return the number of known nodes inside the cluster (type=1) or outside the cluster(type=0).
void children (node_id_t *list)
 Copy to the list the ids of all cluster nodes.
void init ()
 Initialize module and pass pointers to the os modules.
void set_parameter1 (uint8_t param1)
 Pass any parameters needed by the module.
cluster_id_t cluster_id ()
 Returns the id of the cluster that was joined.
uint8_t hops ()
 Returns the distance from the cluster head.
void reset ()
 Resets module to prepare it to run the algorithm.
bool join (uint8_t *payload, uint8_t length)
 Decides based on an advertisment payload whether to join the cluster or not and returns the decision.
MsgType get_payload ()
 Generates a new payload to be sent from the JD module.

Public Attributes

typedef OsModel
typedef Radio
typedef Debug
typedef self_type
typedef node_id_t
typedef size_t
typedef block_data_t
typedef cluster_id_t

Detailed Description

Basic Concept for Join Decision Modules.

The Iterator Component (IT) is used to maintain information about the node's cluster and neighborhood. The IT is usually simple in design and similar to most algorithms with the main difference to be the existence of Simple (the NormalIterator module) or Overlapping clusters (the Overlapping Iterator module).

Finally the IT offers some payloads that can be used to inform other nodes or the cluster heads of the nodes final decision for the cluster joined.

The Join Decision Component (JD) is used to decide which cluster a node should join based on selected parameters given by the user. By examining many clustering algorithms we can identify some generic modules that use selected parameters to achieve this. Such modules can be the Bfs , the Maxmind , or the Moca where the difference is how the advertisement messages of the cluster heads are distributed throughout the network and how the modules join a cluster or not to form simple or even overlapping clusters (as it happens with the Moca Algorithm).

As some algorithms make some simple decisions to join a cluster as the cluster with the minimum id , or the cluster with the minimum power requirements for communication the generic modules can be very usefull while designing new algorithms.


Member Function Documentation

bool concepts::JoinDecision_concept::any_joined ( )

Returns true if any nodes joined as children under the selected node.

void concepts::JoinDecision_concept::children ( node_id_t list)

Copy to the list the ids of all cluster nodes.

void concepts::JoinDecision_concept::clear_any_joined ( )

Set the any_joined condition to false.

Means that no nodes joined the cluster under this node.

cluster_id_t concepts::JoinDecision_concept::cluster_id ( )

Returns the id of the cluster that was joined.

cluster_id_t concepts::JoinDecision_concept::cluster_id ( )

Returns the id of the cluster that was joined.

void concepts::JoinDecision_concept::did_joined ( )

Set the any_joined condition to true.Means that at least on node joined under the selected node.

void concepts::JoinDecision_concept::drop_node ( node_id_t  node)

Remove the node from all structs (possibly because contact was lost).

MsgType concepts::JoinDecision_concept::get_payload ( )

Generates a new payload to be sent from the JD module.

MsgType concepts::JoinDecision_concept::get_payload ( )

Generates a new payload to be sent from the JD module.

uint8_t concepts::JoinDecision_concept::hops ( )

Returns the distance from the cluster head.

int concepts::JoinDecision_concept::hops ( )

Returns the distance from the cluster head.

void concepts::JoinDecision_concept::init ( )

Initialize module and pass pointers to the os modules.

void concepts::JoinDecision_concept::init ( )

Initialize module and pass pointers to the os modules.

bool concepts::JoinDecision_concept::join ( uint8_t *  payload,
uint8_t  length 
)

Decides based on an advertisment payload whether to join the cluster or not and returns the decision.

int concepts::JoinDecision_concept::node_count ( int  type)

Return the number of known nodes inside the cluster (type=1) or outside the cluster(type=0).

void concepts::JoinDecision_concept::node_joined ( node_id_t  node)

Add the node as a cluster neighbor.

void concepts::JoinDecision_concept::node_not_joined ( node_id_t  node)

Add the node as non-cluster neighbor.

int concepts::JoinDecision_concept::node_type ( )

Returns the type of the node inside the cluster.

node_id_t concepts::JoinDecision_concept::parent ( )

Returns the id of the parent node.

void concepts::JoinDecision_concept::reset ( )

Resets module to prepare it to run the algorithm.

void concepts::JoinDecision_concept::reset ( )

Resets module to prepare it to run the algorithm.

void concepts::JoinDecision_concept::set_cluster_id ( cluster_id_t  cluster_id)

Set the cluster id of the node.

void concepts::JoinDecision_concept::set_hops ( int  hops)

Set the hop distance form cluster head.

void concepts::JoinDecision_concept::set_node_type ( int  node_type)

Set the type of the node that can be HEAD, SIMPLE, GATEWAY or UNCLUSTERED.

void concepts::JoinDecision_concept::set_parameter1 ( uint8_t  param1)

Pass any parameters needed by the module.

void concepts::JoinDecision_concept::set_parent ( node_id_t  parent)

Set the parent node in the cluster.


Member Data Documentation


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