Console Printer

class gym_electric_motor.visualization.console_printer.ConsolePrinter(verbose=0, update_freq=1)[source]

Prints current training values of the environment on the console.

These include environment state and reference values as well as the number of training steps, the rewards and the cumulative reward. It also shows why an episode has terminated (external, constraint violation)

Parameters:
  • verbose (Int) –

    Integer indicating whether and at which frequency the console will be printed. Options:

    0: No Printing 1: Printing after an episode has terminated 2: Printing at each step of an episode

  • update_freq (Int) – Unsigned Integer setting the update frequency if verbose is 2. It’s value n means that each nth step the corresponding output will be printed

on_close()

Gets called at the beginning of a close

on_reset_begin()[source]

Gets called on environment reset. Handles internal value reset and External reset printing

on_reset_end(state, reference)[source]

Gets called at the end of each reset

on_step_begin(k, action)[source]

Gets called at the beginning of each step

on_step_end(k, state, reference, reward, terminated)[source]

Gets called at each step of the environment. Handles per step printing as well es constraint violation printing

render()[source]

Function to update the user interface.

set_env(env)[source]

Gets the limits of the current physical system for accurate printing