Skip to content

Commit

Permalink
Add pydoc on how to map the multi-objective reward to the original gy…
Browse files Browse the repository at this point in the history
…mnasium reward (#92)
  • Loading branch information
LucasAlegre authored Mar 15, 2024
1 parent 85a2215 commit bfac963
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions mo_gymnasium/envs/mujoco/ant.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ class MOAntEnv(AntEnv, EzPickle):
See [Gymnasium's env](https://gymnasium.farama.org/environments/mujoco/ant/) for more information.
The original Gymnasium's 'Ant-v4' is recovered by the following linear scalarization:
env = mo_gym.make('mo-ant-v4', cost_objective=False)
LinearReward(env, weight=np.array([1.0, 0.0]))
## Reward Space
The reward is 2- or 3-dimensional:
- 0: x-velocity
Expand Down
5 changes: 5 additions & 0 deletions mo_gymnasium/envs/mujoco/half_cheetah.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ class MOHalfCheehtahEnv(HalfCheetahEnv, EzPickle):
See [Gymnasium's env](https://gymnasium.farama.org/environments/mujoco/half_cheetah/) for more information.
The original Gymnasium's 'HalfCheetah-v4' is recovered by the following linear scalarization:
env = mo_gym.make('mo-halfcheetah-v4')
LinearReward(env, weight=np.array([1.0, 1.0]))
## Reward Space
The reward is 2-dimensional:
- 0: Reward for running forward
Expand Down
5 changes: 5 additions & 0 deletions mo_gymnasium/envs/mujoco/hopper.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ class MOHopperEnv(HopperEnv, EzPickle):
See [Gymnasium's env](https://gymnasium.farama.org/environments/mujoco/hopper/) for more information.
The original Gymnasium's 'Hopper-v4' is recovered by the following linear scalarization:
env = mo_gym.make('mo-hopper-v4', cost_objective=False)
LinearReward(env, weight=np.array([1.0, 0.0]))
## Reward Space
The reward is 3-dimensional:
- 0: Reward for going forward on the x-axis
Expand Down
5 changes: 5 additions & 0 deletions mo_gymnasium/envs/mujoco/swimmer.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ class MOSwimmerEnv(SwimmerEnv, EzPickle):
See [Gymnasium's env](https://gymnasium.farama.org/environments/mujoco/swimmer/) for more information.
The original Gymnasium's 'Swimmer-v4' is recovered by the following linear scalarization:
env = mo_gym.make('mo-swimmer-v4')
LinearReward(env, weight=np.array([1.0, 1e-4]))
## Reward Space
The reward is 2-dimensional:
- 0: Reward for moving forward (x-velocity)
Expand Down

0 comments on commit bfac963

Please sign in to comment.