# Cost-Based Parent Selection: Hysteresis Stability Test
#
# Topology (explicit 4-node diamond, symmetric):
#
#    n01 (root)
#    /       \
#   wifi     wifi
#   /         \
#  n02        n03
#   \        /
#   wifi    wifi
#     \   /
#      n04  (test subject)
#
# All links are WiFi-like with similar characteristics. Aggressive
# netem mutation shifts link qualities every 10-20s, but the changes
# stay within the 20% hysteresis band. n04 should pick one parent
# and mostly stick with it — flapping indicates insufficient hysteresis.
#
# Validation: count "Parent switched" in n04 logs, expect <= 5 switches
# over the full 180s duration.

scenario:
  name: "cost-stability"
  seed: 42
  duration_secs: 180

topology:
  algorithm: explicit
  num_nodes: 4
  params:
    adjacency:
      - [n01, n02]
      - [n01, n03]
      - [n02, n04]
      - [n03, n04]
  subnet: "172.20.0.0/24"
  ip_start: 10

netem:
  enabled: true
  default_policy:
    # WiFi baseline
    delay_ms: [5, 20]
    jitter_ms: [2, 5]
    loss_pct: [1, 3]
  mutation:
    interval_secs: {min: 10, max: 20}
    fraction: 1.0
    policies:
      slightly_better:
        delay_ms: [3, 8]
        jitter_ms: [1, 3]
        loss_pct: [0, 1]
      slightly_worse:
        delay_ms: [15, 25]
        jitter_ms: [3, 8]
        loss_pct: [2, 4]

link_flaps:
  enabled: false

traffic:
  enabled: true
  max_concurrent: 2
  interval_secs: {min: 15, max: 30}
  duration_secs: {min: 5, max: 15}
  parallel_streams: 2

logging:
  rust_log: "info"
  output_dir: "./sim-results"
