MdpComponentRegistry¶
static class · namespace Hazel
Central registration table for engine-side MDP components. All built-in observation functions, reward signals, termination conditions, randomization handlers, and auxiliary data providers register here at initialization. User-defined C# script components are discovered and registered at runtime via MdpScriptDiscovery. Thread safety: Registration happens during initialization (single-threaded). Lookups happen from gRPC threads during negotiation and from the main thread during step computation. The registry is immutable after initialization, so no locking is needed for reads. Design follows TimeManager's pattern: - Static singleton (like PhysicsSystem) - Pre-allocated dictionaries, no per-frame allocation - Clear separation between registration (init) and lookup (runtime)
Properties¶
AuxiliaryData¶
static
Get all registered auxiliary data descriptors.
Observations¶
static
Get all registered observation descriptors.
Randomizations¶
static
Get all registered randomization descriptors.
Rewards¶
static
Get all registered reward descriptors.
Terminations¶
static
Get all registered termination descriptors.
Methods¶
BuildManifest(string)¶
static
Build a capability manifest describing all registered MDP components. Optionally filtered by robot name (empty = include all). Called by GetCapabilityManifest RPC.
Clear()¶
static
Clear all registered components. Used for testing and scene teardown.
GetAuxiliary(string)¶
static
Get an auxiliary data provider by name. Returns null if not found.
GetObservation(string)¶
static
Get an observation component by name. Returns null if not found.
GetRandomization(string)¶
static
Get a randomization handler by name. Returns null if not found.
GetReward(string)¶
static
Get a reward component by name. Returns null if not found.
GetTermination(string)¶
static
Get a termination component by name. Returns null if not found.
HasAuxiliary(string)¶
static
Check if an auxiliary data provider is registered.
HasObservation(string)¶
static
Check if an observation component is registered.
HasRandomization(string)¶
static
Check if a randomization handler is registered.
HasReward(string)¶
static
Check if a reward component is registered.
HasTermination(string)¶
static
Check if a termination component is registered.
Initialize()¶
static
Initialize the registry with all built-in MDP components. Called once during engine startup, before any gRPC connections. Idempotent — subsequent calls are no-ops.
Register(IAuxiliaryDataProvider)¶
static
Register an auxiliary data provider. Overwrites if name already exists.
Register(IMdpObservation)¶
static
Register an observation component. Overwrites if name already exists.
Register(IMdpReward)¶
static
Register a reward component. Overwrites if name already exists.
Register(IMdpTermination)¶
static
Register a termination component. Overwrites if name already exists.
Register(IRandomizationHandler)¶
static
Register a randomization handler. Overwrites if name already exists.
Source: Hazel/Learn/MdpComponentRegistry.cs