openGA icon indicating copy to clipboard operation
openGA copied to clipboard

Maximizing Cost

Open siyahkut opened this issue 4 years ago • 2 comments

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

siyahkut avatar Apr 17 '21 12:04 siyahkut

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

i have found it. i have changed finalize_generation function's line as best=std::max(best,current_cost);

siyahkut avatar Apr 17 '21 12:04 siyahkut

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.

vudumus avatar May 15 '21 23:05 vudumus

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.

Arash-codedev avatar Jun 08 '21 19:06 Arash-codedev