P14-03: Price whole-shaft elevator waits in A* route choice

Riders queued for any floor pair in a shaft now delay every pair: the
elevator service publishes the rest of the shaft queue as each connector's
dynamic cost, refreshed on trip changes and each cabin minute, and restore
rejects saves whose wait disagrees with their trips. A two-shaft fixture with
real guests shows rush diversion, shared cabins within capacity, recovery,
route loss and warp-exit congestion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Takeshi
2026-10-20 15:57:28 +09:00
co-authored by Claude Opus 5.5
parent 50ceca0b7d
commit 0754f412a8
4 changed files with 246 additions and 0 deletions
+21
View File
@@ -395,6 +395,27 @@ func set_connector_enabled(connector_id: StringName, enabled: bool) -> bool:
return true
## Cost-only update (no topology change), e.g. waiting riders elsewhere in the
## same elevator shaft. Any change may make routes cheaper, so all caches drop.
func set_connector_dynamic_cost(connector_id: StringName, dynamic_cost: int) -> bool:
if not _connectors.has(connector_id):
last_error = "Unknown connector id: %s" % connector_id
return false
if dynamic_cost < 0:
last_error = "Connector dynamic cost must be non-negative."
return false
var connector: Dictionary = _connectors[connector_id]
if int(connector[&"dynamic_cost"]) == dynamic_cost:
last_error = ""
return true
connector[&"dynamic_cost"] = dynamic_cost
_connectors[connector_id] = connector
traffic_revision += 1
invalidate_all_cache()
last_error = ""
return true
func set_connector_operational_state(connector_id: StringName, state: StringName) -> bool:
if not _connectors.has(connector_id):
last_error = "Unknown connector id: %s" % connector_id