12 namespace droid.Runtime.Environments {
21 const int _script_execution_order = -20;
34 [SerializeField]
Reaction _last_reaction;
44 protected string _LastTermination_Reason =
"None";
57 [Header(
"Environment", order = 100)]
64 protected bool _Terminable =
true;
78 public abstract override String PrototypingTypeName {
get; }
82 public bool Terminated {
get {
return this._Terminated; }
set { this._Terminated = value; } }
87 public Reaction LastReaction {
get {
return this._last_reaction; }
set { this._last_reaction = value; } }
93 public bool IsResetting {
get {
return this._Resetting; } }
97 public String LastTerminationReason {
98 get {
return this._LastTermination_Reason; }
99 set { this._LastTermination_Reason = value; }
104 public abstract void PostStep();
109 public abstract Reaction SampleReaction();
121 public abstract void React(
Reaction reaction);
125 public abstract void Tick();
141 recipient.
PollData(this._Energy_Spent.ToString(CultureInfo.InvariantCulture));
149 if (this._Terminated) {
161 if (this._Simulation_Manager == null) {
162 this._Simulation_Manager = FindObjectOfType<AbstractNeodroidManager>();
166 if (!Application.isPlaying) {
167 var manager_script = MonoScript.FromMonoBehaviour(
this);
168 if (MonoImporter.GetExecutionOrder(manager_script) != _script_execution_order) {
169 MonoImporter.SetExecutionOrder(manager_script,
170 _script_execution_order);
171 Debug.LogWarning(
"Execution Order changed, you will need to press play again to make everything function correctly!");
172 EditorApplication.isPlaying =
false;
183 if (this._Simulation_Manager != null) {
184 this._Simulation_Manager =
185 NeodroidUtilities.RegisterComponent((
PausableManager)this._Simulation_Manager,
this);
201 public abstract void ObservationsString(
DataPoller recipient);
203 public abstract void EnvironmentReset();
206 #region Public Methods 220 public int CurrentFrameNumber {
221 get {
return this._current_frame_number; }
222 set { this._current_frame_number = value; }
void EnergyString(DataPoller recipient)
abstract void PollData(dynamic data)
IManager _Simulation_Manager
bool _ReplyWithDescriptionThisStep
float _Lastest_Reset_Time
void IdentifierString(DataPoller recipient)
int _current_frame_number
override void UnRegisterComponent()
void TerminatedBoolean(DataPoller recipient)
override void RegisterComponent()
void FrameString(DataPoller recipient)