AntHocNet 2.6.1
Paper-faithful ant-colony ad hoc routing: the shared core and its adapters
Loading...
Searching...
No Matches
config.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 * Tunable AntHocNet parameters.
6 *
7 * These were compile-time constants in AntHocNetUtils (ALFA/BETA/GAMA/...).
8 * Promoting them to a value type lets each adapter expose them as TCL binds
9 * (NS-2) or TypeId attributes (NS-3) without touching the algorithm code.
10 * The defaults reproduce the original constants.
11 */
12#ifndef ANTHOCNET_CORE_CONFIG_H
13#define ANTHOCNET_CORE_CONFIG_H
14
15#include <cstddef>
16
17namespace anthocnet {
18namespace core {
19
20struct Config {
21 /// Pheromone reinforcement / evaporation weights.
22 /// ALFA: evaporation retains alpha of the value per evaporationInterval
23 /// (ADR-0012, a repo extension). **This is NOT the thesis's α.** The 2007
24 /// thesis has three distinct 0.7s: γ (pheromone running average → `gamma`),
25 /// η (MAC send-time average → ns-3 `MacServiceAlpha`) and α (the hop-count
26 /// moving average, eq. 4.2 → `hopCountAlpha` below). This field is none of
27 /// them — the thesis has no evaporation term at all (#182, #185).
28 double alpha = 0.7;
29
30 /// The thesis's α — hop-count moving average, eq. 4.2:
31 /// h ← α·h + (1−α)·h_ant, per (destination, next hop), applied before the
32 /// hop count enters the pheromone metric (#185). 2007 thesis: "α is a
33 /// parameter regulating how quickly the formula adapts to new information.
34 /// In our experiments, α is always kept on 0.7." **Defaults to 0.0**, which
35 /// makes h equal the ant's own hop count — exactly the pre-#185 behaviour —
36 /// so enabling the thesis value (0.7) is an A/B decision, not a silent
37 /// change. Must be in [0, 1).
38 double hopCountAlpha = 0.0;
39
40 double gamma = 0.7; ///< GAMA: weight of the old value when reinforcing.
41
42 /// Eq.1 exponents for the stochastic next-hop choice, from the primary
43 /// source (#179): Ducatelle, *Adaptive Routing in Ad Hoc Wireless Multi-hop
44 /// Networks*, PhD thesis, USI Lugano, 2007 — beta1 (reactive ants, eq 4.1)
45 /// "we keep beta1 relatively high, on 20"; beta2 (proactive ants, eq 4.5)
46 /// "normally kept on 20"; beta3 (data, eq 4.6) "we normally keep beta3
47 /// on 20". All three are 20, so ants and data share one value here.
48 ///
49 /// This is a deliberate departure from [1] (PPSN 2004), which gives no
50 /// absolute values but does state a *ratio*: data uses pheromone squared
51 /// (§3.2 "the square ... to be more greedy") while ants use it unsquared
52 /// (§3.3 "not squared, so that they sample the paths more evenly"). At the
53 /// thesis values that asymmetry disappears. The thesis reaches exploration
54 /// by other means — proactive ants route on max(regular, virtual) pheromone
55 /// and carry a per-node broadcast probability — rather than by a lower
56 /// exponent. Same precedent as hopTimeSec (#88): the thesis supplies numbers
57 /// the paper omits, and its numbers win where the two disagree.
58 ///
59 /// Measured, not merely sourced (#179): a 20-seed x 900 s A/B over the six
60 /// discrete scenarios, paired per seed, moved 5 of 6 to PAIRED-IMPROVED with
61 /// no scenario regressing — PDR +0.50..+3.23 pp and routing load -9.7..-16.7%
62 /// where significant. Only dense-small is neutral. The full table, the
63 /// controls and the one adverse signal are on #179.
64 ///
65 /// betaAnts conflates the thesis's beta1 (reactive) and beta2 (proactive),
66 /// which the thesis parameterises separately. They coincide at 20, so the
67 /// conflation is harmless *here*; it stops being harmless if we ever want a
68 /// value the thesis does not have — the thesis itself sweeps beta2 alone in
69 /// chapter 5. Split the field before deviating per ant type, not after.
70 double betaAnts = 20.0; ///< exponent for ant next-hop choice (thesis beta1/beta2).
71 double betaData = 20.0; ///< exponent for data next-hop choice (thesis beta3).
72
73 /// Per-hop time estimate used by the back-ant pheromone formula (Eq.2):
74 /// the time to take one hop in unloaded conditions. In seconds, matching
75 /// IClock, so it is comparable in magnitude to the measured path time.
76 /// Value from the primary source (#88): Ducatelle, *Adaptive Routing in Ad
77 /// Hoc Wireless Multi-hop Networks*, PhD thesis, USI Lugano, 2007 — "we
78 /// kept thop on 0.003 sec". [1] (PPSN 2004) defines the constant but gives
79 /// no number, which is why this was a provisional 50 ms until 2026-07-25.
80 double hopTimeSec = 0.003; ///< T_hop = 3 ms (2007 thesis)
81
82 /// Congestion-aware per-hop cost (item 10/A2, [1] §3.2): when on and an
83 /// ILinkState is injected, a forward ant records each node's expected
84 /// send time (Q_mac+1)*T̂_mac instead of its own wall-clock transit delta,
85 /// so the path-time term T̂_d reflects sustained MAC load. Gated + default
86 /// off so the simpler item-02 metric stays the shipped default until a
87 /// benchmark justifies the switch.
88 bool enableMacMetric = false;
89
90 /// SINR link metric (#181, thesis eq. 4.11), used only when the "sinr"
91 /// metric is selected: a link whose SINR is at or below sinrCriticalDb costs
92 /// sinrPenaltyCost hops instead of one. "In simulation tests using IEEE
93 /// 802.11b radios sending at 2Mbps, we empirically set SINR_c to 17dB and
94 /// c_const to 3." -- Ducatelle, PhD thesis, USI Lugano, 2007, §4.2.6.
95 double sinrCriticalDb = 17.0; ///< SINR_c (dB)
96 double sinrPenaltyCost = 3.0; ///< c_const (> 1)
97 /// #145 energy metric: a node with less than this residual fraction
98 /// prices its hop as if it had exactly this much (cost <= 1 / floor).
99 /// `repo choice`.
100 double energyCostFloor = 0.01;
101
102 /// Links whose pheromone drops below this are pruned.
103 double minPheromone = 0.00001; ///< MIN_PHEROMONE
104
105 /// Time-proportional evaporation (ADR-0012): a secondary safety net, the
106 /// only source of aging (reinforcement no longer ages competitors). Each
107 /// tick ages every regular link by alpha^(dt/evaporationInterval). Gated so
108 /// item 08 can run the paper-faithful "running-average only" ablation.
109 bool enableEvaporation = true;
110 double evaporationInterval = 1.0; ///< reference interval (s) for the decay.
111
112 /// #572 adaptive evaporation: each destination's decay rate follows its
113 /// observed route churn. Every maintenance tick the router checks whether
114 /// the destination's best regular next hop changed, keeps an exponentially
115 /// weighted rate of such changes per second (time constant
116 /// adaptiveEvapTau), and evaporates that destination's pheromone
117 /// clamp(rate / adaptiveEvapRefChurn, adaptiveEvapMin, adaptiveEvapMax)
118 /// times as fast as the fixed rate. Churning routes forget stale links
119 /// sooner; stable ones keep them longer. After Mavrovouniotis and Yang
120 /// (2013/2014) on dynamic optimisation, untested on routing until
121 /// measured here. Default off: byte-identical when off.
123 /// Churn (best-hop changes per second) at which the fixed rate applies.
124 /// `repo choice`: one change per 10 s.
126 double adaptiveEvapMin = 0.25; ///< slowest decay, as a multiple of the fixed rate
127 double adaptiveEvapMax = 4.0; ///< fastest decay, as a multiple of the fixed rate
128 double adaptiveEvapTau = 10.0; ///< churn EWMA time constant (s)
129
130 /// At most one reactive forward ant per destination per this window, so a
131 /// stream of packets to an unreachable destination doesn't flood ants
132 /// ([1] §4.2).
134
135 /// Proactive / diffusion subsystem (ADR-0007), config-gated so the
136 /// benchmark ablation (item 08) can justify the shipped default.
137 bool enableProactive = true; ///< master: proactive ants + diffusion.
138 bool enableDiffusion = true; ///< hello pheromone adverts + virtual table.
139
140 /// Diffusion advert cap k: at most this many destinations per hello ant
141 /// (#186). 2007 thesis: "picks a maximum number k of destinations it has
142 /// routing information for. k is normally kept on 10" — and its §5.3.4
143 /// sweeps k = 0/2/5/10/20, reporting performance improving monotonically
144 /// with k. Clamped to the wire bound kMaxHelloOnWire (64) so a large value
145 /// can never produce a hello the codec would reject. Which k destinations
146 /// fill the slots is a separate, documented deviation: active sessions
147 /// first, then best pheromone (#26 item 6.5), where the thesis picks k at
148 /// random — see docs/fidelity.md.
149 std::size_t maxHelloAdverts = 10;
150
151 /// Per-ant-type gates, completing the ablation surface the other
152 /// `enable*` flags already provide. **All default true: turning none of
153 /// them off reproduces current behaviour exactly.** They exist so the
154 /// question "which ant types earn their keep in regime X?" is a
155 /// measurement rather than an argument — the same discipline that chose
156 /// the multipath and A2 defaults.
157 ///
158 /// There is deliberately **no** hello gate: ADR-0008 makes the
159 /// hello-timeout detector the one mandatory liveness path, and hello also
160 /// carries the diffusion adverts (`enableDiffusion`) and, on
161 /// multi-interface adapters, the canonical→link-local peer mapping. Use
162 /// `helloInterval` to make it cheaper; do not remove it.
163 ///
164 /// Note `enableReactive = false` removes the only source of *regular*
165 /// pheromone in the default configuration, so routes never form unless
166 /// something else installs them — which is exactly the interaction
167 /// `enableDirectedReactive` + `enableDiffusion` is there to test.
168 bool enableReactive = true; ///< reactive forward ants (route discovery).
169 bool enableRepair = true; ///< local repair ants after a link break ([1] §3.5).
170 bool enableLinkFail = true; ///< link-failure notifications ([1] §3.5).
171
172 /// Directed reactive discovery (default **off** — an explicit deviation
173 /// from [1] §3.1, kept behind a gate until a benchmark justifies it).
174 ///
175 /// [1] broadcasts a reactive forward ant wherever the current node has no
176 /// pheromone for the destination. That is the right move when nothing is
177 /// known — but it ignores information the protocol has already collected:
178 /// the **virtual** pheromone table, built from hello diffusion adverts
179 /// (ADR-0007), frequently holds a usable gradient toward a destination for
180 /// which no *regular* pheromone exists yet. `selectNextHop` only blends the
181 /// virtual table in for proactive ants, so a reactive ant floods past it.
182 ///
183 /// With this on, a reactive forward ant consults the virtual table before
184 /// falling back to broadcast, and unicasts along it when it finds one. The
185 /// flood becomes a directed walk wherever diffusion has reached, and stays
186 /// a flood everywhere else.
187 ///
188 /// Deliberately **not** position- or topology-specific: the gradient is
189 /// the protocol's own, so this behaves identically on a MANET and on a
190 /// satellite ISL mesh, and needs neither GPS (cf. LAR/GPSR) nor an orbital
191 /// model. Nothing new travels on the wire — the virtual table is local
192 /// state — so this costs no `kWireVersion` bump.
193 ///
194 /// Risk to measure, not assume: a stale or wrong gradient sends the ant
195 /// down a dead end where a flood would have found a path, trading overhead
196 /// for discovery latency and possibly for delivery.
198
199 /// ADR-0025 (#573): put this node's position and velocity, read from the
200 /// IKinematics port, on its hellos, and keep what neighbours' hellos say.
201 /// Off by default: no hello grows, no table fills, and routing is
202 /// byte-identical. It is the substrate for link-lifetime prediction
203 /// (#574), which turns it on; on its own it changes no decision, only
204 /// what the hellos carry (25 bytes more when the position is known).
205 bool shareKinematics = false;
206
207 /// #574: discount next hops whose link is predicted to break soon. Each
208 /// neighbour's pheromone is multiplied, for next-hop choice only (ants and
209 /// data), by min(1, LET / linkLifetimeHorizon), floored at
210 /// linkLifetimeFloor. LET is the link expiration time (Su, Lee and Gerla
211 /// 2001) from this node's and the neighbour's kinematics (ADR-0025) and
212 /// linkLifetimeRange. A neighbour whose kinematics are unknown is not
213 /// discounted. Turning this on implies shareKinematics. Default off:
214 /// byte-identical when off (ADR-0020's check). The deposits themselves are
215 /// untouched, so a discount never outlives the prediction behind it.
216 bool enableLinkLifetime = false;
217 /// Radio range (m) the prediction assumes. `repo choice`: the paper
218 /// cell's disk range is 300 m and the two-ray decode radius ~250 m, so
219 /// 250 m; set it to the scenario's range when measuring.
220 double linkLifetimeRange = 250.0;
221 /// A link predicted to live at least this long (s) is not discounted.
222 /// `repo choice`: 3 hello periods, the threshold scenario_check.py's #481
223 /// rule uses for "links that live too short for neighbour detection".
225 /// The smallest weight a predicted-short link keeps (discouraged, never
226 /// removed: a node whose links are all short must still forward).
227 double linkLifetimeFloor = 0.05;
228 /// #571 quiet mode: back proactive ants off on a stable route. Each
229 /// proactive round, an active destination whose best next hop is the same
230 /// as last round, with its pheromone within quietTolerance (relative),
231 /// counts one more stable round; its ant is then sent only every
232 /// min(quietMaxBackoff, quietBackoffFactor^stable) rounds. A changed best
233 /// hop, a pheromone outside the tolerance, a lost neighbour or a new one
234 /// resets the destination (or, for neighbour events, every destination)
235 /// to one ant per round. Default on since v2.3.0: the campaign found no
236 /// regression in any cell and NRL -8.6 % on the static mesh
237 /// (docs/benchmarks/v2.3.0-campaign.md). Off reproduces v2.2.0.
238 bool enableQuietMode = true;
239 /// Relative pheromone change that still counts as "the same route".
240 /// `repo choice`.
241 double quietTolerance = 0.2;
242 /// Geometric growth of the back-off, in proactive rounds. `repo choice`.
243 double quietBackoffFactor = 2.0;
244 /// Longest back-off, in proactive rounds (8 x the 10 s default interval
245 /// = 80 s between probes of a stable route). `repo choice`.
247
248 /// Per-hop probability that an in-transit proactive forward ant is broadcast
249 /// to explore for new paths rather than unicast along pheromone ([1] §3.3).
251 /// A destination stays an "active session" (and is probed by proactive ants)
252 /// for this many seconds after the last locally-originated data packet to it.
253 double sessionTtl = 5.0;
254
255 /// Emission gate for proactive forward ants (issue #180). The proactive
256 /// timer *considers* one ant per active session; this is the fraction by
257 /// which the best **virtual** pheromone for that destination must exceed the
258 /// best **regular** pheromone before the ant is actually sent.
259 ///
260 /// Ducatelle 2007 thesis (lines 4084-4088): *"In order to improve
261 /// efficiency, the actual sending of a proactive forward ant is conditional
262 /// to the availability of good new virtual pheromone: only if the best
263 /// virtual pheromone is significantly better (in our experiments: at least
264 /// 10% better) than the best regular pheromone, a proactive forward ant is
265 /// sent out."*
266 ///
267 /// Expressed as a **margin** (0.10 = "at least 10% better"), not as a 1.10
268 /// ratio, so that `0` reads unambiguously as "no margin required" — i.e. the
269 /// gate is off and every considered ant is sent, reproducing pre-#180
270 /// behaviour for the ablation. See `shouldSendProactive()` for the
271 /// boundary cases (no virtual pheromone; no regular route at all).
272 ///
273 /// **The comparison is per-link, not the thesis's literal best-vs-best**
274 /// (ADR-0018, the #180 re-derivation): pass iff some neighbour's virtual
275 /// pheromone beats the regular pheromone on that SAME link by the margin,
276 /// with a hint on an unsampled link passing trivially. The scalar
277 /// best-vs-best form compares estimators of different paths; its ratio has
278 /// a structural ceiling tau(h-1)/tau(h) ~ h/(h-1) (measured byte-exact by
279 /// `exp_uniformity_probe`), so any fixed margin m silently disables the
280 /// gate for destinations farther than 1 + 1/m hops — on the old, corrupted
281 /// clocks this was measured as pass rates of 0-3.8 % and, when forced on,
282 /// +36-68 % NRL / -5 to -6.4 pp PDR (PR #188). The per-link ratio is
283 /// degree- and hop-independent (probe: centred 0.97-1.06).
284 ///
285 /// **Defaults to 0 (gate OFF).** The re-derived shape makes a non-zero
286 /// margin *meaningful* (probe-measured: m in 0.2-0.5 selects the genuine
287 /// anomaly tail rather than a phase/hop artefact); adopting one as default
288 /// is a benchmark decision on the regime that keeps proactive on (#248:
289 /// satellite), owned by #180's A/B record.
290 /// `core/tests/exp_gate_cascade.cpp` reproduces the historical failure.
292
293 /// Timer intervals (seconds).
294 double helloInterval = 1.0;
295 /// Proactive forward-ant period per active session. 10.0 is the
296 /// long-standing repo value with no recorded source (#182); the thesis's
297 /// §5.3.3 measured optimum is 2 s, but adopting it is #248's sweep to
298 /// decide — PR #252 accidentally shipped 2.0 here while claiming not to,
299 /// which the per-merge refresh measured as NRL ×4.7 / PDR −12 pp at
300 /// paper-base (#254). Do not change this default without that A/B.
301 double proactiveInterval = 10.0;
302 double lifeAnt = 2.0;
303
304 /// A neighbour is presumed gone after this many missed hellos
305 /// (maxIdle = helloInterval * allowedHelloLoss), per [1] §3.5.
307
308 /// Max times a repair / link-failure ant may be (re)broadcast before being
309 /// dropped, so local repair and failure notifications can't storm ([1] §3.5).
311
312 /// Minimum spacing (s) between LinkFail notifications this node originates
313 /// about the same destination. Under link flapping (evict -> hello
314 /// re-learn -> evict) every cycle re-broadcast a fresh note about the same
315 /// destinations, making origins ~98% of linkfail volume (issue #20).
316 /// The #20 sweep picked 5.0: 1 s misses the ~3+ s flap cycle (no effect),
317 /// 10 s starts costing PDR/delay. 0 disables the cooldown (the original
318 /// spec has no rate limit).
320 /// Consecutive MAC transmit-failures to the same next hop (with no reception
321 /// from it in between) before the adapter's fast-path detector (ADR-0008
322 /// detector D) treats the link as broken. Debounces transient congestion
323 /// drops: a single retry-limit drop in a dense/contended network is usually a
324 /// collision, not a topology change, and evicting the neighbour on it
325 /// destroys valid routes and triggers rediscovery floods (issue #19).
327 /// Max times **one node** may broadcast **one reactive generation**
328 /// `(src, seqNum)`. `-1` = unbounded. Default 2.
329 ///
330 /// **The unit of this field changed in #173 — read this before comparing it
331 /// to an older run or an older sweep.** It used to be a budget carried on
332 /// the ant and decremented at every hop, i.e. per *ant path*; it is now a
333 /// counter held at each node per generation. Same name, same default,
334 /// different meaning — the `alpha`/ADR-0012 trap, so it is spelled out
335 /// here (see `docs/configuration.md`).
336 ///
337 /// Why per node. A reactive forward ant broadcasts wherever there is no
338 /// pheromone for the destination, so a *per-path* budget is a hop limit on
339 /// discovery: at 2, destinations more than ~5 hops away were permanently
340 /// undiscoverable (#169), which is what made sparse/static fields look like
341 /// an AntHocNet weakness. A *per-node* count does not limit reach at all —
342 /// the ant may still travel arbitrarily far, each node along the way simply
343 /// does not re-broadcast the same generation indefinitely.
344 ///
345 /// Why a bound is needed at all, given the sources describe none. The 2007
346 /// thesis bounds proliferation by duplicate suppression ("subsequent copies
347 /// are destroyed"), `maxPathLength` and the `antAcceptanceFactor` band. But
348 /// with `enableMultipath` on (the default) a reactive forward ant is
349 /// admitted by the acceptance band *instead of* `(src,seq)` duplicate
350 /// suppression, and the band admits rather than suppresses. Removing the
351 /// per-path budget in #169 therefore left no bound: one discovery on a
352 /// 7x7 grid cost 30,090 ants, and ns-3 `large-scale` fell to 21.7% PDR at
353 /// NRL 3071 (#173). This restores duplicate suppression's *intent* for the
354 /// one ant type that bypasses it.
355 ///
356 /// **Default is now `-1` (unbounded), as of #177.** The two-factor band
357 /// below (a1=0.9 / a2=2.0) bounds the flood on its own — one discovery on a
358 /// 7x7 grid costs 154 ants with no count in force, ~3.1n and flat in n — so
359 /// the per-node counter is no longer load-bearing, and leaving it on cost
360 /// delivery in dense graphs (heavy-load +1.8 pp, large-scale +4.7 pp at
361 /// 11.6%/25.6% less overhead once removed). Kept configurable for
362 /// sensitivity experiments; any finite value still bounds re-broadcasts
363 /// per (node, generation).
365 /// Multipath reactive setup ([1] §3.1, issue #96): when on, a *later*
366 /// reactive forward ant of an already-seen generation is forwarded if it
367 /// passes the antAcceptanceFactor band below, laying down *multiple* good
368 /// paths — and losing a best hop that leaves a usable alternate is absorbed
369 /// instead of flooding a LinkFail (the churn bound; without it multipath
370 /// regressed PDR on the ns-3 disk-model harness, #96 round 1). When off,
371 /// every ant type uses strict (src,seq) dedup — only the first-arriving
372 /// copy propagates (single-path setup). Default on: with the churn bound,
373 /// multipath beat single-path on every headline metric in the paper regime
374 /// (PDR 92.3 vs 89.4, delay/jitter/NRL all no worse; #96 round 2).
375 bool enableMultipath = true;
376 /// Multipath acceptance factor ([1] §3.1, "empirically set to 1.5"), used
377 /// only when enableMultipath is on: a later same-generation reactive
378 /// forward ant is forwarded only if both its hop count and its travel time
379 /// are within this factor of the best ant of that generation seen so far.
380 /// *Higher* admits *more* copies (more multipath, up to a flood); 1.0 still
381 /// admits equal-metric copies, so no factor value reproduces strict
382 /// single-path dedup — that is what enableMultipath=false is for.
383 ///
384 /// **Default is 0.9, not the 1.5 of [1] §3.1, as of #177.** The 2007
385 /// Ducatelle thesis describes the same mechanism
386 /// but states the value its authors actually ran, and it is *below* 1.0:
387 ///
388 /// "If the number of hops and travel time of a newly received ant are
389 /// both within an acceptance factor a1 of those of the best previously
390 /// received ant of the same route setup, the new ant is accepted and
391 /// forwarded; otherwise, it is discarded. a1 is set quite low (to 0.9),
392 /// in order to only allow the best ants through and avoid too much
393 /// proliferation of forward ants in the network."
394 /// -- 2007 thesis, lines 4655-4659
395 ///
396 /// So a1 < 1 is deliberate: a later ant must be *strictly better* than the
397 /// generation's best by ~10% on **both** metrics to be forwarded, which is
398 /// what makes the band a suppressor rather than an admitter. This is the
399 /// same field and the same meaning as on `main` — only the default moves —
400 /// so it is not the #173 "unit changed under the name" trap.
402 /// Disjoint-path acceptance factor **a2** — the less restrictive factor
403 /// applied when a reactive forward ant's *first hop* (the node it travelled
404 /// to immediately after the source) has **not** been seen among the ants
405 /// this node already accepted for that `(src, seqNum)` generation:
406 ///
407 /// "To boost the creation of disjoint paths, a different mechanism is
408 /// applied, which takes into account the first hop taken by each ant. If
409 /// this first hop is different from those taken by previously accepted
410 /// ants, we apply a higher (less restrictive) acceptance factor a2 than
411 /// in the case the first hop was already seen before (a2 was set to 2)."
412 /// -- 2007 thesis, lines 4667-4671
413 ///
414 /// A new first hop is evidence that the ant arrived over a genuinely
415 /// *disjoint* branch of the network, which is worth a path even when its
416 /// metrics are worse than the incumbent's; a repeat first hop is a likely
417 /// near-copy of a path already laid, so it must clear `antAcceptanceFactor`
418 /// (a1). Used only when `enableMultipath` is on. Set below a1 and this
419 /// mechanism inverts — it would penalise disjointness — so keep a2 >= a1.
420 ///
421 /// New field, deliberately not folded into `antAcceptanceFactor`: silently
422 /// redefining an existing field's meaning is the #173 defect this repo has
423 /// already paid for once (see `docs/configuration.md` §2).
425 /// Max times a proactive forward ant may be (re)broadcast — covering both the
426 /// per-hop exploratory broadcast ([1] §3.3) and a route gap en route. Proactive
427 /// ants monitor known paths; an unbounded budget let them flood any region of
428 /// missing routes, amplifying route churn into control storms (issue #45).
430
431 /// Local repair wait ([1] §3.5): after launching a repair ant, wait
432 /// repairWaitFactor × the estimated end-to-end delay of the lost path for a
433 /// backward repair ant; if none arrives, discard the buffered packets for
434 /// that destination and send a link-failure notification (spec D6). The
435 /// paper sets the factor empirically to 5.
436 double repairWaitFactor = 5.0;
437 /// Flat repair wait (seconds) used when the lost path has no usable delay
438 /// estimate (e.g. its pheromone was already gone).
439 double repairTimeout = 1.0;
440
441 /// Conservative upper bound on path length for the expanding-ring search.
443
444 /// Bound the visited-node stack carried in a packet, and the (src,seq)
445 /// dedup history, so a long-running simulation cannot grow them without
446 /// limit (a latent issue in the original fixed-size malloc arrays).
447 std::size_t maxPathLength = 100;
448 std::size_t maxHistory = 4096;
449};
450
451} // namespace core
452} // namespace anthocnet
453
454#endif // ANTHOCNET_CORE_CONFIG_H
AntHistoryTracker: (src, seqNum) duplicate detection.
Definition ant_history.h:24
std::size_t maxHistory
Definition config.h:448
double helloInterval
Timer intervals (seconds).
Definition config.h:294
double alpha
Pheromone reinforcement / evaporation weights.
Definition config.h:28
bool enableMacMetric
Congestion-aware per-hop cost (item 10/A2, [1] §3.2): when on and an ILinkState is injected,...
Definition config.h:88
double linkLifetimeRange
Radio range (m) the prediction assumes.
Definition config.h:220
bool enableDirectedReactive
Directed reactive discovery (default off — an explicit deviation from [1] §3.1, kept behind a gate un...
Definition config.h:197
bool enableLinkFail
link-failure notifications ([1] §3.5).
Definition config.h:170
bool enableQuietMode
#571 quiet mode: back proactive ants off on a stable route.
Definition config.h:238
double linkfailNotifyInterval
Minimum spacing (s) between LinkFail notifications this node originates about the same destination.
Definition config.h:319
double reactiveRetryInterval
At most one reactive forward ant per destination per this window, so a stream of packets to an unreac...
Definition config.h:133
double quietBackoffFactor
Geometric growth of the back-off, in proactive rounds. repo choice.
Definition config.h:243
double betaAnts
Eq.1 exponents for the stochastic next-hop choice, from the primary source (#179): Ducatelle,...
Definition config.h:70
double energyCostFloor
#145 energy metric: a node with less than this residual fraction prices its hop as if it had exactly ...
Definition config.h:100
bool enableProactive
Proactive / diffusion subsystem (ADR-0007), config-gated so the benchmark ablation (item 08) can just...
Definition config.h:137
double adaptiveEvapMax
fastest decay, as a multiple of the fixed rate
Definition config.h:127
int networkDiameter
Conservative upper bound on path length for the expanding-ring search.
Definition config.h:442
std::size_t maxHelloAdverts
Diffusion advert cap k: at most this many destinations per hello ant (#186).
Definition config.h:149
bool enableLinkLifetime
#574: discount next hops whose link is predicted to break soon.
Definition config.h:216
double adaptiveEvapMin
slowest decay, as a multiple of the fixed rate
Definition config.h:126
double antAcceptanceFactor
Multipath acceptance factor ([1] §3.1, "empirically set to 1.5"), used only when enableMultipath is o...
Definition config.h:401
int quietMaxBackoff
Longest back-off, in proactive rounds (8 x the 10 s default interval = 80 s between probes of a stabl...
Definition config.h:246
double linkLifetimeFloor
The smallest weight a predicted-short link keeps (discouraged, never removed: a node whose links are ...
Definition config.h:227
bool enableEvaporation
Time-proportional evaporation (ADR-0012): a secondary safety net, the only source of aging (reinforce...
Definition config.h:109
double linkLifetimeHorizon
A link predicted to live at least this long (s) is not discounted.
Definition config.h:224
double sinrPenaltyCost
c_const (> 1)
Definition config.h:96
int repairMaxBroadcasts
Max times a repair / link-failure ant may be (re)broadcast before being dropped, so local repair and ...
Definition config.h:310
bool enableMultipath
Multipath reactive setup ([1] §3.1, issue #96): when on, a later reactive forward ant of an already-s...
Definition config.h:375
double hopTimeSec
Per-hop time estimate used by the back-ant pheromone formula (Eq.2): the time to take one hop in unlo...
Definition config.h:80
int reactiveMaxBroadcasts
Max times one node may broadcast one reactive generation (src, seqNum).
Definition config.h:364
double betaData
exponent for data next-hop choice (thesis beta3).
Definition config.h:71
double sinrCriticalDb
SINR link metric (#181, thesis eq.
Definition config.h:95
double proactiveBroadcastProb
Per-hop probability that an in-transit proactive forward ant is broadcast to explore for new paths ra...
Definition config.h:250
double quietTolerance
Relative pheromone change that still counts as "the same route".
Definition config.h:241
bool enableReactive
Per-ant-type gates, completing the ablation surface the other enable* flags already provide.
Definition config.h:168
int proactiveMaxBroadcasts
Max times a proactive forward ant may be (re)broadcast — covering both the per-hop exploratory broadc...
Definition config.h:429
double antAcceptanceFactorNewHop
Disjoint-path acceptance factor a2 — the less restrictive factor applied when a reactive forward ant'...
Definition config.h:424
std::size_t maxPathLength
Bound the visited-node stack carried in a packet, and the (src,seq) dedup history,...
Definition config.h:447
double minPheromone
Links whose pheromone drops below this are pruned.
Definition config.h:103
double sessionTtl
A destination stays an "active session" (and is probed by proactive ants) for this many seconds after...
Definition config.h:253
double adaptiveEvapTau
churn EWMA time constant (s)
Definition config.h:128
int allowedHelloLoss
A neighbour is presumed gone after this many missed hellos (maxIdle = helloInterval * allowedHelloLos...
Definition config.h:306
double evaporationInterval
reference interval (s) for the decay.
Definition config.h:110
double proactiveVirtualMargin
Emission gate for proactive forward ants (issue #180).
Definition config.h:291
double repairTimeout
Flat repair wait (seconds) used when the lost path has no usable delay estimate (e....
Definition config.h:439
bool enableDiffusion
hello pheromone adverts + virtual table.
Definition config.h:138
double repairWaitFactor
Local repair wait ([1] §3.5): after launching a repair ant, wait repairWaitFactor × the estimated end...
Definition config.h:436
double proactiveInterval
Proactive forward-ant period per active session.
Definition config.h:301
int txFailureThreshold
Consecutive MAC transmit-failures to the same next hop (with no reception from it in between) before ...
Definition config.h:326
bool enableAdaptiveEvaporation
#572 adaptive evaporation: each destination's decay rate follows its observed route churn.
Definition config.h:122
double hopCountAlpha
The thesis's α — hop-count moving average, eq.
Definition config.h:38
bool enableRepair
local repair ants after a link break ([1] §3.5).
Definition config.h:169
double gamma
GAMA: weight of the old value when reinforcing.
Definition config.h:40
double adaptiveEvapRefChurn
Churn (best-hop changes per second) at which the fixed rate applies.
Definition config.h:125
bool shareKinematics
ADR-0025 (#573): put this node's position and velocity, read from the IKinematics port,...
Definition config.h:205