浏览代码

switch to approved with moving target

/active-variablespeed
HH 4 年前
当前提交
675f1ae4
共有 4 个文件被更改,包括 20 次插入20 次删除
  1. 18
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/GroundContact.cs
  2. 4
      Project/Assets/ML-Agents/Examples/Walker/Prefabs/DynamicPlatformWalker.prefab
  3. 14
      Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerDynamic.unity
  4. 4
      Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgent.cs

18
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/GroundContact.cs


touchingGround = true;
if (penalizeGroundContact)
{
// agent.SetReward(groundContactPenalty);
agent.SetReward(0);
agent.SetReward(groundContactPenalty);
// agent.SetReward(0);
}
if (agentDoneOnGroundContact)

}
}
void FixedUpdate()
{
if (touchingGround)
{
agent.SetReward(0);
}
}
// void FixedUpdate()
// {
// if (touchingGround)
// {
// agent.SetReward(0);
// }
// }
/// <summary>
/// Check for end of ground collision and reset flag appropriately.

4
Project/Assets/ML-Agents/Examples/Walker/Prefabs/DynamicPlatformWalker.prefab


- target: {fileID: 895268871377934275, guid: 765582efd9dda46ed98564603316353f,
type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 895268871377934297, guid: 765582efd9dda46ed98564603316353f,
type: 3}

- target: {fileID: 895268871377934275, guid: 765582efd9dda46ed98564603316353f,
type: 3}
propertyPath: m_IsActive
value: 1
value: 0
objectReference: {fileID: 0}
- target: {fileID: 895268871377934297, guid: 765582efd9dda46ed98564603316353f,
type: 3}

14
Project/Assets/ML-Agents/Examples/Walker/Scenes/WalkerDynamic.unity


debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!4 &46752906 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4415586145134694852, guid: f51e8260728fd4c8fa87bcda9d0e2027,
type: 3}
m_PrefabInstance: {fileID: 758428434940870731}
m_PrefabAsset: {fileID: 0}
--- !u!114 &79411373 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 758428434940870733, guid: f51e8260728fd4c8fa87bcda9d0e2027,

m_Script: {fileID: 11500000, guid: ec40c70d5160b47cd8deaab79e24892c, type: 3}
m_Name:
m_EditorClassIdentifier:
target: {fileID: 758428434940870732}
target: {fileID: 46752906}
--- !u!1001 &1481808307
PrefabInstance:
m_ObjectHideFlags: 0

objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: f51e8260728fd4c8fa87bcda9d0e2027, type: 3}
--- !u!4 &758428434940870732 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6406643706347117530, guid: f51e8260728fd4c8fa87bcda9d0e2027,
type: 3}
m_PrefabInstance: {fileID: 758428434940870731}
m_PrefabAsset: {fileID: 0}

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


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);
rewardManager.UpdateReward("productOfAllRewards", velInverseLerpVal * lookAtTargetReward);
// rewardManager.UpdateReward("productOfAllRewards", velInverseLerpVal * lookAtTargetReward * headHeightOverFeetReward);
// velInverseLerpVal = VelocityInverseLerp(Vector3.zero, cubeForward * walkingSpeed, avgVelValue);
//This reward will approach 1 if it matches and approach zero as it deviates

正在加载...
取消
保存