esa / pagmo2

A C++ platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
https://esa.github.io/pagmo2/
GNU General Public License v3.0
808 stars 160 forks source link

[BUG]cstrs_self_adaptive hides the problems integer dimensions from the algorithm #465

Open SchwarzschildX opened 3 years ago

SchwarzschildX commented 3 years ago

Describe the bug If a constrained integer problem is solved using cstrs_self_adaptive with pagmo::sga (or any other integer capable algorithm), the decision vectors consist of floating point numbers instead of integers.

Expected behavior Using cstrs_self_adaptive on constrained integer problems creates integer decision vectors.

Environment (please complete the following information):

Idea As far as I understand, cstrs_self_adaptive creates a penalized_udp of the original problem. This penalized_udp simply must relay the get_nix to the underlying problem.

vector_double::size_type penalized_udp::get_nix() const {
    return m_pop_ptr->get_problem().get_nix();
}
bluescarni commented 3 years ago

Thanks for the report. I am going to ping @darioizzo for this as he wrote the algorithm originally.

SchwarzschildX commented 3 years ago

to summarize:

SchwarzschildX commented 3 years ago

466 pull request