Open castanhas98 opened 2 years ago
Problem is revealed by the line:
https://github.com/esa/pagmo_plugins_nonfree/blob/master/src/snopt7.cpp#L715
the struct info contains a full instance of problem that is then copied .... a solution to try is to store a pointer rather than an instance as data member of the user_data struct:
Problem is revealed by the line:
https://github.com/esa/pagmo_plugins_nonfree/blob/master/src/snopt7.cpp#L715
the struct info contains a full instance of problem that is then copied .... a solution to try is to store a pointer rather than an instance as data member of the user_data struct:
@darioizzo, I believe I managed to get your suggestion to work, but there is the need to remove the const
qualifier from prob
in the line below:
https://github.com/esa/pagmo_plugins_nonfree/blob/a784bd3bfdba8e3c253bbeff627af18da92f7ce1/src/snopt7.cpp#L514
Both just removing the const
in that line or making a const_cast
to pagmo::problem *
when assigning the problem in the user_data
struct seem to do the trick.
I honestly do not know which would be the preferred option, or if there are others that I am not considering. Any thoughts on this?
EDIT:
I believe I was creating a problem where there was none. user_data
storing a pointer to a const pagmo::problem
seems to be enough.
EDIT2: I took the liberty to submit a pull request in an attempt to solve this issue. Will wait for feedback.
As stated in the title, pagmo does not seem to be able to retrieve the number of function evaluations performed by SNOPT.
Below is an example similar to the one found in https://esa.github.io/pagmo_plugins_nonfree/quickstart.html with some changes.
This produces the following output:
As it can be seen, the number of fitness evaluations indicated by the population is not the same as the number of lines (=function evaluations) of the log when the verbosity is set to 1.