Wiselib
Public Types | Public Member Functions
wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P > Class Template Reference

Two Hops Coloring Algorithm. More...

#include <two_hops_coloring.h>

List of all members.

Public Types

typedef OsModel_P OsModel
typedef Radio_P Radio
typedef Debug_P Debug
typedef OsModel_P::Timer Timer
typedef TwoHopsColoring
< OsModel, Radio, Debug
self_type
typedef Radio::node_id_t node_id_t
typedef Radio::size_t size_t
typedef Radio::block_data_t block_data_t
typedef Timer::millis_t millis_t
typedef TwoHopsMessage
< OsModel, Radio
coloring_message
typedef MapStaticVector
< OsModel, uint32_t, uint32_t, 50 > 
ColorTable
typedef MapStaticVector
< OsModel, uint32_t, uint32_t, 100 > 
ForbiddenTable
typedef ColorsTable< OsModel,
Radio
ColorsSorted
typedef wiselib::pair
< uint32_t, uint32_t
pair_t
typedef
wiselib::MapStaticVector
< OsModel, uint32_t, uint32_t, 50 >
::iterator 
ColorTable_iterator
typedef
wiselib::MapStaticVector
< OsModel, uint32_t, uint32_t, 100 >
::iterator 
ForbiddenTable_iterator

Public Member Functions

void send_special_message (uint8_t *payload, node_id_t source, uint8_t msg_id, node_id_t destination, uint8_t routing_type, uint hops, uint16_t msg_id_num)
uint32_t fm (uint32_t arr[], uint32_t b, uint32_t n)
void isort (uint32_t arr[], uint32_t n)
uint32_t get_alg_messages ()
uint32_t get_color ()
void set_color (uint32_t color_)
uint16_t active_colors_size ()
void add_neighboor (uint neighboor_id, uint color_num)
bool is_in_messages (uint node_id, uint payload)
void print_metrics ()
void get_metrics (uint8_t *buf, uint8_t pos)
void add_node_color (uint node_id, uint color_num)
uint16_t add_forbidden_color (uint32_t color)
void change_node_color (uint node_id, uint color_num)
void set_diameter (uint32_t diam)
uint32_t compare (const void *a, const void *b)
void init (Radio &radio, Timer &timer, Debug &debug)
void destruct ()
Construction / Destruction
 TwoHopsColoring ()
 ~TwoHopsColoring ()
Routing Control
void enable (void)
void disable (void)
Methods called by Timer
void timer_elapsed (void *userdata)
Methods called by RadioModel
void receive (node_id_t from, size_t len, block_data_t *data)
Method that checks satisfaction with color
uint32_t satisfied (uint32_t i)
Method that makes a greed move
void greed_move (uint32_t i)
void try_greed ()
void try_change ()
void bootstrap_message ()
 and send bootstraping message to the network
uint16_t get_neighboors ()
 the number of neighboors and who are they if debug
uint16_t get_color_nodes ()
 the number of neighboors and who are they if debug

Detailed Description

template<typename OsModel_P, typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
class wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >

Two Hops Coloring Algorithm.

A two hops coloring algorithm.


Member Typedef Documentation

template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef Radio::block_data_t wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::block_data_t
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef TwoHopsMessage<OsModel, Radio> wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::coloring_message
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef ColorsTable<OsModel, Radio> wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::ColorsSorted
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef MapStaticVector<OsModel , uint32_t, uint32_t, 50> wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::ColorTable
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef wiselib::MapStaticVector<OsModel , uint32_t, uint32_t, 50>::iterator wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::ColorTable_iterator
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef Debug_P wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::Debug
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef MapStaticVector<OsModel , uint32_t, uint32_t, 100> wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::ForbiddenTable
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef wiselib::MapStaticVector<OsModel , uint32_t, uint32_t, 100>::iterator wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::ForbiddenTable_iterator
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef Timer::millis_t wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::millis_t
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef Radio::node_id_t wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::node_id_t
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef OsModel_P wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::OsModel
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef wiselib::pair<uint32_t, uint32_t> wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::pair_t
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef Radio_P wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::Radio
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef TwoHopsColoring<OsModel, Radio, Debug> wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::self_type
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef Radio::size_t wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::size_t
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
typedef OsModel_P::Timer wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::Timer

Constructor & Destructor Documentation

template<typename OsModel_P , typename Radio_P , typename Debug_P >
wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::TwoHopsColoring ( )
template<typename OsModel_P , typename Radio_P , typename Debug_P >
wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::~TwoHopsColoring ( )

Member Function Documentation

template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
uint16_t wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::active_colors_size ( ) [inline]
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
uint16_t wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::add_forbidden_color ( uint32_t  color) [inline]
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::add_neighboor ( uint  neighboor_id,
uint  color_num 
) [inline]
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::add_node_color ( uint  node_id,
uint  color_num 
) [inline]
template<typename OsModel_P , typename Radio_P , typename Debug_P >
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::bootstrap_message ( )

and send bootstraping message to the network

template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::change_node_color ( uint  node_id,
uint  color_num 
) [inline]
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
uint32_t wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::compare ( const void *  a,
const void *  b 
) [inline]
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::destruct ( void  ) [inline]
template<typename OsModel_P , typename Radio_P , typename Debug_P >
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::disable ( void  )
template<typename OsModel_P , typename Radio_P , typename Debug_P >
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::enable ( void  )
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
uint32_t wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::fm ( uint32_t  arr[],
uint32_t  b,
uint32_t  n 
) [inline]
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
uint32_t wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::get_alg_messages ( ) [inline]
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
uint32_t wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::get_color ( ) [inline]
template<typename OsModel_P , typename Radio_P , typename Debug_P >
uint16_t wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::get_color_nodes ( )

the number of neighboors and who are they if debug

template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::get_metrics ( uint8_t buf,
uint8_t  pos 
) [inline]
template<typename OsModel_P , typename Radio_P , typename Debug_P >
uint16_t wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::get_neighboors ( )

the number of neighboors and who are they if debug

template<typename OsModel_P , typename Radio_P , typename Debug_P >
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::greed_move ( uint32_t  i)
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::init ( Radio radio,
Timer timer,
Debug debug 
) [inline]
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
bool wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::is_in_messages ( uint  node_id,
uint  payload 
) [inline]
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::isort ( uint32_t  arr[],
uint32_t  n 
) [inline]
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::print_metrics ( ) [inline]
template<typename OsModel_P , typename Radio_P , typename Debug_P >
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::receive ( node_id_t  from,
size_t  len,
block_data_t data 
)
template<typename OsModel_P , typename Radio_P , typename Debug_P >
uint32_t wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::satisfied ( uint32_t  i)
template<typename OsModel_P , typename Radio_P , typename Debug_P >
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::send_special_message ( uint8_t payload,
node_id_t  source,
uint8_t  msg_id,
node_id_t  destination,
uint8_t  routing_type,
uint  hops,
uint16_t  msg_id_num 
)
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::set_color ( uint32_t  color_) [inline]
template<typename OsModel_P , typename Radio_P = typename OsModel_P::Radio, typename Debug_P = typename OsModel_P::Debug>
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::set_diameter ( uint32_t  diam) [inline]
template<typename OsModel_P , typename Radio_P , typename Debug_P >
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::timer_elapsed ( void *  userdata)
template<typename OsModel_P , typename Radio_P , typename Debug_P >
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::try_change ( )
template<typename OsModel_P , typename Radio_P , typename Debug_P >
void wiselib::TwoHopsColoring< OsModel_P, Radio_P, Debug_P >::try_greed ( )

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