|
AntHocNet 2.0.0
Paper-faithful ant-colony ad hoc routing: the shared core and its adapters
|
#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. | |
Definition at line 21 of file pheromone_engine.h.
|
inlineexplicit |
Definition at line 23 of file pheromone_engine.h.
| double anthocnet::core::PheromoneEngine::evaporate | ( | double | phValue | ) | const |
phValue - (1 - alpha) * phValue
| double anthocnet::core::PheromoneEngine::reinforce | ( | double | phValue, |
| double | phUpdate | ||
| ) | const |
gamma * phValue + (1 - gamma) * phUpdate
| 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).
| 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.
| 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).
| void anthocnet::core::PheromoneEngine::cleanNeighbor | ( | PheromoneTable & | table, |
| NodeAddress | neighbor | ||
| ) | const |
Prune a vanished neighbour from both tables.
| bool anthocnet::core::PheromoneEngine::hasRegularDestination | ( | const PheromoneTable & | table, |
| NodeAddress | dest | ||
| ) | const |
True if any neighbour still holds usable pheromone for this dest.