Skip to content

NevarokML: ANevarokMLEnv API

The ANevarokMLEnv class represents an environment actor in NevarokML.


Properties

  • _actSample (UNevarokMLSample): The action sample for the environment.
  • _obsSample (UNevarokMLSample): The observation sample for the environment.
  • _reward (float): The accumulated reward for the current step.
  • _episodeReward (float): The accumulated reward for the current episode.
  • _maxEpisodeReward (float): The maximum episode reward achieved so far.
  • _steps (int): The number of steps taken in the current episode.
  • _done (bool): Indicates whether the episode is done.

Methods

ExecuteInit

void ANevarokMLEnv::ExecuteInit(UNevarokMLSpace* actSpace, UNevarokMLSpace* obsSpace);

Executes the initialization process for the environment.

ExecuteStep

void ANevarokMLEnv::ExecuteStep();

Executes a step in the environment.

ExecuteReset

void ANevarokMLEnv::ExecuteReset();

Resets the environment.

GetActSample

UNevarokMLSample* ANevarokMLEnv::GetActSample() const;

Returns the action sample for the environment.

GetObsSample

UNevarokMLSample* ANevarokMLEnv::GetObsSample() const;

Returns the observation sample for the environment.

GetDone

bool ANevarokMLEnv::GetDone() const;

Returns whether the episode is done.

GetReward

float ANevarokMLEnv::GetReward() const;

Returns the accumulated reward for the current step.

AddReward

void ANevarokMLEnv::AddReward(const float value);

Adds a reward value to the accumulated reward for the current step.

Event Methods

OnInit

UFUNCTION(BlueprintNativeEvent, Category = "NevarokML|Env")
void OnInit(UNevarokMLSpace* actSpace, UNevarokMLSpace* obsSpace);

The OnInit event is triggered when an environment is initialized. It provides an opportunity to perform any necessary setup or customization related to the initialized environment.

OnStep

UFUNCTION(BlueprintNativeEvent, Category = "NevarokML|Env")
void OnStep();

The OnStep event is triggered when the environment performs a step. It provides an opportunity to respond to the environment's state after the step and perform any necessary actions or calculations.

OnReset

UFUNCTION(BlueprintNativeEvent, Category = "NevarokML|Env")
void OnReset();

The OnReset event is triggered when the environment resets. It provides an opportunity to handle any necessary actions or logic related to the reset of the environment.

OnInit_Implementation

virtual void ANevarokMLEnv::OnInit_Implementation(UNevarokMLSpace* actSpace, UNevarokMLSpace* obsSpace);

Implementation of the OnInit event method.

OnStep_Implementation

virtual void ANevarokMLEnv::OnStep_Implementation();

Implementation of the OnStep event method.

OnReset_Implementation

` virtual void ANevarokMLEnv::OnReset_Implementation(); ```

Implementation of the OnReset event method.