浏览代码

Rider suggested cleanup, part 1 (#5265)

/check-for-ModelOverriders
GitHub 4 年前
当前提交
d047802f
共有 68 个文件被更改,包括 34 次插入110 次删除
  1. 1
      Project/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DHardAgent.cs
  2. 2
      Project/Assets/ML-Agents/Examples/Basic/Scripts/BasicActuatorComponent.cs
  3. 1
      Project/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs
  4. 1
      Project/Assets/ML-Agents/Examples/DungeonEscape/Scripts/PushAgentEscape.cs
  5. 3
      Project/Assets/ML-Agents/Examples/DungeonEscape/Scripts/SimpleNPC.cs
  6. 2
      Project/Assets/ML-Agents/Examples/FoodCollector/Scripts/FoodCollectorAgent.cs
  7. 2
      Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3Agent.cs
  8. 2
      Project/Assets/ML-Agents/Examples/PushBlock/Scripts/GoalDetectTrigger.cs
  9. 2
      Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentCollab.cs
  10. 4
      Project/Assets/ML-Agents/Examples/PushBlockWithInput/Scripts/PushBlockWithInputAgentBasic.cs
  11. 2
      Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/CollisionCallbacks.cs
  12. 3
      Project/Assets/ML-Agents/Examples/Soccer/Scripts/SoccerEnvController.cs
  13. 4
      Project/Assets/ML-Agents/Examples/Sorter/Scripts/NumberTile.cs
  14. 2
      Project/Assets/ML-Agents/Examples/Sorter/Scripts/SorterAgent.cs
  15. 3
      Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgent.cs
  16. 1
      Project/Assets/ML-Agents/Examples/Worm/Scripts/WormAgent.cs
  17. 1
      com.unity.ml-agents.extensions/Runtime/Input/Adaptors/ButtonInputActionAdaptor.cs
  18. 2
      com.unity.ml-agents.extensions/Runtime/Input/Adaptors/Vector2InputActionAdaptor.cs
  19. 1
      com.unity.ml-agents.extensions/Runtime/Input/IRLActionInputAdaptor.cs
  20. 1
      com.unity.ml-agents.extensions/Runtime/Input/InputActionActuator.cs
  21. 2
      com.unity.ml-agents.extensions/Tests/Runtime/Input/Adaptors/IntegerInputActionAdaptorTests.cs
  22. 2
      com.unity.ml-agents.extensions/Tests/Runtime/Sensors/CountingGridSensorTests.cs
  23. 1
      com.unity.ml-agents.extensions/Tests/Runtime/Sensors/RigidBodySensorTests.cs
  24. 2
      com.unity.ml-agents/Editor/DemonstrationDrawer.cs
  25. 1
      com.unity.ml-agents/Runtime/Actuators/ActionSpec.cs
  26. 1
      com.unity.ml-agents/Runtime/Actuators/ActuatorComponent.cs
  27. 2
      com.unity.ml-agents/Runtime/Actuators/IDiscreteActionMask.cs
  28. 2
      com.unity.ml-agents/Runtime/Analytics/InferenceAnalytics.cs
  29. 2
      com.unity.ml-agents/Runtime/Analytics/TrainingAnalytics.cs
  30. 6
      com.unity.ml-agents/Runtime/Communicator/GrpcExtensions.cs
  31. 2
      com.unity.ml-agents/Runtime/DecisionRequester.cs
  32. 3
      com.unity.ml-agents/Runtime/Inference/BarracudaModelExtensions.cs
  33. 1
      com.unity.ml-agents/Runtime/Inference/GeneratorImpl.cs
  34. 1
      com.unity.ml-agents/Runtime/Inference/ModelRunner.cs
  35. 12
      com.unity.ml-agents/Runtime/InplaceArray.cs
  36. 2
      com.unity.ml-agents/Runtime/Integrations/Match3/Move.cs
  37. 3
      com.unity.ml-agents/Runtime/MLAgentsSettingsManager.cs
  38. 2
      com.unity.ml-agents/Runtime/MultiAgentGroupIdCounter.cs
  39. 1
      com.unity.ml-agents/Runtime/Policies/HeuristicPolicy.cs
  40. 1
      com.unity.ml-agents/Runtime/Policies/RemotePolicy.cs
  41. 2
      com.unity.ml-agents/Runtime/Sensors/BoxOverlapChecker.cs
  42. 2
      com.unity.ml-agents/Runtime/Sensors/GridSensorComponent.cs
  43. 3
      com.unity.ml-agents/Runtime/Sensors/ISensor.cs
  44. 2
      com.unity.ml-agents/Runtime/Sensors/ObservationSpec.cs
  45. 3
      com.unity.ml-agents/Runtime/Sensors/RenderTextureSensor.cs
  46. 1
      com.unity.ml-agents/Runtime/Sensors/SensorComponent.cs
  47. 1
      com.unity.ml-agents/Runtime/Sensors/StackingSensor.cs
  48. 1
      com.unity.ml-agents/Runtime/Sensors/VectorSensor.cs
  49. 1
      com.unity.ml-agents/Runtime/Sensors/VectorSensorComponent.cs
  50. 1
      com.unity.ml-agents/Runtime/SideChannels/TrainingAnalyticsSideChannel.cs
  51. 2
      com.unity.ml-agents/Runtime/SimpleMultiAgentGroup.cs
  52. 2
      com.unity.ml-agents/Tests/Editor/AcademyTests.cs
  53. 3
      com.unity.ml-agents/Tests/Editor/Actuators/ActionSpecTests.cs
  54. 2
      com.unity.ml-agents/Tests/Editor/Actuators/TestActuator.cs
  55. 5
      com.unity.ml-agents/Tests/Editor/Communicator/GrpcExtensionsTests.cs
  56. 1
      com.unity.ml-agents/Tests/Editor/Inference/EditModeTestInternalBrainTensorGenerator.cs
  57. 2
      com.unity.ml-agents/Tests/Editor/InplaceArrayTests.cs
  58. 1
      com.unity.ml-agents/Tests/Editor/Integrations/Match3/Match3SensorTests.cs
  59. 2
      com.unity.ml-agents/Tests/Editor/MultiAgentGroupTests.cs
  60. 4
      com.unity.ml-agents/Tests/Editor/Policies/HeuristicPolicyTest.cs
  61. 1
      com.unity.ml-agents/Tests/Editor/PublicAPI/PublicApiValidation.cs
  62. 1
      com.unity.ml-agents/Tests/Editor/TimerTest.cs
  63. 4
      com.unity.ml-agents/Tests/Runtime/Sensor/BoxOverlapCheckerTests.cs
  64. 1
      com.unity.ml-agents/Tests/Runtime/Sensor/BufferSensorTest.cs
  65. 1
      com.unity.ml-agents/Tests/Runtime/Sensor/CameraSensorTest.cs
  66. 1
      com.unity.ml-agents/Tests/Runtime/Sensor/RayPerceptionSensorTests.cs
  67. 1
      com.unity.ml-agents/Tests/Runtime/Sensor/SensorUtilTests.cs
  68. 4
      com.unity.ml-agents/Tests/Runtime/Sensor/StackingSensorTests.cs

1
Project/Assets/ML-Agents/Examples/3DBall/Scripts/Ball3DHardAgent.cs


using UnityEngine;
using Unity.MLAgents;
using Unity.MLAgents.Actuators;
using Unity.MLAgents.Sensors;
using Unity.MLAgents.Sensors.Reflection;
public class Ball3DHardAgent : Agent

2
Project/Assets/ML-Agents/Examples/Basic/Scripts/BasicActuatorComponent.cs


/// <summary>
/// Simple actuator that converts the action into a {-1, 0, 1} direction
/// </summary>
public class BasicActuator : IActuator, IHeuristicProvider
public class BasicActuator : IActuator
{
public BasicController basicController;
ActionSpec m_ActionSpec;

1
Project/Assets/ML-Agents/Examples/Crawler/Scripts/CrawlerAgent.cs


using UnityEngine;
using Unity.MLAgents;
using Unity.Barracuda;
using Unity.MLAgents.Actuators;
using Unity.MLAgentsExamples;
using Unity.MLAgents.Sensors;

1
Project/Assets/ML-Agents/Examples/DungeonEscape/Scripts/PushAgentEscape.cs


using System.Collections;
using UnityEngine;
using Unity.MLAgents;
using Unity.MLAgents.Sensors;

3
Project/Assets/ML-Agents/Examples/DungeonEscape/Scripts/SimpleNPC.cs


// using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SimpleNPC : MonoBehaviour

2
Project/Assets/ML-Agents/Examples/FoodCollector/Scripts/FoodCollectorAgent.cs


dirToGo += transform.right * right;
rotateDir = -transform.up * rotate;
var shootCommand = (int)discreteActions[0] > 0;
var shootCommand = discreteActions[0] > 0;
if (shootCommand)
{
m_Shoot = true;

2
Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3Agent.cs


using System;
using UnityEngine;
using Unity.MLAgents;
using Unity.MLAgents.Actuators;
using Unity.MLAgents.Integrations.Match3;
namespace Unity.MLAgentsExamples
{

2
Project/Assets/ML-Agents/Examples/PushBlock/Scripts/GoalDetectTrigger.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;

2
Project/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentCollab.cs


//Put this script on your blue cube.
using System.Collections;
using UnityEngine;
using Unity.MLAgents;
using Unity.MLAgents.Actuators;

4
Project/Assets/ML-Agents/Examples/PushBlockWithInput/Scripts/PushBlockWithInputAgentBasic.cs


//Put this script on your blue cube.
using System;
using System.Collections;
using UnityEngine;
using Unity.MLAgents;

/// <summary>
/// The area bounds.
/// </summary'PushAgentBasic'>
/// </summary>
[HideInInspector]
public Bounds areaBounds;

2
Project/Assets/ML-Agents/Examples/SharedAssets/Scripts/CollisionCallbacks.cs


using UnityEngine;
using Random = UnityEngine.Random;
using Unity.MLAgents;
using UnityEngine.Events;
namespace Unity.MLAgentsExamples

3
Project/Assets/ML-Agents/Examples/Soccer/Scripts/SoccerEnvController.cs


using System.Collections;
using System.Collections.Generic;
using Unity.MLAgents;
using UnityEngine;

var randomPosX = Random.Range(-2.5f, 2.5f);
var randomPosZ = Random.Range(-2.5f, 2.5f);
ball.transform.position = m_BallStartingPos + new Vector3(randomPosX, 0f, randomPosZ); ;
ball.transform.position = m_BallStartingPos + new Vector3(randomPosX, 0f, randomPosZ);
ballRb.velocity = Vector3.zero;
ballRb.angularVelocity = Vector3.zero;

4
Project/Assets/ML-Agents/Examples/Sorter/Scripts/NumberTile.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NumberTile : MonoBehaviour

public Material SuccessMaterial;
private bool m_Visited = false;
private bool m_Visited;
private MeshRenderer m_Renderer;
public bool IsVisited

2
Project/Assets/ML-Agents/Examples/Sorter/Scripts/SorterAgent.cs


// Here, the observation for the tile is added to the BufferSensor
m_BufferSensor.AppendObservation(listObservation);
};
}
}

3
Project/Assets/ML-Agents/Examples/Walker/Scripts/WalkerAgent.cs


Vector3 GetAvgVelocity()
{
Vector3 velSum = Vector3.zero;
Vector3 avgVel = Vector3.zero;
//ALL RBS
int numOfRb = 0;

velSum += item.rb.velocity;
}
avgVel = velSum / numOfRb;
var avgVel = velSum / numOfRb;
return avgVel;
}

1
Project/Assets/ML-Agents/Examples/Worm/Scripts/WormAgent.cs


using UnityEngine;
using Unity.MLAgents;
using Unity.Barracuda;
using Unity.MLAgents.Actuators;
using Unity.MLAgentsExamples;
using Unity.MLAgents.Sensors;

1
com.unity.ml-agents.extensions/Runtime/Input/Adaptors/ButtonInputActionAdaptor.cs


#if MLA_INPUT_SYSTEM
using Unity.MLAgents.Actuators;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.InputSystem.LowLevel;

2
com.unity.ml-agents.extensions/Runtime/Input/Adaptors/Vector2InputActionAdaptor.cs


#if MLA_INPUT_SYSTEM
using System;
using UnityEngine.InputSystem.Controls;
using UnityEngine.InputSystem.LowLevel;
namespace Unity.MLAgents.Extensions.Input

1
com.unity.ml-agents.extensions/Runtime/Input/IRLActionInputAdaptor.cs


#if MLA_INPUT_SYSTEM
using System;
using Unity.MLAgents.Actuators;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.LowLevel;

1
com.unity.ml-agents.extensions/Runtime/Input/InputActionActuator.cs


using Unity.MLAgents.Actuators;
using Unity.MLAgents.Policies;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.Profiling;

2
com.unity.ml-agents.extensions/Tests/Runtime/Input/Adaptors/IntegerInputActionAdaptorTests.cs


#if MLA_INPUT_TESTS
using System;
using UnityEngine;
using UnityEngine.InputSystem;
namespace Unity.MLAgents.Extensions.Tests.Runtime.Input

2
com.unity.ml-agents.extensions/Tests/Runtime/Sensors/CountingGridSensorTests.cs


gridSensor.Update();
subarrayIndicies = new int[] { 77, 78, 87, 88 };
subarrayIndicies = new[] { 77, 78, 87, 88 };
expectedSubarrays = DuplicateArray(new float[] { 2, 0 }, 4);
expectedDefault = new float[] { 0, 0 };
AssertSubarraysAtIndex(gridSensor.PerceptionBuffer, subarrayIndicies, expectedSubarrays, expectedDefault);

1
com.unity.ml-agents.extensions/Tests/Runtime/Sensors/RigidBodySensorTests.cs


using System.Runtime.CompilerServices;
using UnityEngine;
using NUnit.Framework;
using Unity.MLAgents.Sensors;

2
com.unity.ml-agents/Editor/DemonstrationDrawer.cs


using System.Text;
using UnityEditor;
using Unity.MLAgents.Demonstrations;
using Unity.MLAgents.Policies;
namespace Unity.MLAgents.Editor
{

1
com.unity.ml-agents/Runtime/Actuators/ActionSpec.cs


using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

1
com.unity.ml-agents/Runtime/Actuators/ActuatorComponent.cs


using System;
using UnityEngine;
namespace Unity.MLAgents.Actuators

2
com.unity.ml-agents/Runtime/Actuators/IDiscreteActionMask.cs


using System.Collections.Generic;
namespace Unity.MLAgents.Actuators
{
/// <summary>

2
com.unity.ml-agents/Runtime/Analytics/InferenceAnalytics.cs


/// <summary>
/// Whether or not we've registered this particular event yet
/// </summary>
static bool s_EventRegistered = false;
static bool s_EventRegistered;
/// <summary>
/// Hourly limit for this event name

2
com.unity.ml-agents/Runtime/Analytics/TrainingAnalytics.cs


/// <summary>
/// Whether or not we've registered this particular event yet
/// </summary>
static bool s_EventsRegistered = false;
static bool s_EventsRegistered;
/// <summary>
/// Behaviors that we've already sent events for.

6
com.unity.ml-agents/Runtime/Communicator/GrpcExtensions.cs


/// <summary>
/// Static flag to make sure that we only fire the warning once.
/// </summary>
private static bool s_HaveWarnedTrainerCapabilitiesAgentGroup = false;
private static bool s_HaveWarnedTrainerCapabilitiesAgentGroup;
/// <summary>
/// Converts a AgentInfo to a protobuf generated AgentInfoActionPairProto

/// <summary>
/// Static flag to make sure that we only fire the warning once.
/// </summary>
private static bool s_HaveWarnedTrainerCapabilitiesMultiPng = false;
private static bool s_HaveWarnedTrainerCapabilitiesMapping = false;
private static bool s_HaveWarnedTrainerCapabilitiesMultiPng;
private static bool s_HaveWarnedTrainerCapabilitiesMapping;
/// <summary>
/// Generate an ObservationProto for the sensor using the provided ObservationWriter.

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


///
/// The DecisionRequester component provides a convenient and flexible way to
/// trigger the agent decision making process. Without a DecisionRequester,
/// your <see cref="Agent"/> implmentation must manually call its
/// your <see cref="Agent"/> implementation must manually call its
/// <seealso cref="Agent.RequestDecision"/> function.
/// </remarks>
[AddComponentMenu("ML Agents/Decision Requester", (int)MenuGroup.Default)]

3
com.unity.ml-agents/Runtime/Inference/BarracudaModelExtensions.cs


}
else
{
return model.outputs.Contains(TensorNames.DiscreteActionOutput) &&
(int)model.DiscreteOutputSize() > 0;
return model.outputs.Contains(TensorNames.DiscreteActionOutput) && model.DiscreteOutputSize() > 0;
}
}

1
com.unity.ml-agents/Runtime/Inference/GeneratorImpl.cs


using System.Collections.Generic;
using System;
using UnityEngine;
using Unity.Barracuda;
using Unity.MLAgents.Inference.Utils;
using Unity.MLAgents.Sensors;

1
com.unity.ml-agents/Runtime/Inference/ModelRunner.cs


using System;
using System.Collections.Generic;
using Unity.Barracuda;
using UnityEngine.Profiling;

12
com.unity.ml-agents/Runtime/InplaceArray.cs


{
m_Length = 1;
m_Elem0 = elem0;
m_Elem1 = new T { };
m_Elem2 = new T { };
m_Elem3 = new T { };
m_Elem1 = new T();
m_Elem2 = new T();
m_Elem3 = new T();
}
/// <summary>

m_Length = 2;
m_Elem0 = elem0;
m_Elem1 = elem1;
m_Elem2 = new T { };
m_Elem3 = new T { };
m_Elem2 = new T();
m_Elem3 = new T();
}
/// <summary>

m_Elem0 = elem0;
m_Elem1 = elem1;
m_Elem2 = elem2;
m_Elem3 = new T { };
m_Elem3 = new T();
}
/// <summary>

2
com.unity.ml-agents/Runtime/Integrations/Match3/Move.cs


if (moveIndex < 0 || moveIndex >= NumPotentialMoves(maxBoardSize))
{
throw new ArgumentOutOfRangeException("Invalid move index.");
throw new ArgumentOutOfRangeException("moveIndex");
}
Direction dir;
int row, col;

3
com.unity.ml-agents/Runtime/MLAgentsSettingsManager.cs


using System;
using System.Linq;
#else
using System.Linq;
#endif
namespace Unity.MLAgents

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


static int s_Counter;
public static int GetGroupId()
{
return Interlocked.Increment(ref s_Counter); ;
return Interlocked.Increment(ref s_Counter);
}
}
}

1
com.unity.ml-agents/Runtime/Policies/HeuristicPolicy.cs


NullList m_NullList = new NullList();
/// <inheritdoc />
public HeuristicPolicy(ActuatorManager actuatorManager, ActionSpec actionSpec)
{
m_ActuatorManager = actuatorManager;

1
com.unity.ml-agents/Runtime/Policies/RemotePolicy.cs


/// </summary>
private IList<IActuator> m_Actuators;
/// <inheritdoc />
public RemotePolicy(
ActionSpec actionSpec,
IList<IActuator> actuators,

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


/// <summary>Converts the index of the cell to the 3D point (y is zero) relative to grid center</summary>
/// <returns>Vector3 of the position of the center of the cell relative to grid center</returns>
/// <param name="cell">The index of the cell</param>
/// <param name="cellIndex">The index of the cell</param>
Vector3 GetCellLocalPosition(int cellIndex)
{
float x = (cellIndex / m_GridSize.z - m_CellCenterOffset.x) * m_CellScale.x;

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


namespace Unity.MLAgents.Sensors
{
/// <summary>
/// A SensorComponent that creates a <see cref="GridSensor"/>.
/// A SensorComponent that creates a <see cref="GridSensorBase"/>.
/// </summary>
[AddComponentMenu("ML Agents/Grid Sensor", (int)MenuGroup.Sensors)]
public class GridSensorComponent : SensorComponent

3
com.unity.ml-agents/Runtime/Sensors/ISensor.cs


using System;
using System.Collections.Generic;
using System.Linq;
namespace Unity.MLAgents.Sensors
{

[System.Flags]
[Flags]
public enum DimensionProperty
{
/// <summary>

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


using Unity.Barracuda;
namespace Unity.MLAgents.Sensors
{
/// <summary>

3
com.unity.ml-agents/Runtime/Sensors/RenderTextureSensor.cs


/// <param name="texture2D">Texture2D to render to.</param>
public static void ObservationToTexture(RenderTexture obsTexture, Texture2D texture2D)
{
var height = obsTexture.height;
var width = obsTexture.width;
var prevActiveRt = RenderTexture.active;
RenderTexture.active = obsTexture;

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


using UnityEngine;
using System;
namespace Unity.MLAgents.Sensors
{

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


using System;
using System.Linq;
using System.Runtime.CompilerServices;
using UnityEngine;
using Unity.Barracuda;

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


using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using UnityEngine;

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


using UnityEngine;
using UnityEngine.Serialization;
namespace Unity.MLAgents.Sensors
{

1
com.unity.ml-agents/Runtime/SideChannels/TrainingAnalyticsSideChannel.cs


using System;
using UnityEngine;
using Unity.MLAgents.Analytics;
using Unity.MLAgents.CommunicatorObjects;

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


/// </returns>
public IReadOnlyCollection<Agent> GetRegisteredAgents()
{
return (IReadOnlyCollection<Agent>)m_Agents;
return m_Agents;
}
/// <summary>

2
com.unity.ml-agents/Tests/Editor/AcademyTests.cs


using NUnit.Framework;
using Unity.MLAgents.Sensors;
using UnityEngine;
using System.Reflection;
using Unity.MLAgents;
namespace Unity.MLAgents.Tests
{

3
com.unity.ml-agents/Tests/Editor/Actuators/ActionSpecTests.cs


using System;
using UnityEngine.TestTools.Constraints;
using Is = UnityEngine.TestTools.Constraints.Is;
namespace Unity.MLAgents.Tests.Actuators
{

2
com.unity.ml-agents/Tests/Editor/Actuators/TestActuator.cs


using Unity.MLAgents.Actuators;
namespace Unity.MLAgents.Tests.Actuators
{
internal class TestActuator : IActuator, IHeuristicProvider
internal class TestActuator : IActuator
{
public ActionBuffers LastActionBuffer;
public int[][] Masks;

5
com.unity.ml-agents/Tests/Editor/Communicator/GrpcExtensionsTests.cs


using System;
using System.Text.RegularExpressions;
using Google.Protobuf;
using Google.Protobuf.Collections;
using NUnit.Framework;
using Unity.MLAgents.Actuators;
using Unity.MLAgents.Demonstrations;

{
public ObservationSpec ObservationSpec;
public SensorCompressionType CompressionType;
internal DummySensor()
{
}
public ObservationSpec GetObservationSpec()
{

1
com.unity.ml-agents/Tests/Editor/Inference/EditModeTestInternalBrainTensorGenerator.cs


using Unity.MLAgents.Actuators;
using Unity.MLAgents.Inference;
using Unity.MLAgents.Policies;
using Unity.MLAgents.Sensors.Reflection;
using Unity.MLAgents.Utils.Tests;
namespace Unity.MLAgents.Tests

2
com.unity.ml-agents/Tests/Editor/InplaceArrayTests.cs


using System;
using System.Collections;
using NUnit.Framework;
using Unity.MLAgents;
using UnityEngine;
namespace Unity.MLAgents.Tests

1
com.unity.ml-agents/Tests/Editor/Integrations/Match3/Match3SensorTests.cs


using UnityEngine;
using Unity.MLAgents.Integrations.Match3;
using Unity.MLAgents.Sensors;
using Unity.MLAgents.Tests;
namespace Unity.MLAgents.Tests.Integrations.Match3
{

2
com.unity.ml-agents/Tests/Editor/MultiAgentGroupTests.cs


using Unity.MLAgents;
using Unity;
namespace Unity.MLAgents.Tests
{

4
com.unity.ml-agents/Tests/Editor/Policies/HeuristicPolicyTest.cs


class ActionClearedAgent : Agent
{
public int HeuristicCalls = 0;
public int HeuristicCalls;
public override void Heuristic(in ActionBuffers actionsOut)
{
CheckAndSetBuffer(actionsOut);

class ActionClearedActuator : IActuator
{
public int HeuristicCalls = 0;
public int HeuristicCalls;
public ActionClearedActuator(ActionSpec actionSpec)
{
ActionSpec = actionSpec;

1
com.unity.ml-agents/Tests/Editor/PublicAPI/PublicApiValidation.cs


using System.Collections.Generic;
using Unity.MLAgents.Sensors;
using NUnit.Framework;
using Unity.MLAgents;

1
com.unity.ml-agents/Tests/Editor/TimerTest.cs


using NUnit.Framework;
using UnityEngine;
namespace Unity.MLAgents.Tests
{

4
com.unity.ml-agents/Tests/Runtime/Sensor/BoxOverlapCheckerTests.cs


gridSizeX: 2,
gridSizeZ: 2,
rootReference: testGo,
detectableTags: new string[] { tag1 });
detectableTags: new [] { tag1 });
var helper = new VerifyParseCollidersHelper();
boxOverlap.GridOverlapDetectedClosest += helper.DetectedAction;

gridSizeX: 2,
gridSizeZ: 2,
rootReference: testGo,
detectableTags: new string[] { tag1 });
detectableTags: new [] { tag1 });
var helper = new VerifyParseCollidersHelper();
boxOverlap.GridOverlapDetectedAll += helper.DetectedAction;

1
com.unity.ml-agents/Tests/Runtime/Sensor/BufferSensorTest.cs


using System;
using NUnit.Framework;
using UnityEngine;
using Unity.MLAgents.Sensors;

1
com.unity.ml-agents/Tests/Runtime/Sensor/CameraSensorTest.cs


using NUnit.Framework;
using UnityEngine;
using Unity.MLAgents.Sensors;
using Object = System.Object;
namespace Unity.MLAgents.Tests
{

1
com.unity.ml-agents/Tests/Runtime/Sensor/RayPerceptionSensorTests.cs


using System;
using System.Collections.Generic;
using NUnit.Framework;
using UnityEngine;

1
com.unity.ml-agents/Tests/Runtime/Sensor/SensorUtilTests.cs


using System.Collections.Generic;
using System.Globalization;
using NUnit.Framework;
using UnityEngine;
using Unity.MLAgents.Sensors;
using Unity.MLAgents.Utils.Tests;

4
com.unity.ml-agents/Tests/Runtime/Sensor/StackingSensorTests.cs


public ObservationSpec ObservationSpec;
public float[,,] CurrentObservation;
internal Dummy3DSensor()
{
}
public ObservationSpec GetObservationSpec()
{
return ObservationSpec;

正在加载...
取消
保存