Controller

io.github.srs.controller.RLControllerModule.Controller
trait Controller[S <: BaseState]

Controller trait defines the interface for a Reinforcement Learning controller.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Type members

Types

type Image = Array[Byte]

The type of the image used for rendering the simulation on the RL client.

The type of the image used for rendering the simulation on the RL client.

Attributes

Value members

Abstract methods

def init(config: SimulationConfig[ValidEnvironment]): Unit

Initializes the controller with the given simulation configuration.

Initializes the controller with the given simulation configuration.

Value parameters

config

the simulation configuration to initialize the controller.

Attributes

def initialState: S

The initial state of the controller.

The initial state of the controller.

Attributes

def render(width: Int, height: Int): Image

Renders the current state of the simulation to an image for the RL client.

Renders the current state of the simulation to an image for the RL client.

Value parameters

height

the height of the rendered image.

width

the width of the rendered image.

Attributes

Returns

an image representing the current state of the simulation.

def reset(rng: RNG): (Observations, Infos)

Resets the controller to its initial state using the provided random number generator.

Resets the controller to its initial state using the provided random number generator.

Value parameters

rng

the random number generator to use for reproducibility in the next run.

Attributes

def state: S

The current state of the controller.

The current state of the controller.

Attributes

def step(actions: Map[Agent, Action[IO]]): StepResponse

Performs a simulation step using the provided actions for each agent.

Performs a simulation step using the provided actions for each agent.

Value parameters

actions

a map of agents to their corresponding actions to be performed in this step.

Attributes

Returns

a response containing the results of the simulation step.