CTC (Centralized Traffic Control) sim (ADR-029) - a real, dual-homed
TCP client. A single instance oversees both sites (unlike train/il, which
run one pair per train slot) - dual-homed to both sites' CTC port the
same way train_sim.py/il_sim.py are (see dual_link.py's own header),
receive-only: this scenario never has CTC send anything back to the RBC,
it only observes the one-way status pushes (train connected/MA granted/
MA extended) and logs them, tagged by train_id.
Configuration: one JSON file (common/sim_config.py, SIM_CONFIG_PATH env
var, default /app/config.json) - rbcWest/rbcEast and controlServer only
(no trainIndex - CTC is not per-train). See config/ctc.json, right next
to this script. Message vocabulary comes from message_catalog.json, also
right next to this script.
Commands (controlServer.port, config file - see common/control_server.py):
PING Replies "PONG\\n" - liveness check.
Structured JSON commands (tests/robot/design/DESIGN.md,
SIM_INTERFACES.md - same port, see common/control_server.py's own doc).
No sendMessage - CTC never transmits in this scenario:
getMessage {"cmd":"getMessage","nidEngine":N,"message":"CTC_MA_GRANTED"}
Returns the most recently received indication of that
kind concerning train nidEngine, or an ERR if none has
arrived yet.