babylon.kernel.services
Structural protocol for the simulation’s DI service container.
babylon.engine.services.ServiceContainer is the concrete container; this
protocol is its kernel-level shadow so lower layers (economics systems, the
system base class) can type-hint the services they receive without importing
the engine — the exact back-edge Program 14 Phase 1 removed.
Only event_bus is typed precisely (it lives in the kernel). Everything
else is deliberately Any: the concrete types live in upper layers the
kernel must not name at runtime, and the container’s optional-calculator
surface (Any fields defaulting to None) is already dynamically typed
at the source. Structural conformance of ServiceContainer to this
protocol is pinned by tests/unit/kernel/test_services_protocol.py.
Classes
|
Attribute surface of the simulation service container. |
- class babylon.kernel.services.ServicesProtocol(*args, **kwargs)[source]
Bases:
ProtocolAttribute surface of the simulation service container.
- Variables:
config – Run-scoped
SimulationConfig(carriesrng_seed).database – Database connection satisfying the persistence protocol.
event_bus – Kernel publish/subscribe bus.
formulas –
FormulaRegistryof hot-swappable formulas.defines –
GameDefines— the moddable coefficient space.metrics – Telemetry collector.
- __init__(*args, **kwargs)