File tree Expand file tree Collapse file tree 6 files changed +7
-6
lines changed
com.unity.ml-agents.extensions/Runtime/Input Expand file tree Collapse file tree 6 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ namespace Unity.MLAgents.Extensions.Input
1414 /// <see cref="Agent"/>'s <see cref="BehaviorParameters"/> indicate that the Agent is running in Heuristic Mode,
1515 /// this Actuator will write actions from the <see cref="InputSystem"/> to the <see cref="ActionBuffers"/> object.
1616 /// </summary>
17- public class InputActionActuator : IActuator , IHeuristicProvider , IBuiltInActuator
17+ public class InputActionActuator : IActuator , IBuiltInActuator
1818 {
1919 readonly BehaviorParameters m_BehaviorParameters ;
2020 readonly InputAction m_Action ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ details.
1616- The interface for disabling discrete actions in ` IDiscreteActionMask ` has changed.
1717` WriteMask(int branch, IEnumerable<int> actionIndices) ` was replaced with
1818` SetActionEnabled(int branch, int actionIndex, bool isEnabled) ` . See the
19+ - IActuator now implements IHeuristicProvider. (#5110 )
1920[ Migration Guide] ( https://github.com/Unity-Technologies/ml-agents/blob/release_14_docs/docs/Migrating.md ) for more
2021details. (#5060 )
2122#### ml-agents / ml-agents-envs / gym-unity (Python)
Original file line number Diff line number Diff line change @@ -244,9 +244,7 @@ public void ApplyHeuristic(in ActionBuffers actionBuffersOut)
244244 discreteStart ,
245245 numDiscreteActions ) ;
246246 }
247-
248- var heuristic = actuator as IHeuristicProvider ;
249- heuristic ? . Heuristic ( new ActionBuffers ( continuousActions , discreteActions ) ) ;
247+ actuator . Heuristic ( new ActionBuffers ( continuousActions , discreteActions ) ) ;
250248 continuousStart += numContinuousActions ;
251249 discreteStart += numDiscreteActions ;
252250 }
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ namespace Unity.MLAgents.Actuators
33 /// <summary>
44 /// Abstraction that facilitates the execution of actions.
55 /// </summary>
6- public interface IActuator : IActionReceiver
6+ public interface IActuator : IActionReceiver , IHeuristicProvider
77 {
88 /// <summary>
99 /// The specification of the actions for this IActuator.
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ namespace Unity.MLAgents.Actuators
55 /// <summary>
66 /// IActuator implementation that forwards calls to an <see cref="IActionReceiver"/> and an <see cref="IHeuristicProvider"/>.
77 /// </summary>
8- internal class VectorActuator : IActuator , IHeuristicProvider , IBuiltInActuator
8+ internal class VectorActuator : IActuator , IBuiltInActuator
99 {
1010 IActionReceiver m_ActionReceiver ;
1111 IHeuristicProvider m_HeuristicProvider ;
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ public override void WriteDiscreteActionMask(IDiscreteActionMask actionMask)
4141 actionMask .SetActionEnabled (branch , 3 , false );
4242}
4343```
44+ - The ` IActuator ` interface now implements ` IHeuristicProvider ` . Please add the corresponding ` Heuristic(in ActionBuffers) `
45+ method to your custom Actuator classes.
4446
4547- The ` ISensor.GetObservationShape() ` method was removed, and ` GetObservationSpec() ` was added. You can use
4648` ObservationSpec.Vector() ` or ` ObservationSpec.Visual() ` to generate ` ObservationSpec ` s that are equivalent to
You can’t perform that action at this time.
0 commit comments