dacbench.wrappers.policy_progress_wrapper

Module Contents

Classes

PolicyProgressWrapper

Wrapper to track progress towards optimal policy.

class dacbench.wrappers.policy_progress_wrapper.PolicyProgressWrapper(env, compute_optimal)

Bases: gym.Wrapper

Wrapper to track progress towards optimal policy. Can only be used if a way to obtain the optimal policy given an instance can be obtained

__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 distance

Parameters

action (int) – action to execute

Returns

state, reward, done, metainfo

Return type

np.array, float, bool, dict

render_policy_progress(self)

Plot progress