Arash-codedev / openGA

A free C++ Genetic Algorithm library
Mozilla Public License 2.0
219 stars 49 forks source link

Maximizing Cost #15

Open siyahkut opened 3 years ago

siyahkut commented 3 years ago

Generally i saw there is minimizing cost example. Are there any maximizing cost (target) example? Or which function i have to override for that?

thanks in advance

vudumus commented 3 years ago

Hi, how to add constraints in the code. Does it work with a Multi-objective Integer problem. I mean my optimization variables take only integers. Thanks.

Arash-codedev commented 3 years ago

Hi All, Thank you very much much considering openGA. Sorry for the delay. In case of urgency, please contact me through the email in the document.

@siyahkut, There is no maximization. If you want to maximize, please minimize the negation of the fitness (cost = - fitness).

@vudumus , For adding constraints, it is easy. If you want to reject a solution, return false in the evaluation function (eval_solution). It can be at the beginning, during of after the evaluation.