|
AntHocNet 2.0.0
Paper-faithful ant-colony ad hoc routing: the shared core and its adapters
|
One AntHocNet node: the core logic plus the adapter state around it. More...
#include <ahn_web/sim.h>
Public Member Functions | |
| Node (World &w, int id, std::uint64_t seed) | |
Created by World::addNode(); seed derives the node's streams. | |
| anthocnet::core::Time | now () const override |
| IClock: the world's simulated time. | |
| double | uniform () override |
| IRng: this node's own stream (independent of every other node's). | |
| int | uniformInt (int n) override |
| IRng: uniform integer in [0, n). | |
| void | onRouteChanged (NodeAddress dest, NodeAddress nb, bool added) override |
| IRouterObserver: report-only – route changes feed the event log. | |
| int | id () const |
| This node's address (its index in the World). | |
| anthocnet::core::AntRouterLogic & | logic () |
| The core state machine (valid after World::start()). | |
| const anthocnet::core::AntRouterLogic & | logic () const |
| The core state machine, read-only (inspection). | |
Public Member Functions inherited from anthocnet::core::IClock | |
| virtual | ~IClock ()=default |
Public Member Functions inherited from anthocnet::core::IRng | |
| virtual | ~IRng ()=default |
Public Member Functions inherited from anthocnet::core::IRouterObserver | |
| virtual | ~IRouterObserver ()=default |
| virtual void | onAntSent (AntType, AntDirection, bool) |
| This node put an ant on the medium (origination or forwarding). | |
| virtual void | onAntReceived (AntType, AntDirection) |
| This node processed a (non-duplicate) received ant. | |
| virtual void | onRouteChanged (NodeAddress, NodeAddress, bool) |
| A neighbour/route entry was added (true) or removed (false). | |
Friends | |
| class | World |
One AntHocNet node: the core logic plus the adapter state around it.
| ahn_web::Node::Node | ( | World & | w, |
| int | id, | ||
| std::uint64_t | seed | ||
| ) |
Created by World::addNode(); seed derives the node's streams.
|
overridevirtual |
IClock: the world's simulated time.
Implements anthocnet::core::IClock.
|
inlineoverridevirtual |
IRng: this node's own stream (independent of every other node's).
Implements anthocnet::core::IRng.
Definition at line 176 of file sim.h.
References ahn_web::SplitMix64::uniform().
|
inlineoverridevirtual |
IRng: uniform integer in [0, n).
Implements anthocnet::core::IRng.
Definition at line 178 of file sim.h.
References ahn_web::SplitMix64::uniformInt().
|
override |
IRouterObserver: report-only – route changes feed the event log.
|
inline |
|
inline |
The core state machine (valid after World::start()).
|
inline |