Created
June 8, 2020 09:35
-
-
Save pilifjed/82943790e4282b7176bc662d1fdff707 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MMF1(FloatProblem): | |
def __init__(self): | |
super(MMF1, self).__init__() | |
self.number_of_variables = 2 | |
self.number_of_objectives = 2 | |
self.number_of_constraints = 0 | |
self.obj_directions = [self.MINIMIZE, self.MINIMIZE] | |
self.obj_labels = ['x', 'y'] | |
self.lower_bound = [1.,-1.] | |
self.upper_bound = [3.,1.] | |
def evaluate(self, solution: FloatSolution) -> FloatSolution: | |
x = solution.variables | |
solution.objectives[0] = np.abs(x[0] - 2.) | |
solution.objectives[1] = 1.-np.sqrt(np.abs(x[0]-2.))+2*(x[1]-np.sin(6*np.pi*np.abs(x[0]-2.)+np.pi))**2. | |
return solution | |
def get_r(self, solution): | |
return solution.variables | |
def get_name(self): | |
return 'MMF1' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment