AntHocNet 2.6.1
Paper-faithful ant-colony ad hoc routing: the shared core and its adapters
Loading...
Searching...
No Matches
anthocnet::core Namespace Reference

Namespaces

namespace  codec
 
namespace  metrics
 

Classes

class  AntHistoryTracker
 
struct  AntHop
 One entry on an ant's visited-node stack: a node and the trip time the ant took to reach it from the previous hop. More...
 
struct  AntMessage
 Complete, copyable description of an ant packet. More...
 
class  AntRouterLogic
 
struct  ClassicMetric
 The canonical AntHocNet metric (Eq.2): blend the path-time estimate with the hop-count estimate and invert. More...
 
struct  Config
 
struct  EnergyMetric
 The energy-aware metric (#145, the BeeAdHoc / EEABR line): a hop costs 1 / e, where e is the residual energy fraction of the node that forwards over it, floored so an almost-empty node costs a large but finite amount. More...
 
class  GenerationTracker
 Multipath acceptance filter for reactive forward ants ([1] §3.1, issue #96). More...
 
struct  HelloDest
 A (destination, pheromone) advert carried by a hello ant for building the virtual pheromone table. More...
 
struct  HopSignals
 What a node knows about one of its own links when a link-quality metric prices it (#181, #145). More...
 
class  IClock
 Source of simulation time (seconds). More...
 
class  IEnergy
 This node's residual energy (#145): the fraction of its initial battery left, 0..1. More...
 
class  IKinematics
 This node's own position and velocity (#573, ADR-0025). More...
 
struct  ILinkMetric
 Maps an observation to a pheromone (goodness; higher == better). More...
 
class  ILinkQuality
 Per-neighbour link quality (#181, ADR-0024). More...
 
class  ILinkState
 Node-local MAC-layer signals for the congestion-aware per-hop metric (item 10/A2, [1] §3.2). More...
 
class  INeighborProvider
 Current set of one-hop neighbours, as seen by the link layer. More...
 
class  IRng
 Source of randomness. More...
 
class  IRouterObserver
 Optional observer the core notifies of routing events (item 15). More...
 
class  ITimerScheduler
 Deferred-execution port for periodic ant generation / table maintenance. More...
 
struct  Kinematics
 A node's position (m) and velocity (m/s) in the adapter's Cartesian frame (ADR-0025). More...
 
struct  LinkObservation
 What a backward ant knows about the path from this node to the destination. More...
 
class  PheromoneEngine
 
class  PheromoneTable
 
struct  RouteDecision
 
class  ShortestPathGraph
 
struct  SinrMetric
 The SINR metric (#181), the one the 2007 thesis used for every headline result: "we normally use the signal-to-interference-and-noise ratio metric, as this gave the best results" (§4.2.6). More...
 

Typedefs

using NodeAddress = std::int32_t
 Network-layer node address.
 
using Time = double
 Simulation time, in seconds.
 
using VisitedPath = std::vector< AntHop >
 

Enumerations

enum class  AntType : std::uint8_t {
  Hello = 0x01 , Reactive = 0x02 , Proactive = 0x04 , Repair = 0x08 ,
  LinkFail = 0x10
}
 Ant role. More...
 
enum class  AntDirection : std::uint8_t { Up = 0x11 , Down = 0x12 }
 Travel direction. More...
 
enum class  RouteAction {
  None , Unicast , Broadcast , Queue ,
  Deliver , Drop , DiscardPending
}
 

Functions

double linkExpiryTime (const Kinematics &a, const Kinematics &b, double range)
 Seconds until a and b are range metres apart, moving as they move now.
 
double linkLifetimeWeight (double let, double horizon, double floor)
 The next-hop weight for a link expected to live let seconds: 1 at or beyond horizon, falling linearly below it, never under floor (a short link is discouraged, not removed: if every link is short the choice among them is the pheromone's).
 
double sinrLinkCost (double sinrDb, double criticalDb, double penalty)
 Eq.
 

Variables

constexpr NodeAddress kInvalidAddress = -1
 "No such node / no route" sentinel, mirroring the legacy use of -1.
 

Typedef Documentation

◆ NodeAddress

using anthocnet::core::NodeAddress = typedef std::int32_t

Network-layer node address.

Matches the width of ns-2's nsaddr_t and ns-3's 32-bit IPv4 address payload.

Definition at line 21 of file types.h.

◆ Time

using anthocnet::core::Time = typedef double

Simulation time, in seconds.

Definition at line 24 of file types.h.

◆ VisitedPath

using anthocnet::core::VisitedPath = typedef std::vector<AntHop>

Definition at line 30 of file visited_path.h.

Enumeration Type Documentation

◆ AntType

enum class anthocnet::core::AntType : std::uint8_t
strong

Ant role.

Values match the legacy ANTTYPE* bit flags so existing traces remain comparable.

Enumerator
Hello 
Reactive 
Proactive 
Repair 
LinkFail 

link-failure notification (payload in helloDests).

Definition at line 25 of file ant_message.h.

◆ AntDirection

enum class anthocnet::core::AntDirection : std::uint8_t
strong

Travel direction.

Up = forward (toward destination), Down = backward (retracing the path to reinforce it).

Enumerator
Up 
Down 

Definition at line 35 of file ant_message.h.

◆ RouteAction

enum class anthocnet::core::RouteAction
strong
Enumerator
None 

Nothing to do.

Unicast 

Send message to nextHop.

Broadcast 

Link-layer broadcast message.

Queue 

Hold the data packet pending a route to nextHop/dst.

Deliver 

Destination reached: hand to the local transport.

Drop 

Discard (loop, TTL, no route).

DiscardPending 

Local repair timed out ([1] §3.5, D6): discard the data packets queued for destination nextHop.

Definition at line 21 of file route_decision.h.

Function Documentation

◆ linkExpiryTime()

double anthocnet::core::linkExpiryTime ( const Kinematics &  a,
const Kinematics &  b,
double  range 
)
inline

Seconds until a and b are range metres apart, moving as they move now.

+inf when they never separate (same velocity, or approaching for ever is impossible: a quadratic with a > 0 always has a root, so +inf means zero relative velocity inside range). 0 when they are already out of range.

Definition at line 27 of file link_lifetime.h.

References anthocnet::core::Kinematics::vx, anthocnet::core::Kinematics::vy, anthocnet::core::Kinematics::vz, anthocnet::core::Kinematics::x, anthocnet::core::Kinematics::y, and anthocnet::core::Kinematics::z.

◆ linkLifetimeWeight()

double anthocnet::core::linkLifetimeWeight ( double  let,
double  horizon,
double  floor 
)
inline

The next-hop weight for a link expected to live let seconds: 1 at or beyond horizon, falling linearly below it, never under floor (a short link is discouraged, not removed: if every link is short the choice among them is the pheromone's).

Definition at line 44 of file link_lifetime.h.

◆ sinrLinkCost()

double anthocnet::core::sinrLinkCost ( double  sinrDb,
double  criticalDb,
double  penalty 
)
inline

Eq.

4.11: 1 for a link whose SINR is above criticalDb, penalty for one at or below it. No sample (NaN) counts as a good link (ILinkQuality).

Definition at line 88 of file link_metric.h.

Referenced by anthocnet::core::SinrMetric::hopCost().

Variable Documentation

◆ kInvalidAddress

constexpr NodeAddress anthocnet::core::kInvalidAddress = -1
constexpr

"No such node / no route" sentinel, mirroring the legacy use of -1.

Definition at line 27 of file types.h.

Referenced by anthocnet::core::RouteDecision::deliver(), anthocnet::core::RouteDecision::drop(), and anthocnet::core::RouteDecision::none().