浏览代码

Remove monitor (#3372)

* Removing the monitor

* Editing the migrating docs

* Readding the Monitor in the examples folder

* Editing the Migrating doc
/asymm-envs
GitHub 5 年前
当前提交
ae9d12b5
共有 8 个文件被更改,包括 18 次插入25 次删除
  1. 1
      Project/Assets/ML-Agents/Examples/FoodCollector/Scripts/FoodCollectorAgent.cs
  2. 8
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/ProjectSettingsOverrides.cs
  3. 3
      com.unity.ml-agents/Runtime/DemonstrationRecorder.cs
  4. 4
      docs/Migrating.md
  5. 4
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/Monitor.cs
  6. 11
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/Monitor.cs.meta
  7. 12
      com.unity.ml-agents/Runtime/Monitor.cs.meta
  8. 0
      /Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/Monitor.cs

1
Project/Assets/ML-Agents/Examples/FoodCollector/Scripts/FoodCollectorAgent.cs


{
base.InitializeAgent();
m_AgentRb = GetComponent<Rigidbody>();
Monitor.verticalOffset = 1f;
m_MyArea = area.GetComponent<FoodCollectorArea>();
m_FoodCollecterSettings = FindObjectOfType<FoodCollectorSettings>();

8
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/ProjectSettingsOverrides.cs


public class ProjectSettingsOverrides : MonoBehaviour
{
// Original values
float m_OriginalMonitorVerticalOffset;
Vector3 m_OriginalGravity;
float m_OriginalFixedDeltaTime;
float m_OriginalMaximumDeltaTime;

[Tooltip("Increase or decrease the scene gravity. Use ~3x to make things less floaty")]
public float gravityMultiplier = 1.0f;
[Header("Display Settings")]
public float monitorVerticalOffset;
[Header("Advanced physics settings")]
[Tooltip("The interval in seconds at which physics and other fixed frame rate updates (like MonoBehaviour's FixedUpdate) are performed.")]
public float fixedDeltaTime = .02f;

public void Awake()
{
// Save the original values
m_OriginalMonitorVerticalOffset = Monitor.verticalOffset;
m_OriginalGravity = Physics.gravity;
m_OriginalFixedDeltaTime = Time.fixedDeltaTime;
m_OriginalMaximumDeltaTime = Time.maximumDeltaTime;

// Override
Monitor.verticalOffset = monitorVerticalOffset;
Physics.gravity *= gravityMultiplier;
Time.fixedDeltaTime = fixedDeltaTime;
Time.maximumDeltaTime = maximumDeltaTime;

public void OnDestroy()
{
Monitor.verticalOffset = m_OriginalMonitorVerticalOffset;
Physics.gravity = m_OriginalGravity;
Time.fixedDeltaTime = m_OriginalFixedDeltaTime;
Time.maximumDeltaTime = m_OriginalMaximumDeltaTime;

3
com.unity.ml-agents/Runtime/DemonstrationRecorder.cs


{
public bool record;
public string demonstrationName;
Agent m_RecordingAgent;
string m_FilePath;
DemonstrationStore m_DemoStore;
public const int MaxNameLength = 16;

/// </summary>
public void InitializeDemoStore(IFileSystem fileSystem = null)
{
m_RecordingAgent = GetComponent<Agent>();
m_DemoStore = new DemonstrationStore(fileSystem);
var behaviorParams = GetComponent<BehaviorParameters>();
demonstrationName = SanitizeName(demonstrationName, MaxNameLength);

behaviorParams.fullyQualifiedBehaviorName);
Monitor.Log("Recording Demonstration of Agent: ", m_RecordingAgent.name);
}
/// <summary>

4
docs/Migrating.md


# Migrating
## Migrating from 0.14 to latest
* The `Monitor` class has been moved to the Examples Project. (It was prone to errors during testing)
## Migrating from 0.13 to 0.14

4
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/Monitor.cs


using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

s_RedStyle = s_ColorStyle[5];
}
}
}
}

11
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/Monitor.cs.meta


fileFormatVersion: 2
guid: eca114d0a5b45439384024291ba7d40a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

12
com.unity.ml-agents/Runtime/Monitor.cs.meta


fileFormatVersion: 2
guid: e59a31a1cc2f5464d9a61bef0bc9a53b
timeCreated: 1508031727
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

/com.unity.ml-agents/Runtime/Monitor.cs → /Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/Monitor.cs

正在加载...
取消
保存