#include <Node.h>
Pages and paragraphs refer to the Prophet Internet Draft released March 2006
Definition at line 79 of file servlib/prophet/Node.h.
class | Table |
} | |
class | RIBTLV |
} | |
size_t | heap_pos () |
Accessor and mutator for heap index used by Table and testing. | |
void | set_heap_pos (size_t pos) |
} | |
void | set_pvalue (double d) |
Mutators, protected for use by friend classes only. | |
void | set_relay (bool relay) |
} | |
void | set_custody (bool custody) |
} | |
void | set_internet_gw (bool gw) |
} | |
virtual void | set_dest_id (const std::string &eid) |
} | |
void | set_age (u_int32_t age) |
} | |
void | set_params (const NodeParams *params) |
} | |
Public Member Functions | |
Node (const NodeParams *params=NULL) | |
Default constructor. | |
Node (const Node &node) | |
Copy constructor. | |
Node (const std::string &dest_id, bool relay=DEFAULT_RELAY, bool custody=DEFAULT_CUSTODY, bool internet=DEFAULT_INTERNET, const NodeParams *params=NULL) | |
Constructor. | |
virtual | ~Node () |
Destructor. | |
Node & | operator= (const Node &n) |
Assignment operator. | |
void | update_pvalue () |
Apply the direct contact algorithm, p. | |
void | update_transitive (double ab, double bc) |
Apply transitive algorithm, where ab is p_value from local to peer, bc is p_value from peer to this node, p. | |
void | update_age () |
Routes must decrease predictability with the passing of time, p. | |
double | p_value () const |
Accessors. | |
bool | relay () const |
Accessors. | |
bool | custody () const |
Accessors. | |
bool | internet_gw () const |
Accessors. | |
virtual const char * | dest_id () const |
Accessors. | |
u_int32_t | age () const |
Accessors. | |
const NodeParams * | params () const |
Accessors. | |
Static Public Attributes | |
static const bool | DEFAULT_RELAY = true |
static const bool | DEFAULT_CUSTODY = true |
static const bool | DEFAULT_INTERNET = false |
Protected Member Functions | |
u_int | time_to_units (u_int32_t diff) const |
Use NodeParams::kappa_ milliseconds per unit to convert diff to time units for use in Equation 2. | |
Protected Attributes | |
const NodeParams * | params_ |
global settings for all prophet nodes | |
double | p_value_ |
predictability value for this node | |
bool | relay_ |
whether this node acts as relay | |
bool | custody_ |
whether this node accepts custody txfr | |
bool | internet_gateway_ |
whether bridge to Internet | |
std::string | dest_id_ |
string representation of route to node | |
u_int32_t | age_ |
age in seconds of last update to p_value | |
size_t | heap_pos_ |
heap index used by Table |
prophet::Node::Node | ( | const NodeParams * | params = NULL |
) |
prophet::Node::Node | ( | const Node & | node | ) |
prophet::Node::Node | ( | const std::string & | dest_id, | |
bool | relay = DEFAULT_RELAY , |
|||
bool | custody = DEFAULT_CUSTODY , |
|||
bool | internet = DEFAULT_INTERNET , |
|||
const NodeParams * | params = NULL | |||
) |
prophet::Node::~Node | ( | ) | [virtual] |
double prophet::Node::p_value | ( | ) | const [inline] |
Accessors.
Definition at line 110 of file servlib/prophet/Node.h.
References p_value_.
Referenced by dtn::ProphetNodeList::load(), prophet::Table::p_value(), prophet::RIBTLV::serialize(), prophet::Table::truncate(), prophet::Table::update(), dtn::ProphetNodeList::update(), prophet::Table::update_route(), and prophet::Table::update_transitive().
bool prophet::Node::relay | ( | ) | const [inline] |
Accessors.
Definition at line 111 of file servlib/prophet/Node.h.
References relay_.
Referenced by dtn::ProphetNodeList::load(), and prophet::RIBTLV::serialize().
bool prophet::Node::custody | ( | ) | const [inline] |
Accessors.
Definition at line 112 of file servlib/prophet/Node.h.
References custody_.
Referenced by dtn::ProphetNodeList::load(), and prophet::RIBTLV::serialize().
bool prophet::Node::internet_gw | ( | ) | const [inline] |
Accessors.
Definition at line 113 of file servlib/prophet/Node.h.
References internet_gateway_.
Referenced by dtn::ProphetNodeList::load(), and prophet::RIBTLV::serialize().
virtual const char* prophet::Node::dest_id | ( | ) | const [inline, virtual] |
Accessors.
Definition at line 114 of file servlib/prophet/Node.h.
References dest_id_.
Referenced by dtn::ProphetStore::del(), dtn::ProphetNodeList::del(), prophet::Table::enforce_quota(), dtn::ProphetNodeList::load(), prophet::Table::truncate(), prophet::Table::update(), dtn::ProphetNodeList::update(), prophet::Table::update_route(), and prophet::Table::update_transitive().
u_int32_t prophet::Node::age | ( | ) | const [inline] |
Accessors.
Definition at line 115 of file servlib/prophet/Node.h.
References age_.
Referenced by dtn::ProphetNodeList::load().
const NodeParams* prophet::Node::params | ( | ) | const [inline] |
Assignment operator.
Definition at line 122 of file servlib/prophet/Node.h.
References age_, custody_, dest_id_, heap_pos_, internet_gateway_, p_value_, params_, and relay_.
Referenced by prophet::RIBNode::operator=().
void prophet::Node::update_pvalue | ( | ) |
Apply the direct contact algorithm, p.
9, 2.1.1, eq. 1
Definition at line 84 of file servlib/prophet/Node.cc.
References age_, prophet::NodeParams::encounter_, p_value_, and params_.
Referenced by prophet::Table::update_route().
void prophet::Node::update_transitive | ( | double | ab, | |
double | bc | |||
) |
Apply transitive algorithm, where ab is p_value from local to peer, bc is p_value from peer to this node, p.
10, 2.1.1, eq. 3
Definition at line 101 of file servlib/prophet/Node.cc.
References age_, prophet::NodeParams::beta_, prophet::NodeParams::encounter_, p_value_, and params_.
Referenced by prophet::Table::update_transitive().
void prophet::Node::update_age | ( | ) |
Routes must decrease predictability with the passing of time, p.
9, 2.1.1, eq. 2
Definition at line 122 of file servlib/prophet/Node.cc.
References age_, prophet::NodeParams::gamma_, p_value_, params_, and time_to_units().
Referenced by prophet::Table::age_nodes().
size_t prophet::Node::heap_pos | ( | ) | [inline] |
Accessor and mutator for heap index used by Table and testing.
Definition at line 154 of file servlib/prophet/Node.h.
References heap_pos_.
void prophet::Node::set_heap_pos | ( | size_t | pos | ) | [inline] |
}
Definition at line 155 of file servlib/prophet/Node.h.
References heap_pos_.
Referenced by prophet::heap_pos::operator()().
void prophet::Node::set_pvalue | ( | double | d | ) | [inline, protected] |
Mutators, protected for use by friend classes only.
Definition at line 163 of file servlib/prophet/Node.h.
References p_value_.
Referenced by prophet::RIBTLV::deserialize().
void prophet::Node::set_relay | ( | bool | relay | ) | [inline, protected] |
}
Definition at line 167 of file servlib/prophet/Node.h.
References relay_.
Referenced by prophet::RIBTLV::deserialize(), prophet::Table::update_route(), and prophet::Table::update_transitive().
void prophet::Node::set_custody | ( | bool | custody | ) | [inline, protected] |
}
Definition at line 168 of file servlib/prophet/Node.h.
References custody_.
Referenced by prophet::RIBTLV::deserialize(), prophet::Table::update_route(), and prophet::Table::update_transitive().
void prophet::Node::set_internet_gw | ( | bool | gw | ) | [inline, protected] |
}
Definition at line 169 of file servlib/prophet/Node.h.
References internet_gateway_.
Referenced by prophet::RIBTLV::deserialize(), prophet::Table::update_route(), and prophet::Table::update_transitive().
virtual void prophet::Node::set_dest_id | ( | const std::string & | eid | ) | [inline, protected, virtual] |
}
Definition at line 170 of file servlib/prophet/Node.h.
References dest_id_.
Referenced by prophet::Table::assign(), dtn::ProphetNode::serialize(), and dtn::ProphetNode::set_eid().
void prophet::Node::set_age | ( | u_int32_t | age | ) | [inline, protected] |
void prophet::Node::set_params | ( | const NodeParams * | params | ) | [inline, protected] |
}
Definition at line 175 of file servlib/prophet/Node.h.
References params_.
Referenced by prophet::Table::assign().
u_int prophet::Node::time_to_units | ( | u_int32_t | diff | ) | const [protected] |
Use NodeParams::kappa_ milliseconds per unit to convert diff to time units for use in Equation 2.
Definition at line 146 of file servlib/prophet/Node.cc.
References prophet::NodeParams::kappa_, and params_.
Referenced by update_age().
friend class Table [friend] |
friend class RIBTLV [friend] |
const bool prophet::Node::DEFAULT_RELAY = true [static] |
Definition at line 82 of file servlib/prophet/Node.h.
const bool prophet::Node::DEFAULT_CUSTODY = true [static] |
Definition at line 83 of file servlib/prophet/Node.h.
const bool prophet::Node::DEFAULT_INTERNET = false [static] |
Definition at line 84 of file servlib/prophet/Node.h.
const NodeParams* prophet::Node::params_ [protected] |
global settings for all prophet nodes
Definition at line 192 of file servlib/prophet/Node.h.
Referenced by Node(), operator=(), params(), set_params(), time_to_units(), update_age(), update_pvalue(), update_transitive(), and ~Node().
double prophet::Node::p_value_ [protected] |
predictability value for this node
Definition at line 193 of file servlib/prophet/Node.h.
Referenced by operator=(), p_value(), dtn::ProphetNode::serialize(), set_pvalue(), update_age(), update_pvalue(), and update_transitive().
bool prophet::Node::relay_ [protected] |
whether this node acts as relay
Definition at line 194 of file servlib/prophet/Node.h.
Referenced by operator=(), relay(), dtn::ProphetNode::serialize(), and set_relay().
bool prophet::Node::custody_ [protected] |
whether this node accepts custody txfr
Definition at line 195 of file servlib/prophet/Node.h.
Referenced by custody(), operator=(), dtn::ProphetNode::serialize(), and set_custody().
bool prophet::Node::internet_gateway_ [protected] |
whether bridge to Internet
Definition at line 196 of file servlib/prophet/Node.h.
Referenced by internet_gw(), operator=(), dtn::ProphetNode::serialize(), and set_internet_gw().
std::string prophet::Node::dest_id_ [protected] |
string representation of route to node
Definition at line 197 of file servlib/prophet/Node.h.
Referenced by dest_id(), prophet::Table::heap_del(), operator=(), dtn::ProphetNode::remote_eid(), dtn::ProphetNode::serialize(), and set_dest_id().
u_int32_t prophet::Node::age_ [protected] |
age in seconds of last update to p_value
Definition at line 198 of file servlib/prophet/Node.h.
Referenced by age(), Node(), operator=(), dtn::ProphetNode::serialize(), set_age(), update_age(), update_pvalue(), and update_transitive().
size_t prophet::Node::heap_pos_ [protected] |
heap index used by Table
Definition at line 199 of file servlib/prophet/Node.h.
Referenced by prophet::Table::heap_del(), heap_pos(), operator=(), and set_heap_pos().