浏览代码

clamp hh

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

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


// m_JdController.bodyPartsDict[hips].rb.velocity).sqrMagnitude);
// c. Encourage head height.
headHeightOverFeetReward =
(((head.position.y - footL.position.y) + (head.position.y - footR.position.y))/ 10); //Should normalize to ~1
Mathf.Clamp01(((head.position.y - footL.position.y) + (head.position.y - footR.position.y))/ 10); //Should normalize to ~1
// AddReward(
// +0.02f * moveTowardsTargetReward
// + 0.01f * lookAtTargetReward

// avgVelValue = velSum/4;
// velInverseLerpVal = VelocityInverseLerp(cubeForward * walkingSpeed, avgVelValue);
velInverseLerpVal = VelocityInverseLerp(cubeForward * walkingSpeed);
rewardManager.rewardsDict["matchSpeed"].rewardThisStep = velInverseLerpVal;
rewardManager.rewardsDict["lookAtTarget"].rewardThisStep = lookAtTargetReward;
rewardManager.rewardsDict["headHeightOverFeet"].rewardThisStep = headHeightOverFeetReward;
// velInverseLerpVal = VelocityInverseLerp(cubeForward * walkGroup.walkingSpeed);
// rewardManager.UpdateReward("productOfAllRewards", velInverseLerpVal * lookAtTargetReward);
rewardManager.UpdateReward("productOfAllRewards", velInverseLerpVal * lookAtTargetReward * headHeightOverFeetReward);

正在加载...
取消
保存