Skip to content

Change Constraints Convention#42

Merged
electronsandstuff merged 10 commits intomainfrom
constraint-convention
Apr 18, 2025
Merged

Change Constraints Convention#42
electronsandstuff merged 10 commits intomainfrom
constraint-convention

Conversation

@electronsandstuff
Copy link
Owner

@electronsandstuff electronsandstuff commented Apr 17, 2025

This PR changes the constraint convention of ParetoBench from g(x) >= 0 representing a feasible individual to g(x) <= 0 being feasible. Many popular multi-objective optimization libraries also use this convention and standardizing will help users avoid confusing problems with the sign of their constraints not being correct.

The changes to accommodate this are the following.

  • All constrained problems had their constraints flipped when returning from _call
  • The default constraint direction in Population was changed to "<"
  • Population.g_canonical was modified to use the g<0 style constraint
  • History._from_h5py_group was modified to load experiments with file version 1.0.0 as having constraint direction ">". This should ensure compatibility with previously saved files.
  • The domination calculation in src/paretobench/utils.py was updated to use the new constraint definition.
  • Some tests which assumed the direction of the constraints had to be modified.

@electronsandstuff electronsandstuff merged commit 4ac60bc into main Apr 18, 2025
2 checks passed
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