浏览代码

Fixes agent infinite resetting bug (#1332)

The check for wether an agent has fallen off the platform was using a wrong value of 1 instead of 0. 
This meant that the agent immediately started in a falling state and entered a thrashing cycle of resetting itself.
/develop-generalizationTraining-TrainerController
Arthur Juliani 6 年前
当前提交
ea5b5ddb
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 8
      docs/Learning-Environment-Create-New.md

8
docs/Learning-Environment-Create-New.md


public Transform Target;
public override void AgentReset()
{
if (this.transform.position.y < -1.0)
if (this.transform.position.y < 0)
this.transform.position = Vector3.zero;
this.transform.position = new Vector3(0, 0.5f, 0);
this.rBody.angularVelocity = Vector3.zero;
this.rBody.velocity = Vector3.zero;
}

```csharp
// Fell off platform
if (this.transform.position.y < -1.0)
if (this.transform.position.y < 0)
{
AddReward(-1.0f);
Done();

AddReward(-0.05f);
// Fell off platform
if (this.transform.position.y < -1.0)
if (this.transform.position.y < 0)
{
AddReward(-1.0f);
Done();

正在加载...
取消
保存