You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lot of tests that uses constraint return Floats as return arg of function. E.g.:
def constraint(x,y):
condition = 25.
g = condition - ((x+5.)**2 + (y+5.)**2)
return g
def constrain(self):
"""
Constrain calls the constraint function.
@ In, self, object, RAVEN container
@ Out, explicitConstrain, float, positive if the constraint is satisfied
and negative if violated.
"""
explicitConstrain = constraint(self.x,self.y)
return explicitConstrain
since in the code the Constraint are evaluated as boolean, this form of the constraint is Always true, making this test not testing what it wants to test (the constraint is never violated)
Steps to Reproduce
In RavenSampled.py
modify lines where the constraint functions are evaluated with a check for boolean (and run the test suite)
I checked the code again. The Genetic Algorithm overloads the constrain function and it expects a float as constrain (positive=> violated, negative not)... This is against what it is written in the manual.
@JunyungKim Could you update the manual to resolve the confusion? and add a check in the GA code to make sure the constrain returns are float instead of boolean?
Thank you for the defect report
RAVEN
.that demonstrates the defect.
Defect Description
A lot of tests that uses constraint return Floats as return arg of function. E.g.:
since in the code the Constraint are evaluated as boolean, this form of the constraint is Always true, making this test not testing what it wants to test (the constraint is never violated)
Steps to Reproduce
In RavenSampled.py
modify lines where the constraint functions are evaluated with a check for boolean (and run the test suite)
e.g.
from
to
and
from
to
Expected Behavior
that the constrain is evaluated and that the code errors out if no boolean are returned
Screenshots and Input Files
No response
OS
Linux
OS Version
No response
Dependency Manager
PIP
For Change Control Board: Issue Review
For Change Control Board: Issue Closure
The text was updated successfully, but these errors were encountered: