dacbench.abstract_env

Module Contents

Classes

AbstractEnv

Abstract template for environments

class dacbench.abstract_env.AbstractEnv(config)

Bases: gym.Env

Abstract template for environments

step_(self)

Pre-step function for step count and cutoff

Returns

End of episode

Return type

bool

reset_(self, instance=None, instance_id=None, scheme=None)

Pre-reset function for progressing through the instance set Will either use round robin, random or no progression scheme

use_next_instance(self, instance=None, instance_id=None, scheme=None)

Changes instance according to chosen instance progession

Parameters
  • instance – Instance specification for potentional new instances

  • instance_id – ID of the instance to switch to

  • scheme – Update scheme for this progression step (either round robin, random or no progression)

abstract step(self, action)

Execute environment step

Parameters

action – Action to take

Returns

  • state – Environment state

  • reward – Environment reward

  • done (bool) – Run finished flag

  • info (dict) – Additional metainfo

abstract reset(self)

Reset environment

Returns

Environment state

Return type

state

get_inst_id(self)

Return instance ID

Returns

ID of current instance

Return type

int

get_instance_set(self)

Return instance set

Returns

List of instances

Return type

list

get_instance(self)

Return current instance

Returns

Currently used instance

Return type

type flexible

set_inst_id(self, inst_id)

Change current instance ID

Parameters

inst_id (int) – New instance index

set_instance_set(self, inst_set)

Change instance set

Parameters

inst_set (list) – New instance set

set_instance(self, instance)

Change currently used instance

Parameters

instance – New instance

seed_action_space(self, seed=None)

Seeds the action space. :param seed: if None self.initial_seed is be used :type seed: int, default None

seed(self, seed=None, seed_action_space=False)

Set rng seed

Parameters
  • seed – seed for rng

  • seed_action_space (bool, default False) – if to seed the action space as well

use_test_set(self)

Change to test instance set

use_training_set(self)

Change to training instance set