Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing package validation errors. #3808

Merged
merged 4 commits into from
Apr 20, 2020
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
5 changes: 4 additions & 1 deletion com.unity.ml-agents/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ and this project adheres to
communication between Unity and the Python process.
- The obsolete `Agent` methods `GiveModel`, `Done`, `InitializeAgent`,
`AgentAction` and `AgentReset` have been removed.
- The GhostTrainer has been extended to support asymmetric games and the asymmetric example environment Strikers Vs. Goalie has been added.
- The GhostTrainer has been extended to support asymmetric games and the
asymmetric example environment Strikers Vs. Goalie has been added.
- CameraSensorComponent.m_Grayscale and RenderTextureSensorComponent.m_Grayscale
were changed from `public` to `private` (#3808).

### Minor Changes

Expand Down
3 changes: 3 additions & 0 deletions com.unity.ml-agents/Editor/EditorUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace MLAgents.Editor
{
/// <summary>
/// A static helper class for the Editor components of the ML-Agents SDK.
/// </summary>
public static class EditorUtilities
{
/// <summary>
Expand Down
5 changes: 2 additions & 3 deletions com.unity.ml-agents/Runtime/Agent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -524,10 +524,9 @@ public virtual void Initialize(){}
/// <summary>
/// When the Agent uses Heuristics, it will call this method every time it
/// needs an action. This can be used for debugging or controlling the agent
/// with keyboard.
/// with keyboard. This can also be useful to record demonstrations for imitation learning.
/// </summary>
/// <returns> A float array corresponding to the next action of the Agent
/// </returns>
/// <param name="actionsOut">An array corresponding to the next action of the Agent</param>
public virtual void Heuristic(float[] actionsOut)
{
Debug.LogWarning("Heuristic method called but not implemented. Returning placeholder actions.");
Expand Down
3 changes: 3 additions & 0 deletions com.unity.ml-agents/Runtime/Policies/BrainParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public class BrainParameters
/// </summary>
public SpaceType vectorActionSpaceType = SpaceType.Discrete;

/// <summary>
/// The number of actions specified by this Brain.
/// </summary>
public int numActions
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public int height
}

[HideInInspector, SerializeField, FormerlySerializedAs("grayscale")]
public bool m_Grayscale;
bool m_Grayscale;
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, this was supposed to be private (there are public properties below)


/// <summary>
/// Whether to generate grayscale images or color.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public class RenderTextureSensorComponent : SensorComponent
[HideInInspector, SerializeField, FormerlySerializedAs("renderTexture")]
RenderTexture m_RenderTexture;

/// <summary>
/// Stores the <see cref="RenderTexture"/> associated with this sensor.
/// </summary>
public RenderTexture renderTexture
{
get { return m_RenderTexture; }
Expand All @@ -38,7 +41,7 @@ public string sensorName
}

[HideInInspector, SerializeField, FormerlySerializedAs("grayscale")]
public bool m_Grayscale;
bool m_Grayscale;

/// <summary>
/// Whether the RenderTexture observation should be converted to grayscale or not.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
namespace MLAgents.SideChannels
{
/// <summary>
/// Side channel that is comprised of a collection of float variables, represented by
/// <see cref="IFloatProperties"/>
/// Side channel that is comprised of a collection of float variables.
/// </summary>
public class FloatPropertiesChannel : SideChannel
{
Expand Down Expand Up @@ -58,21 +57,18 @@ public void SetProperty(string key, float value)
action?.Invoke(value);
}

/// <inheritdoc/>
public float GetPropertyWithDefault(string key, float defaultValue)
{
float valueOut;
bool hasKey = m_FloatProperties.TryGetValue(key, out valueOut);
return hasKey ? valueOut : defaultValue;
}

/// <inheritdoc/>
public void RegisterCallback(string key, Action<float> action)
{
m_RegisteredActions[key] = action;
}

/// <inheritdoc/>
public IList<string> ListProperties()
{
return new List<string>(m_FloatProperties.Keys);
Expand Down
2 changes: 1 addition & 1 deletion com.unity.ml-agents/Runtime/SideChannels/SideChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public Guid ChannelId
/// <summary>
/// Queues a message to be sent to Python during the next simulation step.
/// </summary>
/// <param name="data"> The byte array of data to be sent to Python.</param>
/// <param name="msg"> The byte array of data to be sent to Python.</param>
protected void QueueMessageToSend(OutgoingMessage msg)
{
MessageQueue.Add(msg.ToByteArray());
Expand Down
4 changes: 4 additions & 0 deletions com.unity.ml-agents/Runtime/SideChannels/SideChannelUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@

namespace MLAgents.SideChannels
{
/// <summary>
/// Collection of static utilities for managing the registering/unregistering of
/// <see cref="SideChannels"/> and the sending/receiving of messages for all the channels.
/// </summary>
public static class SideChannelUtils
{

Expand Down