DESERT 3.5.1
|
#include <uwranging_tokenbus.h>
Public Member Functions | |
UwRangingTokenBus () | |
virtual | ~UwRangingTokenBus () |
![]() | |
UwTokenBus () | |
virtual | ~UwTokenBus () |
Protected Member Functions | |
virtual bool | validToken (Packet *p) const override |
virtual void | sendToken (int next_id) override |
virtual void | Phy2MacEndRx (Packet *p) override |
virtual void | computeDist () |
virtual int | command (int argc, const char *const *argv) |
![]() | |
virtual void | expireBusIdle () |
virtual void | expireTokenPass () |
virtual void | initRing () |
virtual void | txData () |
virtual int | normId (int id) const |
virtual int | nextId (int id) const |
virtual int | nextIdOwned (int id) const |
virtual void | recvFromUpperLayers (Packet *p) override |
virtual void | Phy2MacStartRx (const Packet *p) override |
virtual void | Mac2PhyStartTx (Packet *p) |
virtual void | Phy2MacEndTx (const Packet *p) override |
virtual void | initPkt (Packet *p) |
constexpr int | NMOD (int n) |
Protected Attributes | |
const int | dist_num |
double | epsilon |
double | max_tt |
std::vector< std::vector< int > > | dist_map |
std::vector< std::vector< double > > | times_mat |
std::vector< std::vector< int > > | times_age |
std::vector< std::vector< double > > | x_mat |
std::vector< double > | distances |
double | time_last_range |
int | id_last_range |
![]() | |
int | node_id |
int | n_nodes |
int | last_token_id_heard = 0 |
int | last_token_id_owned = 0 |
double | max_token_hold_time |
double | min_token_hold_time |
double | token_rx_time |
int | max_queue_size |
std::deque< Packet * > | buffer |
UWTokenBus_STATUS | rtx_status |
bool | got_token |
double | slot_time |
double | token_pass_timeout |
double | bus_idle_timeout |
TimerTokenPass | token_pass_timer |
TimerBusIdle | bus_idle_timer |
int | count_token_resend |
int | count_token_regen |
int | count_token_invalid |
int | debug |
int | drop_old_ |
int | checkPriority |
Additional Inherited Members | |
![]() | |
enum | UWTokenBus_STATUS { IDLE , TRANSMITTING , RECEIVING } |
![]() | |
static int | count_nodes = 0 |
static int | count_token_pass_exp = 0 |
static int | count_bus_idle_exp = -1 |
Class that represents a TokenBus Node.
Definition at line 49 of file uwranging_tokenbus.h.
UwRangingTokenBus::UwRangingTokenBus | ( | ) |
Default constructor of the TokenBus class.
Definition at line 84 of file uwranging_tokenbus.cpp.
|
virtual |
Destructor of the TokenBus class.
Definition at line 141 of file uwranging_tokenbus.cpp.
|
protectedvirtual |
TCL command interpreter.
It implements the following OTcl methods:
argc | Number of arguments in argv. |
argv | Array of strings which are the command parameters (Note that argv[0] is the name of the object). |
Reimplemented from UwTokenBus.
Definition at line 392 of file uwranging_tokenbus.cpp.
|
protectedvirtual |
compute the linear regression and updates the distances vector
Definition at line 315 of file uwranging_tokenbus.cpp.
|
overrideprotectedvirtual |
Method called when the Phy Layer finish to receive a Packet.
p | pointer to a Packet object that rapresent the Packet in reception |
Reimplemented from UwTokenBus.
Definition at line 145 of file uwranging_tokenbus.cpp.
|
overrideprotectedvirtual |
Passes the token to the next node.
next_id | node receiving the token |
Reimplemented from UwTokenBus.
Definition at line 261 of file uwranging_tokenbus.cpp.
|
overrideprotectedvirtual |
Assert if the received token id is valid, i.e it follows the monotonic progression taking in account overflow.
p | Packet with token |
Reimplemented from UwTokenBus.
Definition at line 425 of file uwranging_tokenbus.cpp.
|
protected |
of size [n_nodes][n_nodes] maps(nodeX,nodeY) -> distance
Definition at line 111 of file uwranging_tokenbus.h.
|
protected |
num of distances: will be initialized to n_nodes*(n_nodes-1)/2
Definition at line 107 of file uwranging_tokenbus.h.
|
protected |
vector of shape [D], contains the one way travel times between nodes to be transformed to distances by the user according to the chosen speed of sound model
Definition at line 118 of file uwranging_tokenbus.h.
|
protected |
difference between virtually equal distances can result in small negative numbers due to floating point precision so values within epsilon will not be discarded by NNLS algo
Definition at line 109 of file uwranging_tokenbus.h.
|
protected |
node id from which I received the last ranging pkt
Definition at line 120 of file uwranging_tokenbus.h.
|
protected |
max travel time between nodes in seconds, used to discard bad nnleast_squares() results
Definition at line 110 of file uwranging_tokenbus.h.
|
protected |
time of last ping reception (or transmission)
Definition at line 119 of file uwranging_tokenbus.h.
|
protected |
vector of shape [n_nodes][n_nodes-1] holds the age of a time (slot number in which the time was calculate or received)
Definition at line 115 of file uwranging_tokenbus.h.
|
protected |
vector of shape [n_nodes][n_nodes-1] holds the travel times: the first index is the node_id which has calculated them
Definition at line 113 of file uwranging_tokenbus.h.
|
protected |
of size [2D][D] it's the sparse matrix with the equations coefficients (-1,0,1)
Definition at line 116 of file uwranging_tokenbus.h.