src.environment.basic_environment¶
Module Contents¶
Classes¶
An environment with a problem and an optimizer. |
API¶
- class src.environment.basic_environment.PBO_Env(problem: src.environment.problem.basic_problem.Basic_Problem, optimizer: src.environment.optimizer.learnable_optimizer.Learnable_Optimizer)[source]¶
Bases:
gym.EnvAn environment with a problem and an optimizer.
Initialization
- reset()[source]¶
Introduction¶
Resets the environment and initializes the optimizer’s population based on the current problem(s).
Args:¶
None
Returns:¶
Any: The initialized population returned by the optimizer’s
init_populationmethod.
Notes:¶
If
self.problemis a list, each problem in the list is reset individually.Otherwise, the single problem is reset.
- step(action: Any)[source]¶
Introduction¶
Executes a single step in the environment by applying the given action using the optimizer and problem instances.
Args:¶
action (Any): The action to be applied in the environment, which will be processed by the optimizer.
Returns:¶
Any: The result of the optimizer’s update method after applying the action to the problem.