Skip to content

archipelago: auto-sync topology vertex count in set_topology to preve… - #626

Open
jschueller wants to merge 1 commit into
esa:masterfrom
jschueller:issue606
Open

archipelago: auto-sync topology vertex count in set_topology to preve…#626
jschueller wants to merge 1 commit into
esa:masterfrom
jschueller:issue606

Conversation

@jschueller

Copy link
Copy Markdown
Contributor

…nt crash

Calling set_topology() with a freshly constructed topology (e.g. pagmo::topology(pagmo::ring())) would replace the archipelago's topology with one having 0 vertices, while the archipelago may already contain islands. Subsequent evolve() would then crash when get_connections() is called with an out-of-bounds vertex index.

Fix by adding a num_vertices() method to the topology class and modifying set_topology() to automatically call push_back() until the topology has enough vertices for all existing islands.

Fixes #606

…nt crash

Calling set_topology() with a freshly constructed topology (e.g.
pagmo::topology(pagmo::ring())) would replace the archipelago's
topology with one having 0 vertices, while the archipelago may
already contain islands. Subsequent evolve() would then crash when
get_connections() is called with an out-of-bounds vertex index.

Fix by adding a num_vertices() method to the topology class and
modifying set_topology() to automatically call push_back() until
the topology has enough vertices for all existing islands.

Fixes esa#606
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] set_topology causing crash.

1 participant