浏览代码

fix all PVS and doc generation warnings (#5262)

/check-for-ModelOverriders
GitHub 3 年前
当前提交
fabc492e
共有 8 个文件被更改,包括 40 次插入9 次删除
  1. 27
      com.unity.ml-agents/Runtime/Actuators/ActionSegment.cs
  2. 11
      com.unity.ml-agents/Runtime/Actuators/IActionReceiver.cs
  3. 2
      com.unity.ml-agents/Runtime/Agent.cs
  4. 2
      com.unity.ml-agents/Runtime/Sensors/BufferSensorComponent.cs
  5. 4
      com.unity.ml-agents/Runtime/Sensors/CompressionSpec.cs
  6. 1
      com.unity.ml-agents/Runtime/Sensors/StackingSensor.cs
  7. 1
      com.unity.ml-agents/Runtime/Sensors/VectorSensor.cs
  8. 1
      com.unity.ml-agents/Runtime/Sensors/VectorSensorComponent.cs

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


return Array == null || Array.Length == 0;
}
/// <inheritdoc/>
/// <summary>
/// Returns an enumerator that iterates through the ActionSegment.
/// </summary>
/// <returns>An IEnumerator object that can be used to iterate through the ActionSegment.</returns>
/// <inheritdoc/>
/// <summary>
/// Returns an enumerator that iterates through the ActionSegment.
/// </summary>
/// <returns>An IEnumerator object that can be used to iterate through the ActionSegment.</returns>
/// <inheritdoc/>
/// <summary>
/// Indicates whether the current ActionSegment is equal to another ActionSegment.
/// </summary>
/// <param name="obj">An ActionSegment to compare with this ActionSegment.</param>
/// <returns>true if the current ActionSegment is equal to the other parameter; otherwise, false.</returns>
public override bool Equals(object obj)
{
if (!(obj is ActionSegment<T>))

return Equals((ActionSegment<T>)obj);
}
/// <inheritdoc/>
/// <summary>
/// Indicates whether the current ActionSegment is equal to another ActionSegment.
/// </summary>
/// <param name="other">An ActionSegment to compare with this ActionSegment.</param>
/// <returns>true if the current ActionSegment is equal to the other parameter; otherwise, false.</returns>
/// <inheritdoc/>
/// <summary>
/// Computes the hash code of the ActionSegment.
/// </summary>
/// <returns>A hash code for the current ActionSegment.</returns>
public override int GetHashCode()
{
unchecked

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


return ContinuousActions.IsEmpty() && DiscreteActions.IsEmpty();
}
/// <inheritdoc/>
/// <summary>
/// Indicates whether the current ActionBuffers is equal to another ActionBuffers.
/// </summary>
/// <param name="obj">An ActionBuffers to compare with this ActionBuffers.</param>
/// <returns>true if the current ActionBuffers is equal to the other parameter; otherwise, false.</returns>
public override bool Equals(object obj)
{
if (!(obj is ActionBuffers))

ab.DiscreteActions.SequenceEqual(DiscreteActions);
}
/// <inheritdoc/>
/// <summary>
/// Computes the hash code of the ActionBuffers.
/// </summary>
/// <returns>A hash code for the current ActionBuffers.</returns>
public override int GetHashCode()
{
unchecked

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


/// - <see cref="VectorSensor.AddObservation(Vector2)"/>
/// - <see cref="VectorSensor.AddObservation(Quaternion)"/>
/// - <see cref="VectorSensor.AddObservation(bool)"/>
/// - <see cref="VectorSensor.AddObservation(IEnumerable{float})"/>
/// - <see cref="VectorSensor.AddObservation(IList{float})"/>
/// - <see cref="VectorSensor.AddOneHotObservation(int, int)"/>
///
/// You can use any combination of these helper functions to build the agent's

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


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

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


internal int[] m_CompressedChannelMapping;
/// <summary>
/// </summary>
/// <remarks>
/// The mapping is a list of integer index with the same length as
/// the number of output observation layers (channels), including padding if there's any.
/// Each index indicates the actual channel the layer will go into.

/// </remarks>
public int[] CompressedChannelMapping
{
get => m_CompressedChannelMapping;

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


return outputBytes;
}
/// <inheritdoc/>
public CompressionSpec GetCompressionSpec()
{
var wrappedSpec = m_WrappedSensor.GetCompressionSpec();

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


/// </summary>
/// <param name="observationSize">Number of vector observations.</param>
/// <param name="name">Name of the sensor.</param>
/// <param name="observationType"></param>
public VectorSensor(int observationSize, string name = null, ObservationType observationType = ObservationType.Default)
{
if (string.IsNullOrEmpty(name))

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


/// <summary>
/// Returns the underlying VectorSensor
/// </summary>
/// <returns></returns>
public VectorSensor GetSensor()
{
return m_Sensor;

正在加载...
取消
保存