tristandeleu/pytorch-maml-rl

How do gym.make go to envs/mujoco/ant.py or half_cheetah.py

Closed this issue · 1 comments

Dear author:
I have a small question when trying to understand your code.
I saw you make env by call:

def make_env(env_name):
	"""
	return a function
	:param env_name:
	:return:
	"""
	def _make_env():
		return gym.make(env_name)

	return _make_env

However, you dont call ant.py or half_cheetah.py explicitly. So I wonder How do the gym know you have implemented this class HalfCheetahDirEnv and HalfCheetahVelEnv etc?

In gym you can register custom environments so that you can call them with gym.make. The registrations are done here.