TextRenderer#

class statrl.settings.markovdecisionprocess.discrete_nostructure.renderers.textRenderer.TextRenderer[source]#

Bases: object

Print each MDP step to stdout as a colourized row of states.

The current state is highlighted red and every state reachable from it in one step blue, alongside the action played and the reward it returned.

started#

Whether the header has been printed yet; emitted lazily on the first render().

Type:

bool

Methods

__init__()

render(env, last)

Print one step: the action, the reward, and the state row.

start(env)

Print the header naming the environment, its actions, and the legend.

stop(env)

Print the closing rule at the end of a rendered run.

render(env, last)[source]#

Print one step: the action, the reward, and the state row.

Parameters:
  • env (DiscreteMDP) – The environment being rendered.

  • last (tuple of (int, int or None, float)) – The (state, action, reward) triple recorded by the environment. A None action means no step has been taken yet, and only the state row is printed.

start(env)[source]#

Print the header naming the environment, its actions, and the legend.

Parameters:

env (object) – The environment being rendered.

stop(env)[source]#

Print the closing rule at the end of a rendered run.

Parameters:

env (object) – The environment being rendered.