浏览代码

Made the decision requester internal and renamed RepeatAction (#3555)

* [skip ci] made the decision requester internal and renamed RepeatAction

* [skip ci] Updated the migration

* Update com.unity.ml-agents/Runtime/DecisionRequester.cs

Co-Authored-By: Chris Elion <chris.elion@unity3d.com>

* Run tests

Co-authored-by: Chris Elion <celion@gmail.com>
/bug-failed-api-check
GitHub 5 年前
当前提交
104c33e1
共有 3 个文件被更改,包括 7 次插入5 次删除
  1. 2
      com.unity.ml-agents/CHANGELOG.md
  2. 9
      com.unity.ml-agents/Runtime/DecisionRequester.cs
  3. 1
      docs/Migrating.md

2
com.unity.ml-agents/CHANGELOG.md


- The `Agent` class is no longer abstract.
- SensorBase was moved out of the package and into the Examples directory.
- `AgentInfo.actionMasks` has been renamed to `AgentInfo.discreteActionMasks`.
- `DecisionRequester` has been made internal (you can still use the DecisionRequesterComponent from the inspector). `RepeatAction` was renamed `TakeActionsBetweenDecisions` for clarity. (#3555)
## [0.14.1-preview] - 2020-02-25

9
com.unity.ml-agents/Runtime/DecisionRequester.cs


using System.Runtime.CompilerServices;
using UnityEngine.Serialization;
namespace MLAgents
{

/// </summary>
[AddComponentMenu("ML Agents/Decision Requester", (int)MenuGroup.Default)]
public class DecisionRequester : MonoBehaviour
internal class DecisionRequester : MonoBehaviour
{
/// <summary>
/// The frequency with which the agent requests a decision. A DecisionPeriod of 5 means

[Tooltip("Indicates whether or not the agent will take an action during the Academy " +
"steps where it does not request a decision. Has no effect when DecisionPeriod " +
"is set to 1.")]
public bool RepeatAction = true;
[FormerlySerializedAs("RepeatAction")]
public bool TakeActionsBetweenDecisions = true;
/// <summary>
/// Whether or not the Agent decisions should start at an offset (different for each agent).

{
m_Agent?.RequestDecision();
}
if (RepeatAction)
if (TakeActionsBetweenDecisions)
{
m_Agent?.RequestAction();
}

1
docs/Migrating.md


* `AgentInfo.actionMasks` has been renamed to `AgentInfo.discreteActionMasks`.
* `BrainParameters` and `SpaceType` have been removed from the public API
* `BehaviorParameters` have been removed from the public API.
* `DecisionRequester` has been made internal (you can still use the DecisionRequesterComponent from the inspector). `RepeatAction` was renamed `TakeActionsBetweenDecisions` for clarity.
### Steps to Migrate
* Add the `using MLAgents.Sensors;` in addition to `using MLAgents;` on top of your Agent's script.

正在加载...
取消
保存