dacbench.wrappers.performance_tracking_wrapper

Module Contents

Classes

PerformanceTrackingWrapper

Wrapper to track episode performance.

dacbench.wrappers.performance_tracking_wrapper.current_palette
class dacbench.wrappers.performance_tracking_wrapper.PerformanceTrackingWrapper(env, performance_interval=None, track_instance_performance=True, logger=None)

Bases: gym.Wrapper

Wrapper to track episode performance. Includes interval mode that returns performance in lists of len(interval) instead of one long list.

__setattr__(self, name, value)

Set attribute in wrapper if available and in env if not

Parameters
  • name (str) – Attribute to set

  • value – Value to set attribute to

__getattribute__(self, name)

Get attribute value of wrapper if available and of env if not

Parameters

name (str) – Attribute to get

Returns

Value of given name

Return type

value

step(self, action)

Execute environment step and record performance

Parameters

action (int) – action to execute

Returns

state, reward, done, metainfo

Return type

np.array, float, bool, dict

get_performance(self)

Get state performance

Returns

all states or all states and interval sorted states

Return type

np.array or np.array, np.array or np.array, dict or np.array, np.arry, dict

render_performance(self)

Plot performance

render_instance_performance(self)

Plot mean performance for each instance