|
|
|
|
|
|
{ |
|
|
|
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(); |
|
|
|