比较提交

...
此合并请求有变更与目标分支冲突。
/com.unity.ml-agents/Runtime/Integrations/Match3/Match3SensorComponent.cs

1 次代码提交

作者 SHA1 备注 提交日期
vincentpierre 1b032f73 [DO NOT MERGE] gpu testing for release 4 年前
共有 8 个文件被更改,包括 49 次插入1 次删除
  1. 4
      Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3Drawer.cs
  2. 8
      com.unity.ml-agents/Editor/Match3ActuatorComponentEditor.cs
  3. 8
      com.unity.ml-agents/Editor/Match3SensorComponentEditor.cs
  4. 6
      com.unity.ml-agents/Runtime/Integrations/Match3/Match3ActuatorComponent.cs
  5. 4
      com.unity.ml-agents/Runtime/Integrations/Match3/Match3SensorComponent.cs
  6. 9
      com.unity.ml-agents/Tests/Editor/Integrations/Match3/Match3ActuatorTests.cs
  7. 9
      com.unity.ml-agents/Tests/Editor/Integrations/Match3/Match3SensorTests.cs
  8. 2
      .yamato/pytest-gpu.yml

4
Project/Assets/ML-Agents/Examples/Match3/Scripts/Match3Drawer.cs


if (!m_Board)
{
m_Board = GetComponent<Match3Board>();
if (m_Board == null)
{
return;
}
}
var currentSize = m_Board.GetCurrentBoardSize();

8
com.unity.ml-agents/Editor/Match3ActuatorComponentEditor.cs


var so = serializedObject;
so.Update();
var component = (Match3ActuatorComponent)target;
var board = component.GetComponent<AbstractBoard>();
if (board == null)
{
EditorGUILayout.HelpBox("You must provide an implementation of an AbstractBoard.", MessageType.Warning);
return;
}
// Drawing the RenderTextureComponent
EditorGUI.BeginChangeCheck();

8
com.unity.ml-agents/Editor/Match3SensorComponentEditor.cs


var so = serializedObject;
so.Update();
var component = (Match3SensorComponent)target;
var board = component.GetComponent<AbstractBoard>();
if (board == null)
{
EditorGUILayout.HelpBox("You must provide an implementation of an AbstractBoard.", MessageType.Warning);
return;
}
// Drawing the RenderTextureComponent
EditorGUI.BeginChangeCheck();

6
com.unity.ml-agents/Runtime/Integrations/Match3/Match3ActuatorComponent.cs


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

public override IActuator[] CreateActuators()
{
var board = GetComponent<AbstractBoard>();
if (!board)
{
return Array.Empty<IActuator>();
}
var seed = m_RandomSeed == -1 ? gameObject.GetInstanceID() : m_RandomSeed + 1;
return new IActuator[] { new Match3Actuator(board, m_ForceHeuristic, seed, m_ActuatorName) };
}

4
com.unity.ml-agents/Runtime/Integrations/Match3/Match3SensorComponent.cs


Dispose();
var board = GetComponent<AbstractBoard>();
if (!board)
{
return Array.Empty<ISensor>();
}
var cellSensor = Match3Sensor.CellTypeSensor(board, m_ObservationType, m_SensorName + " (cells)");
// This can be null if numSpecialTypes is 0
var specialSensor = Match3Sensor.SpecialTypeSensor(board, m_ObservationType, m_SensorName + " (special)");

9
com.unity.ml-agents/Tests/Editor/Integrations/Match3/Match3ActuatorTests.cs


// And they should add up to all the potential moves
Assert.AreEqual(validIndices.Count + masks.HashSets[0].Count, board.NumMoves());
}
[Test]
public void TestNoBoardReturnsEmptyActuators()
{
var gameObj = new GameObject("board");
var actuatorComponent = gameObj.AddComponent<Match3ActuatorComponent>();
var actuators = actuatorComponent.CreateActuators();
Assert.AreEqual(0, actuators.Length);
}
}
}

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


return bytesOut.ToArray();
}
[Test]
public void TestNoBoardReturnsEmptySensors()
{
var gameObj = new GameObject("board");
var sensorComponent = gameObj.AddComponent<Match3SensorComponent>();
var sensors = sensorComponent.CreateSensors();
Assert.AreEqual(0, sensors.Length);
}
}
}

2
.yamato/pytest-gpu.yml


name: Pytest GPU
agent:
type: Unity::VM::GPU
image: package-ci/ubuntu:v1.3.1-719011
image: package-ci/ubuntu:stable
flavor: b1.large
commands:
- |

正在加载...
取消
保存