AntHocNet 2.0.0
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
 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 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 21 of file pheromone_engine.h.

Constructor & Destructor Documentation

◆ PheromoneEngine()

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

Definition at line 23 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

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.

◆ updateVirtual()

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).

◆ 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: