15#ifndef ANTHOCNET_CORE_LINK_METRIC_H
16#define ANTHOCNET_CORE_LINK_METRIC_H
37 double sinrDb = std::numeric_limits<double>::quiet_NaN();
80 return cost > 0.0 ? 1.0 / cost : 0.0;
88inline double sinrLinkCost(
double sinrDb,
double criticalDb,
double penalty) {
89 return (std::isnan(sinrDb) || sinrDb > criticalDb) ? 1.0 : penalty;
108 return cost > 0.0 ? 1.0 / cost : 0.0;
114 return e >= 1.0 ? 1.0 : 1.0 / e;
double sinrLinkCost(double sinrDb, double criticalDb, double penalty)
Eq.
AntHistoryTracker: (src, seqNum) duplicate detection.
The canonical AntHocNet metric (Eq.2): blend the path-time estimate with the hop-count estimate and i...
double pheromone(const LinkObservation &o) const override
The energy-aware metric (#145, the BeeAdHoc / EEABR line): a hop costs 1 / e, where e is the residual...
double hopCost(const HopSignals &s) const override
The cost of one of this node's own links, for a metric that usesLinkQuality(): the per-hop value a no...
bool usesLinkQuality() const override
True when the metric's per-hop cost is a link-quality cost (#181) rather than a time.
double pheromone(const LinkObservation &o) const override
What a node knows about one of its own links when a link-quality metric prices it (#181,...
double residualEnergy
IEnergy, 0..1.
double sinrDb
ILinkQuality.
double sinrCriticalDb
Config::sinrCriticalDb.
double sinrPenaltyCost
Config::sinrPenaltyCost.
double energyFloor
Config::energyCostFloor.
Maps an observation to a pheromone (goodness; higher == better).
virtual double hopCost(const HopSignals &) const
The cost of one of this node's own links, for a metric that usesLinkQuality(): the per-hop value a no...
virtual ~ILinkMetric()=default
virtual double pheromone(const LinkObservation &obs) const =0
virtual bool usesLinkQuality() const
True when the metric's per-hop cost is a link-quality cost (#181) rather than a time.
What a backward ant knows about the path from this node to the destination.
double hops
hops to the destination; fractional once smoothed (#185).
double pathTime
accumulated time estimate (seconds, item 02).
double hopTime
config T_hop (seconds).
The SINR metric (#181), the one the 2007 thesis used for every headline result: "we normally use the ...
bool usesLinkQuality() const override
True when the metric's per-hop cost is a link-quality cost (#181) rather than a time.
double pheromone(const LinkObservation &o) const override
double hopCost(const HopSignals &s) const override
The cost of one of this node's own links, for a metric that usesLinkQuality(): the per-hop value a no...