def sample(self, sampling_mode=None):
        """
        Sample a point in the leaf region with max competence progress (recursive).
        
        Parameters
        ----------
        sampling_mode : dict
            How to sample a point in the tree: {'multiscale':bool, 'mode':string, 'param':float}
            
        """
        if sampling_mode is None:
            sampling_mode = self.sampling_mode

        if sampling_mode['mode'] == 'random':
            return self.sample_random()
                
        elif sampling_mode['mode'] == 'greedy':
            return self.sample_greedy()
            
        elif sampling_mode['mode'] == 'epsilon_greedy':
            return self.sample_epsilon_greedy(sampling_mode['param'])
            
        elif sampling_mode['mode'] == 'softmax':
            return self.sample_softmax(sampling_mode['param'])
            
        else:
            raise NotImplementedError(sampling_mode)
Sample a point in the leaf region with max competence progress (recursive).
        
        Parameters
        ----------
        sampling_mode : dict
            How to sample a point in the tree: {'multiscale':bool, 'mode':string, 'param':float}