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

Setting parameter constraints of the form x - y >= 1 #178

Closed
dqii opened this issue Oct 9, 2019 · 5 comments
Closed

Setting parameter constraints of the form x - y >= 1 #178

dqii opened this issue Oct 9, 2019 · 5 comments
Labels
enhancement New feature or request fixready Fix has landed on master.

Comments

@dqii
Copy link

dqii commented Oct 9, 2019

It seems like parameter restraints are very strict, so x - y >= 1 does not work. Is it possible to support this in the future or does something prevent it?

"Parameter constraint should be of form <parameter_name> >= <other_parameter_name> for order constraints or <parameter_name> + <other_parameter_name> >= x, where any number of parameters can be summed up and x` is a float bound. Acceptable comparison operators are ">=" and "<=".'

@2timesjay
Copy link
Contributor

Using the ParameterConstraint class,

ParameterConstraint(constraint_dict={"x": 1, "y": -1}, bound=1)

Will work. Constraints of this form cannot currently be parsed from strings expressions.

@lena-kashtelyan
Copy link
Contributor

@dqii, it seems that you are using the Service or Loop APIs? For those, only addition is supported at the moment, but I will flag this as something we need to add. To use the answer Jacob provided above, you would need to use the Developer API.

Also, one solution could be simply changing your problem setup such that you convert y to -y in your evaluation procedure –– that might be the fastest way to get your constraint working for now.

@lena-kashtelyan lena-kashtelyan added the enhancement New feature or request label Oct 10, 2019
@dqii
Copy link
Author

dqii commented Oct 10, 2019

Correct, I'm using the Loop API currently. Thanks for the response!

@lena-kashtelyan lena-kashtelyan added the fixready Fix has landed on master. label Nov 4, 2019
@lena-kashtelyan
Copy link
Contributor

@dqii, this functionality is now available on master, check latest version for installation instructions. This will also be included in the next stable version when it comes out.

@lena-kashtelyan
Copy link
Contributor

This functionality is now part of the latest stable version, 0.1.8!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixready Fix has landed on master.
Projects
None yet
Development

No branches or pull requests

3 participants