Skip to content

Commit 5919158

Browse files
author
Chris Elion
authored
fix all PVS and doc generation warnings (#5262)
1 parent 08a66c4 commit 5919158

File tree

8 files changed

+40
-9
lines changed

8 files changed

+40
-9
lines changed

com.unity.ml-agents/Runtime/Actuators/ActionSegment.cs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,19 +116,29 @@ public bool IsEmpty()
116116
return Array == null || Array.Length == 0;
117117
}
118118

119-
/// <inheritdoc/>
119+
/// <summary>
120+
/// Returns an enumerator that iterates through the ActionSegment.
121+
/// </summary>
122+
/// <returns>An IEnumerator object that can be used to iterate through the ActionSegment.</returns>
120123
IEnumerator<T> IEnumerable<T>.GetEnumerator()
121124
{
122125
return new Enumerator(this);
123126
}
124127

125-
/// <inheritdoc/>
128+
/// <summary>
129+
/// Returns an enumerator that iterates through the ActionSegment.
130+
/// </summary>
131+
/// <returns>An IEnumerator object that can be used to iterate through the ActionSegment.</returns>
126132
public IEnumerator GetEnumerator()
127133
{
128134
return new Enumerator(this);
129135
}
130136

131-
/// <inheritdoc/>
137+
/// <summary>
138+
/// Indicates whether the current ActionSegment is equal to another ActionSegment.
139+
/// </summary>
140+
/// <param name="obj">An ActionSegment to compare with this ActionSegment.</param>
141+
/// <returns>true if the current ActionSegment is equal to the other parameter; otherwise, false.</returns>
132142
public override bool Equals(object obj)
133143
{
134144
if (!(obj is ActionSegment<T>))
@@ -138,13 +148,20 @@ public override bool Equals(object obj)
138148
return Equals((ActionSegment<T>)obj);
139149
}
140150

141-
/// <inheritdoc/>
151+
/// <summary>
152+
/// Indicates whether the current ActionSegment is equal to another ActionSegment.
153+
/// </summary>
154+
/// <param name="other">An ActionSegment to compare with this ActionSegment.</param>
155+
/// <returns>true if the current ActionSegment is equal to the other parameter; otherwise, false.</returns>
142156
public bool Equals(ActionSegment<T> other)
143157
{
144158
return Offset == other.Offset && Length == other.Length && Array.SequenceEqual(other.Array);
145159
}
146160

147-
/// <inheritdoc/>
161+
/// <summary>
162+
/// Computes the hash code of the ActionSegment.
163+
/// </summary>
164+
/// <returns>A hash code for the current ActionSegment.</returns>
148165
public override int GetHashCode()
149166
{
150167
unchecked

com.unity.ml-agents/Runtime/Actuators/IActionReceiver.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,11 @@ public bool IsEmpty()
127127
return ContinuousActions.IsEmpty() && DiscreteActions.IsEmpty();
128128
}
129129

130-
/// <inheritdoc/>
130+
/// <summary>
131+
/// Indicates whether the current ActionBuffers is equal to another ActionBuffers.
132+
/// </summary>
133+
/// <param name="obj">An ActionBuffers to compare with this ActionBuffers.</param>
134+
/// <returns>true if the current ActionBuffers is equal to the other parameter; otherwise, false.</returns>
131135
public override bool Equals(object obj)
132136
{
133137
if (!(obj is ActionBuffers))
@@ -140,7 +144,10 @@ public override bool Equals(object obj)
140144
ab.DiscreteActions.SequenceEqual(DiscreteActions);
141145
}
142146

143-
/// <inheritdoc/>
147+
/// <summary>
148+
/// Computes the hash code of the ActionBuffers.
149+
/// </summary>
150+
/// <returns>A hash code for the current ActionBuffers.</returns>
144151
public override int GetHashCode()
145152
{
146153
unchecked

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ void ResetSensors()
11511151
/// - <see cref="VectorSensor.AddObservation(Vector2)"/>
11521152
/// - <see cref="VectorSensor.AddObservation(Quaternion)"/>
11531153
/// - <see cref="VectorSensor.AddObservation(bool)"/>
1154-
/// - <see cref="VectorSensor.AddObservation(IEnumerable{float})"/>
1154+
/// - <see cref="VectorSensor.AddObservation(IList{float})"/>
11551155
/// - <see cref="VectorSensor.AddOneHotObservation(int, int)"/>
11561156
///
11571157
/// You can use any combination of these helper functions to build the agent's

com.unity.ml-agents/Runtime/Sensors/BufferSensorComponent.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class BufferSensorComponent : SensorComponent
1111
{
1212

1313
/// <summary>
14-
/// Name of the generated <see cref="bufferSensor"/> object.
14+
/// Name of the generated <see cref="BufferSensor"/> object.
1515
/// Note that changing this at runtime does not affect how the Agent sorts the sensors.
1616
/// </summary>
1717
public string SensorName

com.unity.ml-agents/Runtime/Sensors/CompressionSpec.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,17 @@ public SensorCompressionType SensorCompressionType
4141

4242
internal int[] m_CompressedChannelMapping;
4343

44+
/// <summary>
4445
/// The mapping of the channels in compressed data to the actual channel after decompression.
46+
/// </summary>
47+
/// <remarks>
4548
/// The mapping is a list of integer index with the same length as
4649
/// the number of output observation layers (channels), including padding if there's any.
4750
/// Each index indicates the actual channel the layer will go into.
4851
/// Layers with the same index will be averaged, and layers with negative index will be dropped.
4952
/// For example, mapping for CameraSensor using grayscale and stacking of two: [0, 0, 0, 1, 1, 1]
5053
/// Mapping for GridSensor of 4 channels and stacking of two: [0, 1, 2, 3, -1, -1, 4, 5, 6, 7, -1, -1]
54+
/// </remarks>
5155
public int[] CompressedChannelMapping
5256
{
5357
get => m_CompressedChannelMapping;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ public byte[] GetCompressedObservation()
200200
return outputBytes;
201201
}
202202

203+
/// <inheritdoc/>
203204
public CompressionSpec GetCompressionSpec()
204205
{
205206
var wrappedSpec = m_WrappedSensor.GetCompressionSpec();

com.unity.ml-agents/Runtime/Sensors/VectorSensor.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class VectorSensor : ISensor, IBuiltInSensor
2121
/// </summary>
2222
/// <param name="observationSize">Number of vector observations.</param>
2323
/// <param name="name">Name of the sensor.</param>
24+
/// <param name="observationType"></param>
2425
public VectorSensor(int observationSize, string name = null, ObservationType observationType = ObservationType.Default)
2526
{
2627
if (string.IsNullOrEmpty(name))

com.unity.ml-agents/Runtime/Sensors/VectorSensorComponent.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public override ISensor[] CreateSensors()
6060
/// <summary>
6161
/// Returns the underlying VectorSensor
6262
/// </summary>
63+
/// <returns></returns>
6364
public VectorSensor GetSensor()
6465
{
6566
return m_Sensor;

0 commit comments

Comments
 (0)