コード例 #1
0
    def __init__(self, *args, log_scale_limit=2.0, fix_params=False, rand_params=RAND_PARAMS, random_seed=None, fixed_goal=True, max_path_length=0, **kwargs):
        """
        Half-Cheetah environment with randomized mujoco parameters
        :param log_scale_limit: lower / upper limit for uniform sampling in logspace of base 2
        :param random_seed: random seed for sampling the mujoco model params
        :param fix_params: boolean indicating whether the mujoco parameters shall be fixed
        :param rand_params: mujoco model parameters to sample
        """
        assert set(rand_params) <= set(self.RAND_PARAMS_EXTENDED), \
            "rand_params must be a subset of " + str(self.RAND_PARAMS_EXTENDED)

        self.log_scale_limit = log_scale_limit
        self.random_seed = random_seed
        self.random_state = np.random.RandomState(random_seed)
        self.fix_params = fix_params  # can be changed by calling the fix_mujoco_parameters method
        self.rand_params = rand_params
        self.fixed_goal = fixed_goal
        self.parameters_already_fixed = False
        self.n_steps = 0
        self.reward_range = None
        self.metadata = {}
        if max_path_length is not None:
            self.max_path_length = max_path_length
        else:
            self.max_path_length = 10**8 #set to a large number

        args_all, kwargs_all = get_all_function_arguments(self.__init__, locals())
        Serializable.__init__(*args_all, **kwargs_all)
コード例 #2
0
    def __init__(self,
                 *args,
                 log_scale_limit=2.0,
                 fix_params=False,
                 fixed_goal=True,
                 random_seed=None,
                 **kwargs):
        self.sign = 1
        self.first = True
        self.penalty_ctrl = 0.01

        self.init_geom_size = None
        self.init_body_pos = None
        self.init_geom_pos = None

        args_all, kwargs_all = get_all_function_arguments(
            self.__init__, locals())
        BaseEnvRandParams.__init__(self,
                                   log_scale_limit=log_scale_limit,
                                   fix_params=fix_params,
                                   rand_params=['geom_size'],
                                   fixed_goal=fixed_goal,
                                   random_seed=random_seed)

        MujocoEnv.__init__(self, *args, **kwargs)
        Serializable.__init__(*args_all, **kwargs_all)
コード例 #3
0
 def __init__(self, *args, log_scale_limit=2.0, fix_params=False, rand_params=BaseEnvRandParams.RAND_PARAMS, random_seed=None, max_path_length=None, **kwargs):
     """
     Half-Cheetah environment with randomized mujoco parameters
     :param log_scale_limit: lower / upper limit for uniform sampling in logspace of base 2
     :param random_seed: random seed for sampling the mujoco model params
     :param fix_params: boolean indicating whether the mujoco parameters shall be fixed
     :param rand_params: mujoco model parameters to sample
     """
     args_all, kwargs_all = get_all_function_arguments(self.__init__, locals())
     BaseEnvRandParams.__init__(*args_all, **kwargs_all)
     ReacherEnv.__init__(self, *args, **kwargs)
     Serializable.__init__(*args_all, **kwargs_all)