Skip to content

kbys-t/gym_MO

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gym_multiobjective

Dependency

OpenAI Gym

Installation

git clone https://github.com/kbys-t/gym_MO.git
cd gym_MO
pip install -e .

How to use

  1. First of all, import gym_multiobjective

  2. Select environment from ["CartPoleMO-v0", "AcrobotMO-v0", "AcrobotMO-v1", "BallArmMO-v0", "BallArmMO-v1"]

ENV_NAME = "AcrobotMO-v0"
env = gym.make(ENV_NAME)
  1. Prepare objectives
task_name = env.TASK_NAME
objective = np.zeros(env.TASK_NUM)
objective[0] = 1.0  # choice from 0 ~ env.TASK_NUM-1

It's desired to normalize objective to make reward within [-1, 1]

  1. Send objectives together with action
action = np.concatenate((action, objective))
observation, reward, done, info = env.step(action)

If objectives are not sent, the same types of reward as OpenAI Gym will be returned basically.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages