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

#include <anthocnet/core/pheromone_engine.h>

Public Member Functions

 PheromoneEngine (const Config &config)
 
double evaporate (double phValue) const
 phValue - (1 - alpha) * phValue
 
double reinforce (double phValue, double phUpdate) const
 gamma * phValue + (1 - gamma) * phUpdate
 
void updateRegular (PheromoneTable &table, NodeAddress dest, NodeAddress neighbor, double phUpdate) const
 Reinforce the (dest, neighbor) regular link travelled by an ant.
 
void evaporateAll (PheromoneTable &table, double dtSeconds, const std::map< NodeAddress, double > *rateMultiplier=nullptr) const
 Time-proportional aging of every regular AND virtual link by alpha^(dt/interval), pruning links below minPheromone.
 
void updateVirtual (PheromoneTable &table, const AntMessage &hello) const
 Reinforce the virtual links advertised by a hello.
 
void updateVirtual (PheromoneTable &table, const AntMessage &hello, double hopCost) const
 Same, adding hopCost (the cost of the link to the hello's sender, in the metric's units) instead of the unloaded hop time (#181).
 
void cleanNeighbor (PheromoneTable &table, NodeAddress neighbor) const
 Prune a vanished neighbour from both tables.
 
bool hasRegularDestination (const PheromoneTable &table, NodeAddress dest) const
 True if any neighbour still holds usable pheromone for this dest.
 

Detailed Description

Definition at line 23 of file pheromone_engine.h.

Constructor & Destructor Documentation

◆ PheromoneEngine()

anthocnet::core::PheromoneEngine::PheromoneEngine ( const Config &  config)
inlineexplicit

Definition at line 25 of file pheromone_engine.h.

Member Function Documentation

◆ evaporate()

double anthocnet::core::PheromoneEngine::evaporate ( double  phValue) const

phValue - (1 - alpha) * phValue

◆ reinforce()

double anthocnet::core::PheromoneEngine::reinforce ( double  phValue,
double  phUpdate 
) const

gamma * phValue + (1 - gamma) * phUpdate

◆ updateRegular()

void anthocnet::core::PheromoneEngine::updateRegular ( PheromoneTable &  table,
NodeAddress  dest,
NodeAddress  neighbor,
double  phUpdate 
) const

Reinforce the (dest, neighbor) regular link travelled by an ant.

Aging of other links is handled separately by evaporateAll (ADR-0012).

◆ evaporateAll()

void anthocnet::core::PheromoneEngine::evaporateAll ( PheromoneTable &  table,
double  dtSeconds,
const std::map< NodeAddress, double > *  rateMultiplier = nullptr 
) const

Time-proportional aging of every regular AND virtual link by alpha^(dt/interval), pruning links below minPheromone.

Driven by the maintenance tick. One clock for both tables (#262) keeps them commensurable for virtual-vs-regular comparisons. rateMultiplier (#572), when given, scales the decay per destination: a destination in the map ages as if m times the elapsed time had passed, in both tables (they must stay commensurable, #262). nullptr, or a destination absent from the map, ages exactly as before.

◆ updateVirtual() [1/2]

void anthocnet::core::PheromoneEngine::updateVirtual ( PheromoneTable &  table,
const AntMessage &  hello 
) const

Reinforce the virtual links advertised by a hello.

Aging is handled by evaporateAll, same as the regular table (#262).

◆ updateVirtual() [2/2]

void anthocnet::core::PheromoneEngine::updateVirtual ( PheromoneTable &  table,
const AntMessage &  hello,
double  hopCost 
) const

Same, adding hopCost (the cost of the link to the hello's sender, in the metric's units) instead of the unloaded hop time (#181).

◆ cleanNeighbor()

void anthocnet::core::PheromoneEngine::cleanNeighbor ( PheromoneTable &  table,
NodeAddress  neighbor 
) const

Prune a vanished neighbour from both tables.

◆ hasRegularDestination()

bool anthocnet::core::PheromoneEngine::hasRegularDestination ( const PheromoneTable &  table,
NodeAddress  dest 
) const

True if any neighbour still holds usable pheromone for this dest.


The documentation for this class was generated from the following file: