浏览代码

Adding metric on iteration start for enabling reproducibility in editor from USim iterations

/resint_updates
Jon Hogins 4 年前
当前提交
dfb4403f
共有 1 个文件被更改,包括 19 次插入0 次删除
  1. 19
      com.unity.perception/Runtime/Randomization/Scenarios/ScenarioBase.cs

19
com.unity.perception/Runtime/Randomization/Scenarios/ScenarioBase.cs


{
static ScenarioBase s_ActiveScenario;
const string k_ScenarioIterationMetricDefinitionId = "DB1B258E-D1D0-41B6-8751-16F601A2E230";
MetricDefinition m_IterationMetricDefinition;
IEnumerable<Randomizer> activeRandomizers
{

// Don't skip the first frame if executing on Unity Simulation
if (Configuration.Instance.IsSimulationRunningInCloud())
m_SkipFrame = false;
m_IterationMetricDefinition = DatasetCapture.RegisterMetricDefinition("scenario_iteration", "Iteration information for dataset sequences",
Guid.Parse(k_ScenarioIterationMetricDefinitionId));
}
void OnEnable()

void Start()
{
Deserialize();
}
struct IterationMetricData
{
public int iteration;
}
void Update()

if (currentIterationFrame == 0)
{
DatasetCapture.StartNewSequence();
DatasetCapture.ReportMetric(m_IterationMetricDefinition, new[]
{
new IterationMetricData()
{
iteration = currentIteration
}
});
IterateParameterStates();
foreach (var randomizer in activeRandomizers)
randomizer.IterationStart();

正在加载...
取消
保存