Skip to content

Confused about current_island_counter #351

@lyx1237

Description

@lyx1237

In process_parallel.py, start from line 545:

# Island management
  if (
      completed_iteration > start_iteration
      and current_island_counter >= programs_per_island
  ):
      self.database.next_island()
      current_island_counter = 0
      logger.debug(f"Switched to island {self.database.current_island}")

  current_island_counter += 1
  self.database.increment_island_generation()

  # Check migration
  if self.database.should_migrate():
      logger.info(f"Performing migration at iteration {completed_iteration}")
      self.database.migrate_programs()
      self.database.log_island_status()

I suppose self.database.increment_island_generation() is used to compute how many programs are in a specific island. But ProgramDatabase.current island does not equal to the island that receives a new program. And current_island_counter is also confusing because it does not count anything about 'current island', I even did not see how it trace the current island. If my understanding was not too wrong, the following code should be proper:

# get current program island id
island_id = child_program.metadata.get(
    "island", self.database.current_island
)

use this to increment island generation
self.database.increment_island_generation(island_idx=island_id)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions