seed API documentation

# seed

View Source

     1import os
     2import random
     3
     4import numpy as np
     5from gymnasium.utils import seeding
     6
     7SEED = None
     8
     9
    10def set_seed(seed: int) -> None:
    11    global SEED
    12    SEED = seed
    13    os.environ["PYTHONHASHSEED"] = str(SEED)
    14    random.seed(SEED)
    15    np.random.seed(SEED)
    16    seeding.np_random(SEED)

SEED = None
def set_seed(seed: int) -> None: View Source

    11def set_seed(seed: int) -> None:
    12    global SEED
    13    SEED = seed
    14    os.environ["PYTHONHASHSEED"] = str(SEED)
    15    random.seed(SEED)
    16    np.random.seed(SEED)
    17    seeding.np_random(SEED)