Skip to content

Environment

The configuration object shared by twinning and replay (held on ReplayBG.environment). Note that a bare Environment() defaults to seed=42, whereas ReplayBG() creates one with seed=1.

A class that represents the hyperparameters to be used by ReplayBG.

...

Attributes:

Name Type Description
ts int

An integer that specifies the integration time (in minutes).

seed int

An integer that specifies the random seed. For reproducibility.

plot_mode bool

A boolean that specifies whether to show the plot of the results or not.

verbose bool

A boolean that specifies the verbosity of ReplayBG.

Methods:

Name Description
None
Source code in src/py_replay_bg/environment/__init__.py
class Environment:
    """
    A class that represents the hyperparameters to be used by ReplayBG.

    ...
    Attributes
    ----------
    ts : int
        An integer that specifies the integration time (in minutes).
    seed : int
        An integer that specifies the random seed. For reproducibility.
    plot_mode : bool
        A boolean that specifies whether to show the plot of the results or not.
    verbose : bool
        A boolean that specifies the verbosity of ReplayBG.

    Methods
    -------
    None
    """

    def __init__(self,
                 ts: int = 1,
                 seed: int = 42,
                 plot_mode: bool = True,
                 verbose: bool = True
                 ):
        """
        Constructs all the necessary attributes for the Environment object.

        Parameters
        ----------

        ts : int, optional, default : 1
            An integer that specifies the integration time (in minutes).
        seed : int, optional, default : 42
            An integer that specifies the random seed. For reproducibility.
        plot_mode : boolean, optional, default : True
            A boolean that specifies whether to show the plot of the results or not.
        verbose : boolean, optional, default : True
            A boolean that specifies the verbosity of ReplayBG.
        """

        # Set integration time
        self.ts = ts


        # Set the seed
        self.seed = seed

        # Set plot mode and verbosity
        self.plot_mode = plot_mode
        self.verbose = verbose

ts = ts instance-attribute

seed = seed instance-attribute

plot_mode = plot_mode instance-attribute

verbose = verbose instance-attribute

__init__(ts=1, seed=42, plot_mode=True, verbose=True)

Constructs all the necessary attributes for the Environment object.

Parameters:

Name Type Description Default
ts int

An integer that specifies the integration time (in minutes).

: 1
seed int

An integer that specifies the random seed. For reproducibility.

: 42
plot_mode boolean

A boolean that specifies whether to show the plot of the results or not.

: True
verbose boolean

A boolean that specifies the verbosity of ReplayBG.

: True
Source code in src/py_replay_bg/environment/__init__.py
def __init__(self,
             ts: int = 1,
             seed: int = 42,
             plot_mode: bool = True,
             verbose: bool = True
             ):
    """
    Constructs all the necessary attributes for the Environment object.

    Parameters
    ----------

    ts : int, optional, default : 1
        An integer that specifies the integration time (in minutes).
    seed : int, optional, default : 42
        An integer that specifies the random seed. For reproducibility.
    plot_mode : boolean, optional, default : True
        A boolean that specifies whether to show the plot of the results or not.
    verbose : boolean, optional, default : True
        A boolean that specifies the verbosity of ReplayBG.
    """

    # Set integration time
    self.ts = ts


    # Set the seed
    self.seed = seed

    # Set plot mode and verbosity
    self.plot_mode = plot_mode
    self.verbose = verbose