浏览代码

Modified the documentation of the Heuristic method (default action = previous action) (#4174)

* Modifying the documentation to explain that Heuristic method default action will be the previous action decided by the heuristic. Changing this behavior would be a breking change.

* Rephrase the working of the documentation of the default action of the Heuristic method

* Forgot an import
/MLA-1734-demo-provider
GitHub 5 年前
当前提交
6ee553d8
共有 3 个文件被更改,包括 4 次插入0 次删除
  1. 1
      Project/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccer.cs
  2. 1
      Project/Assets/ML-Agents/Examples/WallJump/Scripts/WallJumpAgent.cs
  3. 2
      com.unity.ml-agents/Runtime/Agent.cs

1
Project/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccer.cs


public override void Heuristic(float[] actionsOut)
{
Array.Clear(actionsOut, 0, actionsOut.Length);
//forward
if (Input.GetKey(KeyCode.W))
{

1
Project/Assets/ML-Agents/Examples/WallJump/Scripts/WallJumpAgent.cs


public override void Heuristic(float[] actionsOut)
{
System.Array.Clear(actionsOut, 0, actionsOut.Length);
if (Input.GetKey(KeyCode.D))
{
actionsOut[1] = 2f;

2
com.unity.ml-agents/Runtime/Agent.cs


///
/// Your heuristic implementation can use any decision making logic you specify. Assign decision
/// values to the float[] array, <paramref name="actionsOut"/>, passed to your function as a parameter.
/// The same array will be reused between steps. It is up to the user to initialize
/// the values on each call, for example by calling `Array.Clear(actionsOut, 0, actionsOut.Length);`.
/// Add values to the array at the same indexes as they are used in your
/// <seealso cref="OnActionReceived(float[])"/> function, which receives this array and
/// implements the corresponding agent behavior. See [Actions] for more information

正在加载...
取消
保存