AntHocNet 2.6.1
Paper-faithful ant-colony ad hoc routing: the shared core and its adapters
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT OR GPL-2.0-only
2// Copyright (C) 2026 Daniel Henrique Joppi
3
4/**
5 * Simulator-agnostic fundamental types for the AntHocNet algorithm core.
6 *
7 * Nothing in core/ may include an NS-2 or NS-3 header. Addresses are modelled
8 * with a plain integer so both simulators (whose own address types are
9 * integral) can pass values straight through their adapters.
10 */
11#ifndef ANTHOCNET_CORE_TYPES_H
12#define ANTHOCNET_CORE_TYPES_H
13
14#include <cstdint>
15
16namespace anthocnet {
17namespace core {
18
19/// Network-layer node address. Matches the width of ns-2's nsaddr_t and
20/// ns-3's 32-bit IPv4 address payload.
21using NodeAddress = std::int32_t;
22
23/// Simulation time, in seconds.
24using Time = double;
25
26/// "No such node / no route" sentinel, mirroring the legacy use of -1.
28
29/// A node's position (m) and velocity (m/s) in the adapter's Cartesian frame
30/// (ADR-0025). Only ever compared between nodes of one simulation, so the
31/// frame needs no geodesy.
32struct Kinematics {
33 double x = 0.0;
34 double y = 0.0;
35 double z = 0.0;
36 double vx = 0.0;
37 double vy = 0.0;
38 double vz = 0.0;
39};
40
41} // namespace core
42} // namespace anthocnet
43
44#endif // ANTHOCNET_CORE_TYPES_H
double Time
Simulation time, in seconds.
Definition types.h:24
constexpr NodeAddress kInvalidAddress
"No such node / no route" sentinel, mirroring the legacy use of -1.
Definition types.h:27
std::int32_t NodeAddress
Network-layer node address.
Definition types.h:21
AntHistoryTracker: (src, seqNum) duplicate detection.
Definition ant_history.h:24
A node's position (m) and velocity (m/s) in the adapter's Cartesian frame (ADR-0025).
Definition types.h:32