dacbench.wrappers.instance_sampling_wrapper
Module Contents
Classes
Wrapper to sample a new instance at a given time point. |
- class dacbench.wrappers.instance_sampling_wrapper.InstanceSamplingWrapper(env, sampling_function=None, instances=None, reset_interval=0)
Bases:
gym.WrapperWrapper to sample a new instance at a given time point. Instances can either be sampled using a given method or a distribution infered from a given list of instances.
- __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
- reset(self)
Reset environment and use sampled instance for training
- Returns
state
- Return type
np.array
- fit_dist(self, instances)
Approximate instance distribution in given instance set
- Parameters
instances (List) – instance set
- Returns
sampling method for new instances
- Return type
method