Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ public byte[] GetCompressedObservation()
return null;
}

public CompressionType GetCompressionType()
public SensorCompressionType GetCompressionType()
{
return CompressionType.None;
return SensorCompressionType.None;
}

public string GetName()
Expand Down
29 changes: 25 additions & 4 deletions UnitySDK/Assets/ML-Agents/Editor/Tests/StandaloneBuildTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using UnityEditor;
using UnityEngine;
#if UNITY_2018_1_OR_NEWER
using UnityEditor.Build.Reporting;
#endif

namespace MLAgents
{
Expand All @@ -9,19 +12,37 @@ public class StandaloneBuildTest
static void BuildStandalonePlayerOSX()
{
string[] scenes = { "Assets/ML-Agents/Examples/3DBall/Scenes/3DBall.unity" };
var error = BuildPipeline.BuildPlayer(scenes, "testPlayer", BuildTarget.StandaloneOSX, BuildOptions.None);
if (string.IsNullOrEmpty(error))
var buildResult = BuildPipeline.BuildPlayer(scenes, "testPlayer", BuildTarget.StandaloneOSX, BuildOptions.None);
#if UNITY_2018_1_OR_NEWER
var isOK = buildResult.summary.result == BuildResult.Succeeded;
var error = "";
foreach (var stepInfo in buildResult.steps)
{
foreach (var msg in stepInfo.messages)
{
if (msg.type != LogType.Log && msg.type != LogType.Warning)
{
error += msg.content + "\n";
}
}
}
#else
var error = buildResult;
var isOK = string.IsNullOrEmpty(error);
#endif
if (isOK)
{
EditorApplication.Exit(0);
}
else
{
Console.Error.WriteLine(error);
EditorApplication.Exit(1);

}
Debug.Log(error);

}

}
}
12 changes: 6 additions & 6 deletions UnitySDK/Assets/ML-Agents/Scripts/Agent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public class AgentParameters
/// of the environment extracts its current observation, sends them to its
/// policy and in return receives an action. In practice,
/// however, an agent need not send its observation at every step since very
/// little may have changed between successive steps.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDE must have done this. I'll revert if it's too noisy for this PR.

/// little may have changed between successive steps.
///
/// At any step, an agent may be considered <see cref="m_Done"/>.
/// This could occur due to a variety of reasons:
Expand Down Expand Up @@ -328,15 +328,15 @@ void OnDisable()

/// <summary>
/// Updates the Model for the agent. Any model currently assigned to the
/// agent will be replaced with the provided one. If the arguments are
/// agent will be replaced with the provided one. If the arguments are
/// identical to the current parameters of the agent, the model will
/// remain unchanged.
/// remain unchanged.
/// </summary>
/// <param name="behaviorName"> The identifier of the behavior. This
/// will categorize the agent when training.
/// <param name="behaviorName"> The identifier of the behavior. This
/// will categorize the agent when training.
/// </param>
/// <param name="model"> The model to use for inference.</param>
/// <param name = "inferenceDevide"> Define on what device the model
/// <param name = "inferenceDevide"> Define on what device the model
/// will be run.</param>
public void GiveModel(
string behaviorName,
Expand Down
4 changes: 2 additions & 2 deletions UnitySDK/Assets/ML-Agents/Scripts/Sensor/CameraSensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ public void WriteToTensor(TensorProxy tensorProxy, int agentIndex)
}
}

public CompressionType GetCompressionType()
public SensorCompressionType GetCompressionType()
{
return CompressionType.PNG;
return SensorCompressionType.PNG;
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using MLAgents.InferenceBrain;
using UnityEngine;

namespace MLAgents.Sensor
Expand All @@ -14,7 +13,7 @@ public struct CompressedObservation
/// <summary>
/// The format of the compressed data
/// </summary>
public CompressionType CompressionType;
public SensorCompressionType CompressionType;

/// <summary>
/// The uncompressed dimensions of the data.
Expand Down
6 changes: 3 additions & 3 deletions UnitySDK/Assets/ML-Agents/Scripts/Sensor/ISensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace MLAgents.Sensor
{
public enum CompressionType
public enum SensorCompressionType
{
None,
PNG,
Expand Down Expand Up @@ -38,10 +38,10 @@ public interface ISensor {
byte[] GetCompressedObservation();

/// <summary>
/// Return the compression type being used. If no compression is used, return CompressionType.None
/// Return the compression type being used. If no compression is used, return SensorCompressionType.None
/// </summary>
/// <returns></returns>
CompressionType GetCompressionType();
SensorCompressionType GetCompressionType();

/// <summary>
/// Get the name of the sensor. This is used to ensure deterministic sorting of the sensors on an Agent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public void WriteToTensor(TensorProxy tensorProxy, int index)
}
}

public CompressionType GetCompressionType()
public SensorCompressionType GetCompressionType()
{
return CompressionType.PNG;
return SensorCompressionType.PNG;
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions UnitySDK/Assets/ML-Agents/Scripts/Sensor/SensorBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public virtual byte[] GetCompressedObservation()
return null;
}

public virtual CompressionType GetCompressionType()
public virtual SensorCompressionType GetCompressionType()
{
return CompressionType.None;
return SensorCompressionType.None;
}
}
}