Skip to content

MdpObservationAttribute

class · namespace Hazel

Attributes for marking user C# script methods as MDP components. Users place C# scripts in RobotSandbox/Assets/Scripts/Source/ and decorate static methods with these attributes. The ScriptEngine discovers them at runtime via MdpScriptDiscovery and registers them in the MdpComponentRegistry. Example:

public class CustomRewards
{
    [MdpReward("upright_bonus", Description = "Reward for staying upright",
               Category = "locomotion")]
    public static float UprightBonus(MdpContext ctx, Dictionary<string, string> parameters)
    {
        // ... compute reward from ctx.MujocoScene, ctx.Agent, etc.
        return value;
    }
}

Inherits Attribute

public sealed class MdpObservationAttribute : Attribute

Constructors

MdpObservationAttribute(string)

public MdpObservationAttribute(string name)

Properties

Category

public string Category { get; set; }

Description

public string Description { get; set; }

Name

public string Name { get; }

OutputSize

public int OutputSize { get; set; }

RobotTypes

public string[] RobotTypes { get; set; }

Source: Hazel/Learn/MdpAttributes.cs