Skip to content

Refactor optimization type handling and update documentation#17

Merged
KarloKnezevic merged 1 commit into
masterfrom
refactor
Oct 31, 2025
Merged

Refactor optimization type handling and update documentation#17
KarloKnezevic merged 1 commit into
masterfrom
refactor

Conversation

@KarloKnezevic

Copy link
Copy Markdown
Owner

This commit refactors the optimization type handling across the framework to use the new min and max values instead of the previous MINIMIZE and MAXIMIZE. Key changes include:

  • Updated the OptimizationType enum and related classes to reflect the new naming convention.
  • Adjusted the Problem and Population interfaces to utilize the new optimization types.
  • Modified selection algorithms to ensure compatibility with the new optimization logic.
  • Enhanced documentation in README.md, configuration.md, and architecture.md to clarify the changes and usage of the new optimization types.
  • Removed deprecated classes and methods related to the old optimization type handling.

These changes improve code clarity and maintainability while ensuring backward compatibility with existing configurations.

This commit refactors the optimization type handling across the framework to use the new `min` and `max` values instead of the previous `MINIMIZE` and `MAXIMIZE`. Key changes include:
- Updated the `OptimizationType` enum and related classes to reflect the new naming convention.
- Adjusted the `Problem` and `Population` interfaces to utilize the new optimization types.
- Modified selection algorithms to ensure compatibility with the new optimization logic.
- Enhanced documentation in `README.md`, `configuration.md`, and `architecture.md` to clarify the changes and usage of the new optimization types.
- Removed deprecated classes and methods related to the old optimization type handling.

These changes improve code clarity and maintainability while ensuring backward compatibility with existing configurations.
@KarloKnezevic KarloKnezevic merged commit b5920f4 into master Oct 31, 2025
3 of 4 checks passed
@KarloKnezevic KarloKnezevic deleted the refactor branch October 31, 2025 01:10

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 99 to +105
for (int i = 0; i < config.getPopulationSize(); i++) {
offspring.add(createOffspring());
}

// Evaluate all offspring in parallel if context provides executor
long e0 = System.nanoTime();
evaluatePopulation(offspring);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Avoid re-evaluating CGP offspring twice per generation

In generational mode each child is already evaluated inside createOffspring() (problem.evaluate(child)), yet runGenerationalEpoch() immediately calls evaluatePopulation(offspring) on the same collection. This invokes problem.evaluate a second time for every individual, doubling runtime and inflating evaluation counters. For problems with side effects or stochastic evaluation this also changes fitness values unexpectedly. Drop the extra evaluatePopulation call or skip the per-child evaluation to ensure each offspring is scored exactly once.

Useful? React with 👍 / 👎.

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.

1 participant