Neodroid  0.2.0
Machine Learning Environment Prototyping Tool
RandomisedEnvironment.cs
Go to the documentation of this file.
1 using UnityEngine;
2 
3 namespace droid.Runtime.Environments {
7  [AddComponentMenu("Neodroid/Environments/RandomisedEnvironment")]
11  void RandomiseEnvironment() {
12  foreach (var configurable in this.Configurables) {
13  var value = configurable.Value.SampleConfigurations();
14  foreach (var v in value) {
15  configurable.Value.ApplyConfiguration(v);
16  }
17  }
18  }
19 
23  protected override void PreSetup() {
24  base.PreSetup();
25  this.RandomiseEnvironment();
26  }
27 
31  public override void PostStep() {
32  if (this._Terminated) {
33  this._Terminated = false;
34  this.EnvironmentReset();
35 
36  this.RandomiseEnvironment();
37  }
38 
39  if (this._Configure) {
40  this._Configure = false;
41  this.Reconfigure();
42  }
43 
44  this.UpdateConfigurableValues();
45  this.UpdateObserversData();
46  }
47  }
48 }
Environment to be used with the prototyping components.