Wrappers and Utils¶
A wrapper is an environment transformation that takes in an environment as input, and outputs a new environment that is similar to the input environment, but with some transformation or validation applied.
For conversion between AEC
and Parallel
APIs, the native MOMAland wrappers must be used. On top of conversion wrappers, there are also a few utility wrappers.
Wrappers for the AEC
and Parallel
wrappers are split into their own modules and can be accessed like momaland.utils.parallel_wrappers.LinearizeReward
.
Conversion¶
AEC to Parallel
¶
- class momaland.utils.conversions.mo_aec_to_parallel_wrapper(aec_env)[source]¶
Converts an AEC environment into a Parallel environment.
Overrides PZ behavior to handle vectorial rewards. Keeping inheritance avoids code duplication and checks for instance type.
Converts an MO AEC environment into a MO Parallel environment.
Parallel to AEC
¶
- class momaland.utils.conversions.mo_parallel_to_aec_wrapper(parallel_env)[source]¶
Converts a parallel environment into an AEC environment.
Overrides PZ behavior to handle vectorial rewards. Keeping inheritance avoids code duplication and checks for instance type.
Converts a MO parallel environment into an MO AEC environment.