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

Allow specifying objectives as maximization problem #115

Merged
merged 4 commits into from Mar 23, 2024

Conversation

schmoelder
Copy link
Contributor

@schmoelder schmoelder commented Mar 18, 2024

Currently, all objective functions are expected to return a value that is to be minimized.
However, in reality, objectives are often to be maximized (e.g. a productivity).

This PR adds a new flag to the add_objectives method. If minimize is False, the result will automatically be multiplied with -1 internally to convert the maximization problem to a minimization problem.
For reporting, the original value is then used.

Moreover, for nonlinear constraints, the user can now specify a comparison_operator (default='le') which is used to compare the output of the nonlinear constraint function with the specified bounds.
In any case, the "true" value of the nonlinear constraint function, as well as the constraint violation are stored for reporting, where positive values indicate the constraint is not satisfied.

To do

pending #114

  • Add minimize flag.
  • Add flag for nonlinear constraints
  • Update documentation (e.g. custom method for fractionation)

@schmoelder schmoelder changed the base branch from master to dev March 18, 2024 14:54
@schmoelder schmoelder force-pushed the feature/allow_maximization branch 3 times, most recently from a48ad18 to 85dac93 Compare March 20, 2024 15:29
@schmoelder schmoelder force-pushed the feature/allow_maximization branch 2 times, most recently from 9a67b46 to 6c9d6cb Compare March 20, 2024 18:00
@schmoelder schmoelder force-pushed the feature/allow_maximization branch 2 times, most recently from 9ef5c17 to ce942f4 Compare March 21, 2024 14:31
@schmoelder schmoelder merged commit cd4ad7f into dev Mar 23, 2024
5 checks passed
@schmoelder schmoelder deleted the feature/allow_maximization branch April 11, 2024 08:20
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.

None yet

1 participant