Episode Plot (Abstract)

The EpisodePlot is the base class for all plots that plot data with number of episodes on the x-axis.

class gym_electric_motor.visualization.motor_dashboard_plots.EpisodePlot[source]

Base Plot class that all episode based plots .

initialize(axis)

Initialization of the plot.

It is called by the MotorDashboard. Set labels, legends… when overriding this method.

Parameters:

axis (matplotlib.pyplot.axis) – Axis to plot in

on_close()

Gets called at the beginning of a close

on_reset_begin()[source]

Gets called at the beginning of each reset

on_reset_end(state, reference)

Gets called at the end of each reset

on_step_begin(k, action)

Gets called at the beginning of each step

on_step_end(k, state, reference, reward, terminated)

Gets called at the end of each step

render()

Update of the plots axis.

The current x and y-data are written onto the respective lines in this methods. Furthermore the x- and y-axes are scaled dynamically.

reset_data()[source]

Called by the dashboard, when the figures are reset to generate a new figure.

set_env(env)

Sets the environment of the motor.