Mutation prob and multi variate function
aloukkal opened this issue · comments
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