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
14
14
/// <see cref="Agent"/>'s <see cref="BehaviorParameters"/> indicate that the Agent is running in Heuristic Mode,
15
15
/// this Actuator will write actions from the <see cref="InputSystem"/> to the <see cref="ActionBuffers"/> object.
16
16
/// </summary>
17
- public class InputActionActuator : IActuator , IHeuristicProvider , IBuiltInActuator
17
+ public class InputActionActuator : IActuator , IBuiltInActuator
18
18
{
19
19
readonly BehaviorParameters m_BehaviorParameters ;
20
20
readonly InputAction m_Action ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ details.
16
16
- The interface for disabling discrete actions in ` IDiscreteActionMask ` has changed.
17
17
` WriteMask(int branch, IEnumerable<int> actionIndices) ` was replaced with
18
18
` SetActionEnabled(int branch, int actionIndex, bool isEnabled) ` . See the
19
+ - IActuator now implements IHeuristicProvider. (#5110 )
19
20
[ Migration Guide] ( https://github.com/Unity-Technologies/ml-agents/blob/release_14_docs/docs/Migrating.md ) for more
20
21
details. (#5060 )
21
22
#### 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)
244
244
discreteStart ,
245
245
numDiscreteActions ) ;
246
246
}
247
-
248
- var heuristic = actuator as IHeuristicProvider ;
249
- heuristic ? . Heuristic ( new ActionBuffers ( continuousActions , discreteActions ) ) ;
247
+ actuator . Heuristic ( new ActionBuffers ( continuousActions , discreteActions ) ) ;
250
248
continuousStart += numContinuousActions ;
251
249
discreteStart += numDiscreteActions ;
252
250
}
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ namespace Unity.MLAgents.Actuators
3
3
/// <summary>
4
4
/// Abstraction that facilitates the execution of actions.
5
5
/// </summary>
6
- public interface IActuator : IActionReceiver
6
+ public interface IActuator : IActionReceiver , IHeuristicProvider
7
7
{
8
8
/// <summary>
9
9
/// 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
5
5
/// <summary>
6
6
/// IActuator implementation that forwards calls to an <see cref="IActionReceiver"/> and an <see cref="IHeuristicProvider"/>.
7
7
/// </summary>
8
- internal class VectorActuator : IActuator , IHeuristicProvider , IBuiltInActuator
8
+ internal class VectorActuator : IActuator , IBuiltInActuator
9
9
{
10
10
IActionReceiver m_ActionReceiver ;
11
11
IHeuristicProvider m_HeuristicProvider ;
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ public override void WriteDiscreteActionMask(IDiscreteActionMask actionMask)
41
41
actionMask .SetActionEnabled (branch , 3 , false );
42
42
}
43
43
```
44
+ - The ` IActuator ` interface now implements ` IHeuristicProvider ` . Please add the corresponding ` Heuristic(in ActionBuffers) `
45
+ method to your custom Actuator classes.
44
46
45
47
- The ` ISensor.GetObservationShape() ` method was removed, and ` GetObservationSpec() ` was added. You can use
46
48
` 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