class ecole.typing.InformationFunction(*args, **kwargs)[source]

Class repsonsible for extracting the the information dictionnary.

Information functions are objects given to the Environment to extract the addtional information about the environment.

A common pattern is use additional ecole.typing.RewardFunction and ecole.typing.ObservationFunction to easily create information functions.

This class presents the interface expected to define a valid information function. It is not necessary to inherit from this class, as information functions are defined by structural subtyping. It is exists to support Python type hints.

See also


Information function are a specific type of generic data function where the data extracted are dictionnary of string to any type.

__init__(*args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

before_reset(model: ecole.scip.Model)None[source]

Reset internal data at the start of episodes.

The method is called on new episodes reset() right before the MDP is actually reset, that is right before the environment calls reset_dynamics().

It is usually used to reset the internal data.


model – The Model, model defining the current state of the solver.

extract(model: ecole.scip.Model, done: bool)Dict[str, ecole.typing.Information][source]

Extract the information on the given state.

Extract the information after transitionning on the new state given by model. The function is reponsible for keeping track of relevant information from previous states. This can safely be done in this method as it will only be called once per state i.e., this method is not a getter and can have side effects.

  • model – The Model, model defining the current state of the solver.

  • done – A flag indicating wether the state is terminal (as decided by the environment).


The return is passed to the user by the environment.


The list of information functions relevant to users is given below.


class ecole.information.Nothing
__init__(self: ecole.information.Nothing)None
before_reset(self: ecole.information.Nothing, model: ecole.scip.Model)None

Do nothing.

extract(self: ecole.information.Nothing, model: ecole.scip.Model, done: bool)Dict[str, None]

Return an empty dictionnary.