evolvepy.integrations.gym package
Submodules
evolvepy.integrations.gym.gym module
- class evolvepy.integrations.gym.gym.GymFitnessFunction(env_name: str, show: bool = False, save: bool = False)[source]
Bases:
ProcessFitnessFunction
,ABC
Evaluates individuals using a Gym. Must be inherited by the user.
Can be used with ProcessEvaluator. As the sum of the rewards obtained by the individual during the evaluation.
- __init__(env_name: str, show: bool = False, save: bool = False) None [source]
GymFitnessFunction constructor.
- Parameters:
env_name (str) – Name of the environment that will be used for the evaluation.
show (bool, optional) – Whether to show the graphical output of the environment. Defaults to False.
save (bool, optional) – Whether to save the graphical output in a file. Defaults to False.
- abstract behaviour(obs: object, individual: ndarray) object [source]
Individual behavior. Receives the observation and returns the action.
Must be implemented by the user.
- Parameters:
obs (object) – Environment observation.
individual (np.ndarray) – Individual being evaluated.
- Returns:
Individual action.
- Return type:
object
Module contents
EvolvePy’s integration with OpenAi’s Gym (https://gym.openai.com/).