AntHocNet 2.6.1
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
21public:
22 ::anthocnet::core::Time now() const override;
23};
24
26public:
28 double uniform() override;
29 int uniformInt(int n) override;
30
31 /// Expose the underlying stream so the protocol's AssignStreams() can seed
32 /// it deterministically.
33 Ptr<UniformRandomVariable> Stream() const { return m_rng; }
34
35private:
36 Ptr<UniformRandomVariable> m_rng;
37};
38
39} // namespace anthocnet
40} // namespace ns3
41
42#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