mlrl.testbed.experiments.output.writer module

Author Michael Rapp (michael.rapp.ml@gmail.com)

Provides classes for writing output data to sinks.

class mlrl.testbed.experiments.output.writer.DataExtractor

Bases: ABC

An abstract base class for all classes that extract output data from the state of an experiment.

abstractmethod extract_data(state: ExperimentState, sinks: List[Sink]) OutputData | None

Must be implemented by subclasses in order to extract output data from the state of an experiment.

Parameters:
  • state – The state from which the output data should be extracted

  • sinks – The sinks to which the extracted data should be written

Returns:

The output data that has been extracted or None, if no output data has been extracted

class mlrl.testbed.experiments.output.writer.OutputWriter(*extractors: DataExtractor)

Bases: object

Allows to write output data to one or several sinks.

add_sinks(*sinks: Sink) OutputWriter

Adds one or several sinks, output data should be written to.

Parameters:

sinks – The sinks to be added

Returns:

The OutputWriter itself

write(state: ExperimentState)

Writes the input data.

Parameters:

state – The current state of the experiment