# Cost-Based Parent Selection: Deeper Fiber Beats Shallow Bluetooth
#
# Topology (explicit 4-node):
#
#    n01 (root)
#    /       \
#   fiber     BT
#   /         \
#  n02        n04  (test subject)
#   |        /
#  fiber   fiber
#   |    /
#  n03
#
# n04 has two candidate parents:
#   - n01 (root, depth 0) via Bluetooth L2CAP: effective_depth = 0 + ~1.4 = ~1.4
#   - n03 (depth 2) via fiber:                 effective_depth = 2 + ~1.01 = ~3.01
#
# Without cost-based selection, n04 would pick n01 (depth 0 < depth 2).
# With cost-based selection and these Bluetooth impairments, n04 may
# still pick n01 since the Bluetooth cost (~1.4) is modest. This tests
# that the cost formula correctly weighs depth against link quality.
#
# Validation: tree snapshot shows n04's parent selection reflects the
# actual cost tradeoff between depth and link quality.

scenario:
  name: "depth-vs-cost"
  seed: 42
  duration_secs: 45

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

netem:
  enabled: true
  default_policy:
    # Fiber-like
    delay_ms: [1, 5]
    jitter_ms: [0, 1]
    loss_pct: [0, 0.5]
  link_policies:
    # Bluetooth (L2CAP) link from n01 to n04
    - edges: ["n01-n04"]
      policy:
        delay_ms: [15, 40]
        jitter_ms: [5, 15]
        loss_pct: [2, 8]

link_flaps:
  enabled: false

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

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