ExternalAgentRegistry¶
static class ยท namespace Hazel
Methods¶
ClearGrpcClientFlag()¶
static
ClearNegotiatedSession()¶
static
Clear the active negotiated session. Called on scene stop.
CommitPendingGroups()¶
static
Merge all pending action groups into the action buffer and signal the gate. Uses DefaultJointPosBuffer as the base for any indices not covered by groups. Called by Step() when action_groups are provided but no flat actions vector.
GetAgentName(int)¶
static
GetCurrentFrameNumber()¶
static
GetNegotiator()¶
static
Get or create the contract negotiator singleton.
GetOwnedActuatorIndices()¶
static
GetReadinessDiagnostic()¶
static
Returns a human-readable diagnostic string describing why the external agent batch is not ready, or empty string if ready. Thread-safe โ intended for polling from the editor UI and gRPC responses.
HasGrpcClient()¶
static
HasPendingGroups()¶
static
Check if any action groups have been preloaded but not yet committed.
InvalidateBatch()¶
static
IsExternalBatchReady()¶
static
MarkGrpcClientConnected()¶
static
NotifyExternalBatchSetupComplete(RobotManager)¶
static
PreloadActionGroup(string, float[], int[])¶
static
Preload actions for a named group. Does NOT trigger a physics step. Multiple groups accumulate until CommitPendingGroups() or a flat TrySetExternalActions() call merges and signals the gate. Thread-safe โ called from gRPC handler threads.
Register(RobotManager, RobotEnv, Entity)¶
static
SetResetCallback(Action?)¶
static
TryCopyActionSlice(int, float[], long)¶
static
TryCopyEnrichedStepData(Dictionary?, Dictionary?, bool, bool)¶
static
public static bool TryCopyEnrichedStepData(out Dictionary<string, float>? rewardSignals, out Dictionary<string, bool>? terminationFlags, out bool terminated, out bool truncated)
Copy the latest enriched step data for the gRPC response. Returns false if no enriched data is available.
TryCopyStateSlice(int, float[], long)¶
static
TryGetAgentByName(string, RobotAgent?, int)¶
static
TryGetAgentSizes(int, int, int)¶
static
TryGetExternalActionLayout(int, int, int)¶
static
public static bool TryGetExternalActionLayout(out int agentCount, out int actionSize, out int totalActionSize)
TryGetMujocoEntity(Entity)¶
static
TryResetAgentByName(string, Hazel.Rpc.SimulationContract?, string)¶
static
public static bool TryResetAgentByName(string agentName, Hazel.Rpc.SimulationContract? simulationContract, out string message)
TrySetExternalActions(IReadOnlyList)¶
static
Unregister(RobotManager)¶
static
WaitForFrameAsync(long, CancellationToken, float)¶
static
public static Task<long> WaitForFrameAsync(long currentFrame, CancellationToken cancellationToken, float timeoutS = 0.1f)
Source: Hazel/Learn/Utilities/ExternalAgentRegistry.cs