Wiselib
Public Types | Public Member Functions
wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P > Class Template Reference

Module implementing euclidean distance estimation. More...

#include <localization_euclidean_module.h>

Inherits wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >.

List of all members.

Public Types

enum  EuclideanCollinearCheckStd { eu_cc_std_lax, eu_cc_std_strict, eu_cc_std_none }
enum  EuclideanCollinearCheckNV { eu_cc_nv_lax, eu_cc_nv_strict, eu_cc_nv_none }
enum  EuclideanCollinearCheckCN { eu_cc_cn_lax, eu_cc_cn_strict, eu_cc_cn_none }
enum  EuclideanAlgo { eu_algo_normal, eu_algo_opt }
enum  EuclideanVote { eu_vote_nv, eu_vote_cn, eu_vote_nvcn, eu_vote_cnnv }
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 DistancePair_P DistancePair
typedef
LocalizationSumDistModule
< OsModel, Radio, Clock,
Distance, Debug, SharedData
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 SharedData::DistanceMap DistanceMap
typedef SharedData::NodeList NodeList
typedef NodeList::iterator NodeListIterator
typedef
LocalizationEuclideanInitMessage
< OsModel, Radio
EuclideanInitMessage
typedef
LocalizationEuclideanAnchorMessage
< OsModel, Radio
EuclideanAnchorMessage
typedef
LocalizationEuclideanNeighborMessage
< OsModel, Radio, DistanceMap
EuclideanNeighborMessage
typedef LocalizationStatistic
< OsModel
Statistics
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
 LocalizationEuclideanModule ()
 ~LocalizationEuclideanModule ()
standard methods startup/simulation steps
void receive (node_id_t from, size_t len, block_data_t *data)
 Handling of Euclidean-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.
SharedDatashared_data (void)
Neighborhoodneighborhood (void)
LocalCoordinateSystemlocal_coord_sys (void)

Protected Member Functions

processing euclidean messages
bool process_euclidean_init_message (node_id_t from, size_t len, block_data_t *data)
 This method processes initial messages.
void broadcast_neighborhood (void)
 This method broadcasts the neighborhood generated by the initial messages.
bool process_euclidean_neighbor_message (node_id_t from, size_t len, block_data_t *data)
 This method processes neighborhood messages.
bool process_euclidean_anchor_message (node_id_t from, size_t len, block_data_t *data)
 This method processes anchor messages.
void execute_euclidean (node_id_t anchor)
 This method tries to estimate/compute a new anchor distance.
work on neighborhood
double find_anchor_distance (node_id_t anchor)
 This method searches for two valid neighbors, that know their distance to given anchor and each other.
double find_anchor_distance_opt (node_id_t anchor)
 This method searches for two valid neighbors, that know their distance to given anchor and each other.
NodeList find_unique_neighbor_neighbors (node_id_t anchor, node_id_t n1, node_id_t n2)
 There are an anchor and two neighbors given.
NodeList find_common_neighbor_neighbors (node_id_t anchor, node_id_t n1, node_id_t n2)
 There are an anchor and two neighbors given.
NodeList find_common_neighbor_neighbors_opt (node_id_t, node_id_t, node_id_t, double &)
 There are an anchor and two neighbors given.
double neighbor_vote (node_id_t, node_id_t, node_id_t, DistancePair &, NodeList &)
 This method decides, which of given feasible solutions is the right one.
double common_neighbor (node_id_t, node_id_t, node_id_t, DistancePair &, NodeList &)
 This method decides, which of given feasible solutions is the right one.
parametrization
void set_collinear_check_std (EuclideanCollinearCheckStd check)
 Read the given parameters, which have been set via simulator commands or configuration file.
void set_collinear_check_nv (EuclideanCollinearCheckNV check)
void set_collinear_check_cn (EuclideanCollinearCheckCN check)
void set_euclidean_algo (EuclideanAlgo algo)
void set_euclidean_algo (EuclideanVote vote)

Detailed Description

template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
class wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >

Module implementing euclidean distance estimation.

This module implements euclidean distance estimation. Idea is to compute the real distances to anchors.

If unknown receives a message from two neighbors that know their distance to an anchor and each other, unknown is able to get two possible distances to the anchor via trilateration. One of these distances is right, the other is wrong. To decide, which of these distances is right, there are two different methods, named 'neighbor vote' and 'common neighbor'.

The first, 'neighbor vote', needs at least one more neighbor, that has a distance to the anchor and one of the first mentioned neighbors. Now the trilateration is done a second time, resulting again in two distances. Then you take the distances of first and second pair, which are nearest to each other.

Second method, 'common neighbor', needs one more neighbor that has a distance to the anchor and both of first mentioned neighbors. Basic geometric reasoning leads to the right solution.


Member Typedef Documentation

template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef LocalizationModule<OsModel, Radio, SharedData> wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::base_type
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef Radio::block_data_t wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::block_data_t
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef Clock_P wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::Clock
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef Debug_P wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::Debug
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef Distance_P wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::Distance
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef SharedData::DistanceMap wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::DistanceMap
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef DistancePair_P wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::DistancePair
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef LocalizationEuclideanAnchorMessage<OsModel, Radio> wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::EuclideanAnchorMessage
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef LocalizationEuclideanInitMessage<OsModel, Radio> wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::EuclideanInitMessage
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef LocalizationEuclideanNeighborMessage<OsModel, Radio, DistanceMap> wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::EuclideanNeighborMessage
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
typedef SharedData::LocalCoordinateSystem wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::LocalCoordinateSystem [inherited]
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
typedef SharedData::Neighborhood wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::Neighborhood [inherited]
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef SharedData::Neighborhood::NeighborhoodIterator wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::NeighborhoodIterator
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef Radio::node_id_t wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::node_id_t
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef SharedData::NodeList wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::NodeList
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef NodeList::iterator wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::NodeListIterator
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef OsModel_P wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::OsModel
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef Radio_P wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::Radio
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef LocalizationSumDistModule<OsModel, Radio, Clock, Distance, Debug, SharedData> wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::self_type
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef SharedData_P wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::SharedData
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef Radio::size_t wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::size_t
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef LocalizationStatistic<OsModel> wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::Statistics
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
typedef Clock_P::time_t wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::time_t

Member Enumeration Documentation

template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
enum wiselib::LocalizationEuclideanModule::EuclideanAlgo
Enumerator:
eu_algo_normal 
eu_algo_opt 
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
enum wiselib::LocalizationEuclideanModule::EuclideanCollinearCheckCN
Enumerator:
eu_cc_cn_lax 
eu_cc_cn_strict 
eu_cc_cn_none 
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
enum wiselib::LocalizationEuclideanModule::EuclideanCollinearCheckNV
Enumerator:
eu_cc_nv_lax 
eu_cc_nv_strict 
eu_cc_nv_none 
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
enum wiselib::LocalizationEuclideanModule::EuclideanCollinearCheckStd
Enumerator:
eu_cc_std_lax 
eu_cc_std_strict 
eu_cc_std_none 
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
enum wiselib::LocalizationEuclideanModule::EuclideanVote
Enumerator:
eu_vote_nv 
eu_vote_cn 
eu_vote_nvcn 
eu_vote_cnnv 

Constructor & Destructor Documentation

template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::LocalizationEuclideanModule ( )
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::~LocalizationEuclideanModule ( )

Member Function Documentation

template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
void wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::broadcast_neighborhood ( void  ) [protected]

This method broadcasts the neighborhood generated by the initial messages.

See also:
LocalizationEuclideanNeighborMessage
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
double wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::common_neighbor ( node_id_t  anchor,
node_id_t  n1,
node_id_t  n2,
DistancePair dp,
NodeList nl 
) [protected]

This method decides, which of given feasible solutions is the right one.

The solutions are a result of trilateration with distances between self, two neighbors and an anchor.

A third neighbor is taken, that has distance to both mentioned neighbors, self and anchor. Basic geometric reasoning leads to the right solution.

Parameters:
Nodegiven anchor
Nodefirst neighbor
Nodesecond neighbor
localization::DistancePairtwo feasible solutions
localization::NodeListlist of third neighbors
Returns:
Best fit distance of given DistancePair. If there is no decision, method returns -1
See also:
neighbor_vote()
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
void wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::execute_euclidean ( node_id_t  anchor) [protected]

This method tries to estimate/compute a new anchor distance.

Parameters:
Nodegiven anchor
See also:
find_anchor_distance(), find_anchor_distance_opt()
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
double wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::find_anchor_distance ( node_id_t  anchor) [protected]

This method searches for two valid neighbors, that know their distance to given anchor and each other.

If found, it tries to apply as well mentioned 'neighbor vote' as 'common neighbor'.

Per parameters you can tell, if just one or both methods are used.

If wanted solution is reached, the search ends.

Parameters:
Nodegiven anchor
See also:
find_anchor_distance_opt()
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
double wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::find_anchor_distance_opt ( node_id_t  anchor) [protected]

This method searches for two valid neighbors, that know their distance to given anchor and each other.

If found, it tries to apply as well mentioned 'neighbor vote' as 'common neighbor'.

Unlike find_anchor_distance(), it just searches a 'common neighbor' for both vote methods. Because of some problems with collinear nodes it takes the 'fewest collinear' solution.

Parameters:
Nodegiven anchor
See also:
find_anchor_distance()
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::NodeList wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::find_common_neighbor_neighbors ( node_id_t  anchor,
node_id_t  n1,
node_id_t  n2 
) [protected]

There are an anchor and two neighbors given.

This method searches for all neighbors, that are neighbors of first and second, and have a link to self and anchor.

Parameters:
Nodegiven anchor
Nodefirst neighbor
Nodesecond neighbor
Returns:
NodeList above mentioned neighbors
See also:
find_unique_neighbor_neighbors(), find_common_neighbor_neighbors_opt()
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::NodeList wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::find_common_neighbor_neighbors_opt ( node_id_t  anchor,
node_id_t  n1,
node_id_t  n2,
double &  col_measure 
) [protected]

There are an anchor and two neighbors given.

This method searches for all neighbors, that are neighbors of first and second, and have a link to self and anchor.

Because of conflicts with collinear neighbors, the result is the 'fewest collinear' neighbor pair.

Parameters:
Nodegiven anchor
Nodefirst neighbor
Nodesecond neighbor
Returns:
NodeList above mentioned neighbor
See also:
find_common_neighbor_neighbors(), find_unique_neighbor_neighbors()
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::NodeList wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::find_unique_neighbor_neighbors ( node_id_t  anchor,
node_id_t  n1,
node_id_t  n2 
) [protected]

There are an anchor and two neighbors given.

This method searches for all neighbors, that either are neighbors of first or second, and have a link to self and anchor.

Parameters:
Nodegiven anchor
Nodefirst neighbor
Nodesecond neighbor
Returns:
NodeList above mentioned neighbors
See also:
find_common_neighbor_neighbors(), find_common_neighbor_neighbors_opt()
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
bool wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::finished ( void  )
Returns:
true, if module is finished. false otherwise
See also:
LocalizationModule::finished()
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
void wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::init ( Radio radio,
Clock clock,
Debug debug,
SharedData shared_data,
Distance distance 
) [inline]
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
LocalCoordinateSystem& wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::local_coord_sys ( void  ) [inline, inherited]
Returns:
Writable shared LocalizationLocalCoordinateSystem.
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
double wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::neighbor_vote ( node_id_t  anchor,
node_id_t  n1,
node_id_t  n2,
DistancePair dp1,
NodeList nl 
) [protected]

This method decides, which of given feasible solutions is the right one.

The solutions are a result of trilateration with distances between self, two neighbors and an anchor.

The neighbor vote applies the same procedure with given third neighbors and each of both first mentioned neighbors. This results in at least two different localization::DistancePairs. Now the results are split into two parts. One with the distances, which are nearest to each other, and one with the others.
The mean of first mentioned part should be the right solution.

Moreover, there are two checks to decide, whether the solution is valid or not. At first, if the nodes are collinear, it is hard to select the right alternative, because the difference in distances in both parts is very low. These cases are filtered out by the requirement, that the standard deviation in one part must be at most 1/3rd of the standard deviation of the other part.
Second, if there is one neighbor with incorrect information, this could result in two wrong votes. This case is filtered out by the requirement, that the standard deviation of selected part is at most 5% of mean.

Parameters:
Nodegiven anchor
Nodefirst neighbor
Nodesecond neighbor
localization::DistancePairtwo feasible solutions
localization::NodeListlist of third neighbors
Returns:
Best fit distance of given DistancePair. If there is no decision or a check fails, method returns -1
See also:
common_neighbor()
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
Neighborhood& wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::neighborhood ( void  ) [inline, inherited]
Returns:
Writable shared LocalizationNeighborhood.
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
bool wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::process_euclidean_anchor_message ( node_id_t  from,
size_t  len,
block_data_t data 
) [protected]

This method processes anchor messages.

The message tells, that a neighbor got a distance to some anchor. New information is added to neighborhood and the module tries to estimate/compute distance to mentioned anchor.

See also:
LocalizationEuclideanAnchorMessage, execute_euclidean()
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
bool wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::process_euclidean_init_message ( node_id_t  from,
size_t  len,
block_data_t data 
) [protected]

This method processes initial messages.

Source of message is added to neighborhood.

See also:
LocalizationEuclideanInitMessage
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
bool wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::process_euclidean_neighbor_message ( node_id_t  from,
size_t  len,
block_data_t data 
) [protected]

This method processes neighborhood messages.

The neighbors of message source are added to neighborhood.

See also:
LocalizationEuclideanNeighborMessage
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
void wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::receive ( node_id_t  from,
size_t  len,
block_data_t data 
)

Handling of Euclidean-Messages.

See also:
LocalizationModule::process_message()
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
void wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::rollback ( void  )
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
void wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::set_collinear_check_cn ( EuclideanCollinearCheckCN  check) [inline, protected]
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
void wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::set_collinear_check_nv ( EuclideanCollinearCheckNV  check) [inline, protected]
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
void wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::set_collinear_check_std ( EuclideanCollinearCheckStd  check) [inline, protected]

Read the given parameters, which have been set via simulator commands or configuration file.

template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
void wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::set_euclidean_algo ( EuclideanAlgo  algo) [inline, protected]
template<typename OsModel_P, typename Radio_P, typename Clock_P, typename Distance_P, typename Debug_P, typename SharedData_P, typename DistancePair_P>
void wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::set_euclidean_algo ( EuclideanVote  vote) [inline, protected]
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
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.

Parameters:
LocalizationSharedDataShared data between all modules.
template<typename OsModel_P , typename Radio_P , typename SharedData_P >
SharedData& wiselib::LocalizationModule< OsModel_P, Radio_P, SharedData_P >::shared_data ( void  ) [inline, inherited]
Returns:
LocalizationSharedData shared by all modules.
writable LocalizationSharedData shared by all modules.
template<typename OsModel_P , typename Radio_P , typename Clock_P , typename Distance_P , typename Debug_P , typename SharedData_P , typename DistancePair_P >
void wiselib::LocalizationEuclideanModule< OsModel_P, Radio_P, Clock_P, Distance_P, Debug_P, SharedData_P, DistancePair_P >::work ( void  )

Check, whether state can be set to finished or not.

Moreover, send initial messages.

See also:
LocalizationModule::work()

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