浏览代码

add hh rew

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

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


//This reward will approach 1 if it faces the target direction perfectly and approach zero as it deviates
var lookAtTargetReward = (Vector3.Dot(cubeForward, head.forward) + 1) * .5F;
// c. Encourage head height.
// headHeightOverFeetReward =
// Mathf.Clamp01(((head.position.y - footL.position.y) + (head.position.y - footR.position.y))/ 10); //Should normalize to ~1
var headHeightOverFeetReward =
Mathf.Clamp01(((head.position.y - footL.position.y) + (head.position.y - footR.position.y))/ 10); //Should normalize to ~1
// rewardManager.rewardsDict["headHeightOverFeet"].rewardThisStep = headHeightOverFeetReward;
rewardManager.UpdateReward("productOfAllRewards", matchSpeedReward * lookAtTargetReward);
rewardManager.rewardsDict["headHeightOverFeet"].rewardThisStep = headHeightOverFeetReward;
rewardManager.UpdateReward("productOfAllRewards", matchSpeedReward * lookAtTargetReward * headHeightOverFeetReward);
// rewardManager.UpdateReward("productOfAllRewards", matchSpeedReward * lookAtTargetReward);
}
//Returns the average velocity of all the rigidbodies

正在加载...
取消
保存