def __init__(self, num_variables=10, peaks=None, **kwargs): """Constructor. Parameters ---------- num_variables : int, optional The search space dimension. peaks : sequence of Peak Previously prepared peaks. If None, a few peaks are generated randomly. kwargs Arbitrary keyword arguments, passed through to the constructor of the super class. """ self.min_bounds = [0.0] * num_variables self.max_bounds = [1.0] * num_variables TestProblem.__init__(self, self.objective_function, num_objectives=1, **kwargs) self.num_variables = num_variables self.peaks = peaks if peaks is None: self.peaks = self.rand_uniform_peaks(num_variables=num_variables) self.is_deterministic = True
def __init__(self, num_variables=30, phenome_preprocessor=None, **kwargs): """Constructor. Parameters ---------- num_variables : int, optional The search space dimension. phenome_preprocessor : callable, optional A callable potentially applying transformations or checks to the phenome. Modifications should only be applied to a copy of the input. The (modified) phenome must be returned. Default behavior is to do no processing. kwargs Arbitrary keyword arguments, passed through to the constructor of the super class. """ preprocessor = BinaryChecker(num_variables, phenome_preprocessor) TestProblem.__init__(self, one_max, num_objectives=1, phenome_preprocessor=preprocessor, **kwargs) self.num_variables = num_variables self.is_deterministic = True self.do_maximize = True
def __init__(self, num_variables,fid,iid=1, phenome_preprocessor=None, **kwargs): self.is_deterministic = True self.do_maximize = False self.num_variables = num_variables self.min_bounds = [-5] * num_variables self.max_bounds = [5] * num_variables bounds = (self.min_bounds, self.max_bounds) self.fitness, self.best = bn.instantiate(fid,iid) preprocessor = BoundConstraintsChecker(bounds, phenome_preprocessor) TestProblem.__init__(self, self.objective_function, phenome_preprocessor=preprocessor, **kwargs)
def __init__(self, num_variables, fid, iid=1, phenome_preprocessor=None, **kwargs): self.is_deterministic = True self.do_maximize = False self.num_variables = num_variables self.min_bounds = [-5] * num_variables self.max_bounds = [5] * num_variables bounds = (self.min_bounds, self.max_bounds) self.fitness, self.best = bn.instantiate(fid, iid) preprocessor = BoundConstraintsChecker(bounds, phenome_preprocessor) TestProblem.__init__(self, self.objective_function, phenome_preprocessor=preprocessor, **kwargs)