Wiselib
|
Store information about a single neighbor. More...
#include <localization_neighbor_info.h>
Public Types | |
typedef OsModel_P | OsModel |
typedef node_id_t_P | node_id_t |
typedef NodeSet_P | NodeSet |
typedef DistanceMap_P | DistanceMap |
typedef Arithmatic_P | Arithmatic |
typedef DistanceMap::iterator | NeighborIterator |
Public Member Functions | |
LocalizationNeighborInfo (const LocalizationNeighborInfo &rhs) | |
LocalizationNeighborInfo & | operator= (const LocalizationNeighborInfo &rhs) |
void | set_node (node_id_t) |
construction / destruction | |
LocalizationNeighborInfo (node_id_t, bool) | |
Constructor of new neighbor info. | |
LocalizationNeighborInfo () | |
~LocalizationNeighborInfo () | |
update/insert neighborhood | |
void | update_neighbor (node_id_t, Arithmatic) |
Update neighborhood of this neighbor. | |
void | update_neighbors (DistanceMap &) |
Update neighborhood of this neighbor. | |
reference nodes | |
void | add_ref_node (node_id_t) |
Add a reference node. | |
void | clear_ref_nodes (void) |
Clear reference nodes. | |
const NodeSet & | ref_nodes (void) const |
NodeSet & | ref_nodes_w (void) |
set data | |
void | set_pos (const Vec< Arithmatic > &) |
Set position. | |
void | clear_pos () |
Clear position. | |
void | set_hops (int) |
Set hop count. | |
void | set_distance (Arithmatic) |
Set distance. | |
void | set_confidence (Arithmatic) |
Set confidence. | |
void | set_twin (bool) |
Set twin property. | |
void | set_anchor (bool) |
Set anchor property. | |
special work on data | |
void | convert_hops (Arithmatic) |
This method converts hop count into distance by multiplying the hop count by given average hop distance. | |
get data | |
node_id_t | node (void) |
Vec< Arithmatic > & | pos (void) |
int | hops (void) |
This method returns the hop count. | |
Arithmatic | distance (void) |
Arithmatic | confidence (void) |
get special data | |
bool | is_anchor (void) |
bool | is_valid (void) |
A valid neighbor has a position and distance. | |
bool | is_twin (void) |
bool | has_pos (void) |
bool | has_distance (void) |
bool | is_confident (void) |
A confident neighbor has a position and distance. | |
neighbor information | |
DistanceMap & | neighbors (void) |
bool | has_neighbor (node_id_t) |
bool | has_neighbor_distance (node_id_t) |
Arithmatic | neighbor_distance (node_id_t) |
This method returns the distance to given neighbor. | |
iterators on neighbors | |
NeighborIterator | begin_neighbors (void) |
NeighborIterator | end_neighbors (void) |
Store information about a single neighbor.
This class stores information about a single neighbor which is again collected in LocalizationNeighborhood.
In addition to storing general information about position, hops, distance and if it is a anchor or not, there is a lot of extra data collected.
At first, there is information about confidence and twin. Confidence is used for a weighted least squares approach. A twin is defined as a node which is (or thinks it is) nearly on the same position as the neighbor itself. Both parameters are used, e.g., in LocalizationIterLaterationModule.
Moreover the data of neighborhood is collected. This means, that there is a chance to store a two-hop neighborhood.
At least there are reference nodes. These are defined as nodes neighbors get their information about anchors from, and used by LocalizationNeighborhood to decide whether a node is sound or not.
typedef Arithmatic_P wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::Arithmatic |
typedef DistanceMap_P wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::DistanceMap |
typedef DistanceMap::iterator wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::NeighborIterator |
typedef node_id_t_P wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::node_id_t |
typedef NodeSet_P wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::NodeSet |
typedef OsModel_P wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::OsModel |
wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::LocalizationNeighborInfo | ( | node_id_t | node, |
bool | is_anchor | ||
) |
Constructor of new neighbor info.
Node | Neighbor |
bool | true , if anchor. false otherwise |
wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::LocalizationNeighborInfo | ( | ) |
wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::~LocalizationNeighborInfo | ( | ) |
wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::LocalizationNeighborInfo | ( | const LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P > & | rhs | ) | [inline] |
void wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::add_ref_node | ( | node_id_t | node | ) |
NeighborIterator wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::begin_neighbors | ( | void | ) | [inline] |
void wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::clear_pos | ( | ) |
Clear position.
void wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::clear_ref_nodes | ( | void | ) |
Clear reference nodes.
LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::Arithmatic wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::confidence | ( | void | ) |
void wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::convert_hops | ( | Arithmatic | hop_dist | ) |
This method converts hop count into distance by multiplying the hop count by given average hop distance.
Arithmatic | average hop distance |
LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::Arithmatic wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::distance | ( | void | ) |
NeighborIterator wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::end_neighbors | ( | void | ) | [inline] |
bool wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::has_distance | ( | void | ) |
true
, if there is distance to this neighbor known. false
otherwise bool wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::has_neighbor | ( | node_id_t | node | ) |
Node | Node for which is searched in neighborhood |
true
, if given neighbor is part of neighborhood. false
otherwise bool wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::has_neighbor_distance | ( | node_id_t | node | ) |
Node | Node for which is searched in neighborhood |
true
, if there is distance for given neighbor known. false
otherwise bool wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::has_pos | ( | void | ) |
true
, if this neighbor has a position. false
otherwise int wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::hops | ( | void | ) |
This method returns the hop count.
If there is no hop count known, it returns localization::UNKNOWN_HOP_CNT
bool wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::is_anchor | ( | void | ) |
true
, if this neighbor is an anchor. false
otherwise bool wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::is_confident | ( | void | ) |
A confident neighbor has a position and distance.
Moreover it is not a twin and has a confidence != 0.
true
, if this neighbor is confident. false
otherwise bool wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::is_twin | ( | void | ) |
true
, if this neighbor is a twin. false
otherwise bool wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::is_valid | ( | void | ) |
A valid neighbor has a position and distance.
true
, if this neighbor is valid. false
otherwise LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::Arithmatic wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::neighbor_distance | ( | node_id_t | node | ) |
This method returns the distance to given neighbor.
If there is no distance known, method returns localization::UNKNOWN_DISTANCE.
Node | Node for which is searched in neighborhood |
DistanceMap_P & wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::neighbors | ( | void | ) |
node_id_t_P wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::node | ( | void | ) |
LocalizationNeighborInfo& wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::operator= | ( | const LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P > & | rhs | ) | [inline] |
Vec< Arithmatic_P > & wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::pos | ( | void | ) |
const NodeSet_P & wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::ref_nodes | ( | void | ) | const |
NodeSet_P & wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::ref_nodes_w | ( | void | ) |
void wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::set_anchor | ( | bool | anchor | ) |
Set anchor property.
bool | if it is anchor or not |
void wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::set_confidence | ( | Arithmatic | confidence | ) |
Set confidence.
Arithmatic | confidence |
void wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::set_distance | ( | Arithmatic | distance | ) |
Set distance.
Arithmatic | distance |
void wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::set_hops | ( | int | hops | ) |
Set hop count.
int | hop count |
void wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::set_node | ( | node_id_t | node | ) |
void wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::set_pos | ( | const Vec< Arithmatic > & | pos | ) |
Set position.
Vec | new position |
void wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::set_twin | ( | bool | twin | ) |
Set twin property.
bool | if it is twin or not |
void wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::update_neighbor | ( | node_id_t | node, |
Arithmatic | distance | ||
) |
Update neighborhood of this neighbor.
If neighbor exists, it is just updated, else inserted.
Node | neighbor to insert/update |
Arithmatic | distance to this neighbor |
void wiselib::LocalizationNeighborInfo< OsModel_P, node_id_t_P, NodeSet_P, DistanceMap_P, Arithmatic_P >::update_neighbors | ( | DistanceMap & | dm | ) |
Update neighborhood of this neighbor.
If a neighbor exists, it is just updated, else inserted.
DistanceMap | neighbors and distances to insert/update |