Skip to content

Population history #178

Closed Answered by bluescarni
juan11iguel asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @juan11iguel !

UDPs in pygmo are stateful objects, so if you want to track the history of the decision vectors "seen" by the problem you can just add a tiny bit of code to the objective function that appends the decision vector/fitness to a list to be stored as a data member of the UDP.

After your UDP has been wrapped in a pygmo problem, you can fetch a reference to it via the extract() method, and via the reference you can access the list stored as data member.

https://esa.github.io/pygmo2/problem.html#pygmo.problem.extract

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by juan11iguel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants