浏览代码

[coding conventions] Revert NNModelImporter rename and remove NonAlloc Collider check suggestion from rider. (#2571)

/develop-gpu-test
GitHub 5 年前
当前提交
5a2e60b6
共有 3 个文件被更改,包括 7 次插入8 次删除
  1. 12
      UnitySDK/Assets/ML-Agents/Examples/GridWorld/Scripts/GridAgent.cs
  2. 2
      UnitySDK/Assets/ML-Agents/Plugins/Barracuda.Core/Barracuda/Plugins/Editor/BarracudaEditor/NNModelImporter.cs
  3. 1
      UnitySDK/UnitySDK.sln.DotSettings

12
UnitySDK/Assets/ML-Agents/Examples/GridWorld/Scripts/GridAgent.cs


private const int k_Down = 2;
private const int k_Left = 3;
private const int k_Right = 4;
static Collider[] s_Colliders;
s_Colliders = new Collider[16];
}
public override void CollectObservations()

throw new ArgumentException("Invalid action value");
}
Physics.OverlapBoxNonAlloc(
targetPos, new Vector3(0.3f, 0.3f, 0.3f), s_Colliders);
if (s_Colliders.Where(col => col.gameObject.CompareTag("wall")).ToArray().Length == 0)
var hit = Physics.OverlapBox(
targetPos, new Vector3(0.3f, 0.3f, 0.3f));
if (hit.Where(col => col.gameObject.CompareTag("wall")).ToArray().Length == 0)
if (s_Colliders.Where(col => col.gameObject.CompareTag("goal")).ToArray().Length == 1)
if (hit.Where(col => col.gameObject.CompareTag("goal")).ToArray().Length == 1)
if (s_Colliders.Where(col => col.gameObject.CompareTag("pit")).ToArray().Length == 1)
if (hit.Where(col => col.gameObject.CompareTag("pit")).ToArray().Length == 1)
{
Done();
SetReward(-1f);

2
UnitySDK/Assets/ML-Agents/Plugins/Barracuda.Core/Barracuda/Plugins/Editor/BarracudaEditor/NNModelImporter.cs


/// Asset Importer of barracuda models.
/// </summary>
[ScriptedImporter(1, new[] {"nn"})]
public class NnModelImporter : ScriptedImporter
public class NNModelImporter : ScriptedImporter
{
private const string k_IconName = "NNModelIcon";

1
UnitySDK/UnitySDK.sln.DotSettings


<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=BLAS/@EntryIndexedValue">BLAS</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=CPU/@EntryIndexedValue">CPU</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=GPU/@EntryIndexedValue">GPU</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=NN/@EntryIndexedValue">NN</s:String>
<s:Boolean x:Key="/Default/UserDictionary/Words/=BLAS/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Logits/@EntryIndexedValue">True</s:Boolean>

正在加载...
取消
保存