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
816 stars 161 forks source link

Program crashes on archi.wait_check(); #233

Closed nconsulting closed 5 years ago

nconsulting commented 5 years ago

Hi,

I have written in C++ a non linear integer optimization problem with 1 objective function and 3 inequality constraints. I have used the algorithms sga and nsga2. Both crash when archi.wait_check(); is called. The crash happened when I added the 3 inequality constraints. It creates when population fine, but when it has to evolve and wait_check, it crashes.

I just tested with the ihs algorithm and using that algorithm my program doesn't crash. However, it is not usable because after the evolve step the decision variables become doubles instead of just integers, which is not usable for me.

Any ideas where I should start debugging my problem and what this issue may cause?

Kind regards,

Nick

bluescarni commented 5 years ago

Can you give more details? How does it crash?

archi.wait_check() will re-raise any exception that was thrown during the asynchronous evolution, so perhaps the algorithms sga/nsga2 are raising some error. Did you check the documentation of those algorithms?

https://esa.github.io/pagmo2/docs/algorithm_list.html

nconsulting commented 5 years ago

Thank you for your reply. I added a screenshot of the error that I get (it is not very descriptive). error

I just checked the documentation.

sga - evolve() throws an error when the problem is constrained nsga2 - evolve() throws an error when the problem is single objective

Since my problem has only one objective evolve throws an error and archi.wait_check() makes my program crash. And since my problem has constraints sga isn't working and makes my program crash. Are the above 2 statements correct?

So that only leaves ihs - for a single objective, constrained integer problem . Correct?

Is there a way to make sure that ihs only selects integers for the decision variables? Because now when I start the program with the ihs algorithm the decision variables are all integer values, but after an evolve step they become (mostly) doubles.

bluescarni commented 5 years ago

Ah yeah I see, error messages on uncaught exceptions are usually more descriptive in linux :)

I will have to ping again @darioizzo regarding your questions, as he is the algorithmic expert.

On a side note, we usually encourage users to join the chat channel rather than opening new issues for questions on pagmo/pygmo's usage:

https://gitter.im/pagmo2/Lobby

darioizzo commented 5 years ago

The integer variables have to be defined by implementing in the UDP the get_nix method, please see the documentation (https://esa.github.io/pagmo2/docs/python/py_problem.html) and tutorials (https://esa.github.io/pagmo2/docs/python/tutorials/coding_udp_minlp.html)

bluescarni commented 5 years ago

I'll go ahead and close this, as this is not a pagmo crash.