haris989 / NSGA-II

This is a python implementation of NSGA-II algorithm. NSGA is a popular non-domination based genetic algorithm for multi-objective optimization. It is a very effective algorithm but has been generally criticized for its computational complexity, lack of elitism and for choosing the optimal parameter value for sharing parameter σshare. A modified version, NSGA II was developed, which has a better sorting algorithm , incorporates elitism and no sharing parameter needs to be chosen a priori.
MIT License
380 stars 158 forks source link

Mutation prob and multi variate function #2

Open aloukkal opened 6 years ago

aloukkal commented 6 years ago

Hello Haris,

First of all thank you very much for sharing this work. I have a question regarding mutation prob. You wrote if mutation_prob < 1 but as random.random() outputs values between 0 and 1, should we make it less than 1 ? and I have a question regarding multi variate objective function, how would you define the solutions and the mutation ? i did it this way:

def mutation(solution):
    mutation_prob = random.random()
    if mutation_prob <0.5:
        solution = [min_x+(max_x-min_x)*random.random(), min_x+(max_x-min_x)*random.random()]
    return solution

solution=[[min_x+(max_x-min_x)*random.random(),min_x+(max_x-min_x)*random.random()]  for i in range(0,pop_size)]

thanks