MLCompilerBridge
Tools for streamlining communication with ML models for compiler optimizations.
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | Private Attributes | List of all members
MLBridge::Environment Class Referenceabstract

#include <environment.h>

Public Member Functions

bool checkDone ()
 CheckDone returns true if the termination condition is met at the end of the episode.
 
void setDone ()
 SetDone sets the termination condition to true.
 
void resetDone ()
 
std::string getNextAgent ()
 GetNextAgent returns the name/ID of the next agent to interact with.
 
void setNextAgent (std::string name)
 SetNextAgent sets the name of the next agent to interact with.
 
virtual Observationstep (Action action)=0
 Step function takes an action as input and returns the observation corresponding to the next state.
 
virtual Observationreset ()=0
 Reset function returns the initial observation.
 

Protected Attributes

std::map< std::string, Observation & > obsMap
 

Private Attributes

bool done = false
 
std::string nextAgent = ""
 

Detailed Description

Definition at line 56 of file environment.h.

Member Function Documentation

◆ checkDone()

bool MLBridge::Environment::checkDone ( )
inline

CheckDone returns true if the termination condition is met at the end of the episode.

Definition at line 66 of file environment.h.

◆ getNextAgent()

std::string MLBridge::Environment::getNextAgent ( )
inline

GetNextAgent returns the name/ID of the next agent to interact with.

Definition at line 73 of file environment.h.

◆ reset()

virtual Observation & MLBridge::Environment::reset ( )
pure virtual

Reset function returns the initial observation.

This method should be implemented by the user. This method can internally call setNextAgent() to set the next agent to interact with.

◆ resetDone()

void MLBridge::Environment::resetDone ( )
inline

Definition at line 70 of file environment.h.

◆ setDone()

void MLBridge::Environment::setDone ( )
inline

SetDone sets the termination condition to true.

Definition at line 69 of file environment.h.

◆ setNextAgent()

void MLBridge::Environment::setNextAgent ( std::string name)
inline

SetNextAgent sets the name of the next agent to interact with.

Definition at line 76 of file environment.h.

◆ step()

virtual Observation & MLBridge::Environment::step ( Action action)
pure virtual

Step function takes an action as input and returns the observation corresponding to the next state.

This method should be implemented by the user. Typically this method should call setDone() if the termination condition is met. setNextAgent() can be called in this method to set the next agent to interact with.

Member Data Documentation

◆ done

bool MLBridge::Environment::done = false
private

Definition at line 57 of file environment.h.

◆ nextAgent

std::string MLBridge::Environment::nextAgent = ""
private

Definition at line 58 of file environment.h.

◆ obsMap

std::map<std::string, Observation &> MLBridge::Environment::obsMap
protected

Definition at line 61 of file environment.h.


The documentation for this class was generated from the following file: