AntHocNet 2.0.0
Paper-faithful ant-colony ad hoc routing: the shared core and its adapters
Loading...
Searching...
No Matches
anthocnet-adapters.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-only
2// Copyright (C) 2026 Daniel Henrique Joppi
3
4/*
5 * NS-3 implementations of the core ports.
6 *
7 * IClock -> Simulator::Now()
8 * IRng -> ns3::UniformRandomVariable (so AssignStreams() controls it)
9 */
10#ifndef ANTHOCNET_ADAPTERS_H
11#define ANTHOCNET_ADAPTERS_H
12
13#include "ns3/random-variable-stream.h"
14
16
17namespace ns3 {
18namespace anthocnet {
19
21{
22public:
23 ::anthocnet::core::Time now() const override;
24};
25
27{
28public:
30 double uniform() override;
31 int uniformInt(int n) override;
32
33 /// Expose the underlying stream so the protocol's AssignStreams() can seed
34 /// it deterministically.
35 Ptr<UniformRandomVariable> Stream() const { return m_rng; }
36
37private:
38 Ptr<UniformRandomVariable> m_rng;
39};
40
41} // namespace anthocnet
42} // namespace ns3
43
44#endif // ANTHOCNET_ADAPTERS_H
Source of simulation time (seconds).
Definition ports.h:24
Source of randomness.
Definition ports.h:33
::anthocnet::core::Time now() const override
double uniform() override
Uniform double in [0, 1).
Ptr< UniformRandomVariable > Stream() const
Expose the underlying stream so the protocol's AssignStreams() can seed it deterministically.
int uniformInt(int n) override
Uniform integer in [0, n). Caller guarantees n > 0.
double Time
Simulation time, in seconds.
Definition types.h:24
AntHistoryTracker: (src, seqNum) duplicate detection.
Definition ant_history.h:24