'make sure the parameters lie between the limits'

def _ensure_constraint(self, trial):

    for (index, param) in enumerate(trial):
        if ((param > 1) or (param < 0)):
            trial[index] = self.random_number_generator.rand()
