Wiselib
|
Module implementing Sum-dist. More...
#include <localization_sum_dist_module.h>
Inherits wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
Public Types | |
typedef OsModel_P | OsModel |
typedef Radio_P | Radio |
typedef Clock_P | Clock |
typedef Distance_P | Distance |
typedef Debug_P | Debug |
typedef SharedData_P | SharedData |
typedef Arithmatic_P | Arithmatic |
typedef LocalizationSumDistModule < OsModel, Radio, Clock, Distance, Debug, SharedData, Arithmatic > | self_type |
typedef LocalizationModule < OsModel, Radio, SharedData > | base_type |
typedef Radio::size_t | size_t |
typedef Radio::node_id_t | node_id_t |
typedef Radio::block_data_t | block_data_t |
typedef Clock_P::time_t | time_t |
typedef LocalizationSumDistMessage < OsModel, Radio, Arithmatic > | SumDistMessage |
typedef SharedData::Neighborhood::NeighborhoodIterator | NeighborhoodIterator |
typedef SharedData::Neighborhood | Neighborhood |
typedef SharedData::LocalCoordinateSystem | LocalCoordinateSystem |
Public Member Functions | |
void | rollback (void) |
void | init (Radio &radio, Clock &clock, Debug &debug, SharedData &shared_data, Distance &distance) |
construction / destruction | |
LocalizationSumDistModule () | |
~LocalizationSumDistModule () | |
standard methods startup/simulation steps | |
void | receive (node_id_t from, size_t len, block_data_t *data) |
Handling of Sum-dist-Messages. | |
void | work (void) |
Check, whether state can be set to finished or not. | |
module status info | |
bool | finished (void) |
basic access to owner, observer, neighborhood and local coordinate system | |
void | set_shared_data (SharedData &shared_data) |
This method sets the shared data object, which can be accessed by all available modules. | |
SharedData & | shared_data (void) |
Neighborhood & | neighborhood (void) |
LocalCoordinateSystem & | local_coord_sys (void) |
Protected Member Functions | |
message handling methods | |
bool | process_sum_dist_message (node_id_t from, size_t len, block_data_t *data) |
Message handling by unknowns such as described above. |
Module implementing Sum-dist.
This module implements Sum-dist. Distance to anchors is get by simply flooding the network beginning at the anchors. Then the unknowns adding the distance estimated each hop and broadcast this information again.
Each unknown takes the minimal distance to at most 'floodlimit' anchors, where the floodlimit is taken from the LocalizationObserver.
typedef Arithmatic_P wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::Arithmatic |
typedef LocalizationModule<OsModel, Radio, SharedData> wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::base_type |
typedef Radio::block_data_t wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::block_data_t |
Reimplemented from wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
typedef Clock_P wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::Clock |
typedef Debug_P wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::Debug |
typedef Distance_P wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::Distance |
typedef SharedData::LocalCoordinateSystem wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::LocalCoordinateSystem [inherited] |
typedef SharedData::Neighborhood wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::Neighborhood [inherited] |
Reimplemented in wiselib::LocalizationLaterationModule< OsModel_P, Radio_P, Debug_P, SharedData_P, Arithmatic_P >, wiselib::LocalizationMinMaxModule< OsModel_P, Radio_P, Debug_P, SharedData_P, Arithmatic_P >, and wiselib::LocalizationIterLaterationModule< OsModel_P, Radio_P, Distance_P, Debug_P, SharedData_P >.
typedef SharedData::Neighborhood::NeighborhoodIterator wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::NeighborhoodIterator |
typedef Radio::node_id_t wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::node_id_t |
Reimplemented from wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
typedef OsModel_P wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::OsModel |
Reimplemented from wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
typedef Radio_P wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::Radio |
Reimplemented from wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
typedef LocalizationSumDistModule<OsModel, Radio, Clock, Distance, Debug, SharedData, Arithmatic> wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::self_type |
Reimplemented from wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
typedef SharedData_P wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::SharedData |
Reimplemented from wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
typedef Radio::size_t wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::size_t |
Reimplemented from wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.
typedef LocalizationSumDistMessage<OsModel, Radio, Arithmatic> wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::SumDistMessage |
typedef Clock_P::time_t wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::time_t |
wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::LocalizationSumDistModule | ( | ) |
wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::~LocalizationSumDistModule | ( | ) |
bool wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::finished | ( | void | ) |
true
, if module is finished. false
otherwise void wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::init | ( | Radio & | radio, |
Clock & | clock, | ||
Debug & | debug, | ||
SharedData & | shared_data, | ||
Distance & | distance | ||
) | [inline] |
LocalCoordinateSystem& wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::local_coord_sys | ( | void | ) | [inline, inherited] |
Neighborhood& wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::neighborhood | ( | void | ) | [inline, inherited] |
bool wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::process_sum_dist_message | ( | node_id_t | from, |
size_t | len, | ||
block_data_t * | data | ||
) | [protected] |
Message handling by unknowns such as described above.
void wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::receive | ( | node_id_t | from, |
size_t | len, | ||
block_data_t * | data | ||
) |
Handling of Sum-dist-Messages.
void wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::rollback | ( | void | ) |
void wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::set_shared_data | ( | SharedData & | shared_data | ) | [inline, inherited] |
This method sets the shared data object, which can be accessed by all available modules.
LocalizationSharedData | Shared data between all modules. |
SharedData& wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::shared_data | ( | void | ) | [inline, inherited] |
void wiselib::LocalizationSumDistModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, Arithmatic_P >::work | ( | void | ) |
Check, whether state can be set to finished or not.
Moreover, if owner is an anchor, initial message is send.