room-dds-bridge
Auto-configure DDS (Data Distribution Service) domains from ternary-mud room topology.
Each room becomes a DDS topic, passages become domain bridges, and the ternary {-1, 0, +1} state drives QoS policies.
Overview
ternary-mud is a MUD engine where rooms and passages carry a ternary state (Neg, Zero, Pos). room-dds-bridge translates that topology into a complete DDS middleware configuration — no manual DDS setup required.
Room Topology → DDS Configuration
───────────────── ──────────────────────
Room "lobby" → Topic "room_lobby" on Domain 0
Passage (lobby, hall) → Same domain (bridged internally)
Ternary +1 → RELIABLE + PERSISTENT QoS
Ternary 0 → BEST_EFFORT + VOLATILE QoS
Ternary -1 → BEST_EFFORT + TRANSIENT_LOCAL QoS
Agent count = 5 → HistoryDepth = 5
Architecture
| Module | Purpose |
|---|---|
room_config |
Map rooms → DDS topics, compute history depth from agent count |
qos_policy |
Derive QoS policies (reliability, durability, history) from ternary state |
domain_map |
Union-Find connected components → domain assignment, cross-domain bridges |
topic_gen |
Generate DDS topic definitions (name, type, key fields) from room schemas |
pub_sub |
Assign publishers/subscribers per room from agent declarations |
bridge_config |
Export full DDSConfig as serializable JSON |
Core Types
Ternary → QoS Mapping
| Ternary | Reliability | Durability |
|---|---|---|
Pos (+1) |
Reliable |
Persistent |
Zero (0) |
BestEffort |
Volatile |
Neg (-1) |
BestEffort |
TransientLocal |
Domain Rules
- Rooms connected by passages share a domain (union-find)
- Disconnected room clusters get separate domains
- Passages crossing domain boundaries produce
DomainBridgeentries
Usage
use *;
let topology = Topology ;
let config = build_dds_config;
let json = to_json;
println!;
Testing
30+ tests covering:
- Single/multi-room domain assignment
- Connected vs disconnected topology
- All ternary → QoS mappings
- History depth from agent count
- Topic generation and validation
- Publisher/subscriber assignment
- JSON serialization round-trips
- Full pipeline (topology → config → JSON → config)
License
MIT