Pagmo2 user-defined selection and replacement policies how to convey island of origin? #558
Replies: 4 comments 1 reply
-
To clarify, my question is: Can I use the individuals' IDs (type pagmo::individuals_group_t) in outgoing migrants to indicate the island of origin. In this case, I would define UDSP (user-defined selection policy) which 1. passes in a pointer to the calling island and 2. sets the outgoing migrants' IDs all to a number which identifies the island with information from the island pointer. Basically, I want my UDRP (user-defined replacement policy) to be able to detect the last island each migrant came from so it can act accordingly, and I propose to do this via the migrant's ID number. |
Beta Was this translation helpful? Give feedback.
-
I am not 100% sure I understand your exact question, but it seems to me you want to make some decision based on the past migration path taken by individuals (e.g. where did a certain individual originate from). Inspecting the global migration log (https://esa.github.io/pygmo2/archipelago.html#pygmo.archipelago.get_migration_log) of the archipealgo would maybe provide an answer and inform your decisions? |
Beta Was this translation helpful? Give feedback.
-
side effect will be that the migration log will no longer allow to track the full individual migration history. but if you do not care, it should work. I still do not understand why not using the migration log directly though. |
Beta Was this translation helpful? Give feedback.
-
Hi Dario,
Thanks for your post. That makes sense. I will look into using the full
migration history as this sounds like the right way to go. My method was
the first thing I thought of.
Thanks again,
Phil
…On Wed, Nov 22, 2023 at 10:33 AM Dario Izzo ***@***.***> wrote:
side effect will be that the migration log will no longer allow to track
the full individual migration history. but if you do not care, it should
work. I still do not understand why not using the migration log directly
though.
—
Reply to this email directly, view it on GitHub
<#558 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB5GXWUPHLAFWRWT3AAWW3DYFYZOVAVCNFSM6AAAAAA6TLKTUCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM3TMNBUHEYDK>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I am using the C++ Pagmo2 ver 2.19 optimization library and I need to define a custom i.e. user-defined selection and replacement policies.
My topology is a linear string of island, one island per frequency point, and I want to migrate the optimum values from the two adjacent frequency points (islands) to the island of concern.
Suppose the frequency points in GHz are: 2,3,4,5,6 and I want to perform a migration. For the selection policy I wish to select the two (or more) best members of the population of the island, i.e. pagmo::individuals_group_t, which have the two (or more) lower or optimum values of their objective functions.
My question concerns the replacement policy on the island receiving the migrants.
Namely, I would like the replacement policy to form the average of the best migrants from both adjacent islands replace a member of the population of the receiving island.
For instance, the 4GHz island (island with parameters at 4GHz) will replace one if its individuals with the average of the best individuals from adjacent islands.
My question is:
Is there any way to know the island where migrants come from? In my UDSP (user-defined selection policy) can I design my method:
pagmo::individuals_group_t select(const pagmo::individuals_group_t &inds, const pagmo::vector_double::size_type &nx,
const pagmo::vector_double::size_type &nix, const pagmo::vector_double::size_type &nobj,
const pagmo::vector_double::size_type &nec, const pagmo::vector_double::size_type &nic,
const pagmo::vector_double &constrainttol) const;
to produce a return (selected individuals) which have IDs indicating the island of origin? Can I also set IDs of multiple individuals of those returned by select() to be the same, say the value of frequency associated with the island?
If so, I could design the replacement policy on the other end, to act on the ID's of incoming migrants and my UDRP (user-defined replacement policy) would be aware of the island of origin for the incoming migrants and could apply replacement according to this information.
Is this possible or is there a better way for replacement policy to know the island of origin for incoming migrants?
Thanks and best,
Phil
Beta Was this translation helpful? Give feedback.
All reactions