pagmo icon indicating copy to clipboard operation
pagmo copied to clipboard

Multi objective Problems with Non Linear Constraints

Open redBirdTx opened this issue 6 years ago • 1 comments

Hi, For multi objective problems with non linear constraints, can we run the algorithms directly without framing the nonlinear constraints into the problem definition?

I am getting this error message when trying: (with moead, i got similar messages). Any help is appreciated. Thanks

ps-Sorry about the formatting, somehow the code insertion only recognizes part of the code

function: evolve where: C:\bld\pygmo_1495138803255\work\pagmo2-2.3\include\pagmo/algorithms/nsga2.hpp, 145 what: Non linear constraints detected in pygmo-test problem instance. NSGA-II cannot deal with them.

`<import pygmo as pg class myProb: def init(self, dim): self.dim = dim

def get_name(self):
    return "pygmo-test problem"

def get_nobj(self):
    return 3

def fitness(self, x):

    y1 = abs(361.92 - 5*x[4] - 329* x[5] + 72.86 *x[6] -39001*x[7] + 3258.69/x[13]-x[1])

    y2 = abs(70.09 - 7.92*x[8] + 1.33*x[9] + 2625.38/x[10]-7641.5*x[7] - 1103.24/(x[10]*x[11])- 2.14 *x[9]*x[12]-x[2])

    y3 = abs(-1.52 + 0.86 * x[13] + 0.000199* x[13] * x[13]*(-x[8]+ x[13])-x[3])
    
    nonlinearCon = x[4]*x[1]-x[5]

    return [y1, y2, y3, nonlinearCon]

def get_bounds(self):

    lb = [14, 170, 2.2, 8.29, 0.4, 0.16, 0.914, 0, 20.6, 9.48, 0.24, 0, 0, 5.87]

    ub = [18, 230, 2.8, 70., 1.19, 1.77, 0.93, 20, 345.5, 390, 15.0, 2, 67.77, 16.94]

    return (lb, ub)
def get_nic(self):
    return 1 #number of inequality constraints   

def get_extra_info(self):
    return "\tDimensions: " + str(self.dim)

probMy = pg.problem(myProb(3)) algo = pg.algorithm(pg.moead(gen = 1)) #algo = pg.algorithm(pg.nsga2(gen = 1)) pop = pg.population(probMy, 10*4) result = algo.evolve(pop)`

redBirdTx avatar Mar 23 '18 17:03 redBirdTx

I meet the same problem with you

kunyaoli avatar Apr 29 '22 07:04 kunyaoli