Skip to content

Commit 4059581

Browse files
author
Chris Elion
authored
make some more classes and methods internal (#3353)
* WIP public->internal * DemoStore back to public, internal on Timers
1 parent 6be5d2f commit 4059581

File tree

7 files changed

+15
-15
lines changed

7 files changed

+15
-15
lines changed

com.unity.ml-agents/Runtime/ActionMasker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ internal class ActionMasker
1414

1515
readonly BrainParameters m_BrainParameters;
1616

17-
public ActionMasker(BrainParameters brainParameters)
17+
internal ActionMasker(BrainParameters brainParameters)
1818
{
1919
m_BrainParameters = brainParameters;
2020
}

com.unity.ml-agents/Runtime/ICommunicator.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace MLAgents
88
{
9-
public struct CommunicatorInitParameters
9+
internal struct CommunicatorInitParameters
1010
{
1111
/// <summary>
1212
/// Port to listen for connections on.
@@ -21,14 +21,14 @@ public struct CommunicatorInitParameters
2121
/// </summary>
2222
public string version;
2323
}
24-
public struct UnityRLInitParameters
24+
internal struct UnityRLInitParameters
2525
{
2626
/// <summary>
2727
/// An RNG seed sent from the python process to Unity.
2828
/// </summary>
2929
public int seed;
3030
}
31-
public struct UnityRLInputParameters
31+
internal struct UnityRLInputParameters
3232
{
3333
/// <summary>
3434
/// Boolean sent back from python to indicate whether or not training is happening.
@@ -39,19 +39,19 @@ public struct UnityRLInputParameters
3939
/// <summary>
4040
/// Delegate for handling quite events sent back from the communicator.
4141
/// </summary>
42-
public delegate void QuitCommandHandler();
42+
internal delegate void QuitCommandHandler();
4343

4444
/// <summary>
4545
/// Delegate for handling reset parameter updates sent from the communicator.
4646
/// </summary>
4747
/// <param name="resetParams"></param>
48-
public delegate void ResetCommandHandler();
48+
internal delegate void ResetCommandHandler();
4949

5050
/// <summary>
5151
/// Delegate to handle UnityRLInputParameters updates from the communicator.
5252
/// </summary>
5353
/// <param name="inputParams"></param>
54-
public delegate void RLInputReceivedHandler(UnityRLInputParameters inputParams);
54+
internal delegate void RLInputReceivedHandler(UnityRLInputParameters inputParams);
5555

5656
/**
5757
This is the interface of the Communicators.

com.unity.ml-agents/Runtime/Policy/RemotePolicy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ internal class RemotePolicy : IPolicy
1515
int m_AgentId;
1616
string m_FullyQualifiedBehaviorName;
1717

18-
protected ICommunicator m_Communicator;
18+
internal ICommunicator m_Communicator;
1919

2020
/// <inheritdoc />
2121
public RemotePolicy(

com.unity.ml-agents/Runtime/Sensor/Observation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace MLAgents.Sensor
55
{
6-
public struct Observation
6+
internal struct Observation
77
{
88
/// <summary>
99
/// The compressed sensor data. Assumed to be non-null if CompressionType != CompressionType.None

com.unity.ml-agents/Runtime/Sensor/SensorShapeValidator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace MLAgents.Sensor
55
{
6-
public class SensorShapeValidator
6+
internal class SensorShapeValidator
77
{
88
private List<int[]> m_SensorShapes;
99

com.unity.ml-agents/Runtime/Sensor/StackingSensor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace MLAgents.Sensor
77
/// | t = now - 3 | t = now -3 | t = now - 2 | t = now |
88
/// Internally, a circular buffer of arrays is used. The m_CurrentIndex represents the most recent observation.
99
/// </summary>
10-
public class StackingSensor : ISensor
10+
internal class StackingSensor : ISensor
1111
{
1212
/// <summary>
1313
/// The wrapped sensor.

com.unity.ml-agents/Runtime/Timer.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
namespace MLAgents
1212
{
1313
[DataContract]
14-
public class TimerNode
14+
internal class TimerNode
1515
{
1616
static string s_Separator = ".";
1717
static double s_TicksToSeconds = 1e-7; // 100 ns per tick
@@ -227,7 +227,7 @@ public string DebugGetTimerString(string parentName = "", int level = 0)
227227
/// Tracks the most recent value of a metric. This is analogous to gauges in statsd.
228228
/// </summary>
229229
[DataContract]
230-
public class GaugeNode
230+
internal class GaugeNode
231231
{
232232
const float k_SmoothingFactor = .25f; // weight for exponential moving average.
233233

@@ -316,7 +316,7 @@ public static TimerStack Instance
316316
get { return k_Instance; }
317317
}
318318

319-
public TimerNode RootNode
319+
internal TimerNode RootNode
320320
{
321321
get { return m_RootNode; }
322322
}
@@ -389,7 +389,7 @@ public void Dispose()
389389
/// Potentially slow so call sparingly.
390390
/// </summary>
391391
/// <returns></returns>
392-
public string DebugGetTimerString()
392+
internal string DebugGetTimerString()
393393
{
394394
return m_RootNode.DebugGetTimerString();
395395
}

0 commit comments

Comments
 (0)