namespace Unity.MLAgents.Actuators { /// /// Abstraction that facilitates the execution of actions. /// public interface IActuator : IActionReceiver, IHeuristicProvider { /// /// The specification of the actions for this IActuator. /// /// ActionSpec ActionSpec { get; } /// /// Gets the name of this IActuator which will be used to sort it. /// /// string Name { get; } /// /// Resets the internal state of the actuator. This is called at the end of an Agent's episode. /// Most implementations can leave this empty. /// void ResetData(); } /// /// Helper methods to be shared by all classes that implement . /// public static class IActuatorExtensions { /// /// Returns the number of discrete branches + the number of continuous actions. /// /// /// public static int TotalNumberOfActions(this IActuator actuator) { return actuator.ActionSpec.NumContinuousActions + actuator.ActionSpec.NumDiscreteActions; } } }