def set_points_weights(self, points_weights = []): if not points_weights: msg = "No points weights provided. Defaulting to equal weights." verbose_p(msg) self.set_equal_points_weights() else: self.points_weights = points_weights
def __init__(self, name, points = [], points_weights = [], weight = 0.0, fit_penalty = 0.0): self.name = name if not points: msg = "No points provided. Cannot initialize empty objective." verbose_p(msg) return self.points = points if not points_weights: msg = "No points weights provided. Defaulting to equal weights." verbose_p(msg) self.points_weights = len(self.points)*[(1.0/(len(self.points) + 0.0))] else: self.points_weights = points_weights self.weight = weight self.fit_penalty = fit_penalty
def set_points(self, points = []): if not points: msg = "No points provided. Cannot initialize empty objective." verbose_p(msg) return self.points = points