浏览代码

add randomize speed bool

/active-variablespeed
HH 5 年前
当前提交
f83c2f8a
共有 1 个文件被更改,包括 5 次插入3 次删除
  1. 8
      Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgent.cs

8
Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgent.cs


public class WalkerAgent : Agent
{
[Range(0, 15)]
public float walkingSpeed = 15; //The max walk velocity magnitude an agent will be rewarded for
public float walkingSpeed = 15; //The walking speed to try and achieve
float m_maxWalkingSpeed = 15; //The max walking speed
public bool randomizeWalkSpeedEachEpisode;
Vector3 m_WalkDir; //Direction to the target
[Header("Target To Walk Towards")] [Space(10)]

rewardManager.ResetEpisodeRewards();
walkingSpeed = Random.Range(0.0f, 15f); //Random Walk Speed
walkingSpeed = randomizeWalkSpeedEachEpisode? Random.Range(0.0f, m_maxWalkingSpeed): walkingSpeed; //Random Walk Speed
SetResetParameters();
}

正在加载...
取消
保存