|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Returns the absolute file path of the JSON serialized configuration
|
|
|
|
/// </summary>
|
|
|
|
public string defaultConfigFilePath => |
|
|
|
public virtual string defaultConfigFilePath => |
|
|
|
Application.dataPath + "/StreamingAssets/" + configFileName + ".json"; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Resets SamplerState.randomState with a new seed value generated by hashing this Scenario's randomSeed
|
|
|
|
/// with its currentIteration
|
|
|
|
/// </summary>
|
|
|
|
protected virtual void ResetRandomStateOnIteration() |
|
|
|
{ |
|
|
|
SamplerState.randomState = SamplerUtility.IterateSeed((uint)currentIteration, genericConstants.randomSeed); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// This method executed directly after this scenario has been registered and initialized
|
|
|
|
/// </summary>
|
|
|
|
protected virtual void OnAwake() { } |
|
|
|
|
|
|
Guid.Parse("14adb394-46c0-47e8-a3f0-99e754483b76")); |
|
|
|
DatasetCapture.ReportMetric(randomSeedMetricDefinition, new[] { genericConstants.randomSeed }); |
|
|
|
#if !UNITY_EDITOR
|
|
|
|
if (File.Exists(defaultConfigFilePath)) |
|
|
|
DeserializeFromFile(); |
|
|
|
else |
|
|
|
Debug.Log($"No configuration file found at {defaultConfigFilePath}. " + |
|
|
|
"Proceeding with built in scenario constants and randomizer settings."); |
|
|
|
DeserializeFromFile(); |
|
|
|
#endif
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
if (currentIterationFrame == 0) |
|
|
|
{ |
|
|
|
DatasetCapture.StartNewSequence(); |
|
|
|
SamplerState.randomState = SamplerUtility.IterateSeed((uint)currentIteration, genericConstants.randomSeed); |
|
|
|
|
|
|
|
ResetRandomStateOnIteration(); |
|
|
|
DatasetCapture.ReportMetric(m_IterationMetricDefinition, new[] |
|
|
|
{ |
|
|
|
new IterationMetricData() |
|
|
|