Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis/repopoulation crossover fix #52

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

travisdesell
Copy link
Owner

@travisdesell travisdesell commented Dec 12, 2024

Updated the repopulation methods so that:

  • intra-island crossover is done within an island if it is full (even if other islands are not full or repopulating).
  • inter-island crossover is done if the current island and any other island are full (as opposed to requiring all islands being full).
  • adds exporting genomes with required information to JSON for visualization of search progress
  • genomes now track the IDs of their parent(s)

Copy link
Collaborator

@jkarns275 jkarns275 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +3398 to +3401
int32_t* parent_ids_v = new int32_t[n_parent_ids];
bin_istream.read((char*) parent_ids_v, sizeof(int32_t) * n_parent_ids);
parent_ids.assign(parent_ids_v, parent_ids_v + n_parent_ids);
delete[] parent_ids_v;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't really matter but I would avoid duplicate allocation with:

    assert(n_parent_ids > 0);
    parent_ids.assign(n_parent_ids, 0);
    bin_istream.read((char *) &parent_ids[0], sizeof(int32_t) * n_parent_ids);

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.

2 participants