Skip to content

Commit

Permalink
Update recipes/007_benchmarks_advanced.py
Browse files Browse the repository at this point in the history
Co-authored-by: Shuhei Watanabe <[email protected]>
  • Loading branch information
y0z and nabenabe0928 authored Dec 17, 2024
1 parent 2394c0b commit edabb38
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion recipes/007_benchmarks_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ def evaluate_constraints(self, params: dict[str, float]) -> tuple[float]:
x = params["x"]
c0 = x - 2
if "y" not in params:
return [c0]
c1 = 0.0 # c1 <= 0, so c1 is satisfied in this case.
return c0, c1
else:
y = params["y"]
c1 = x + y - 3
Expand Down

0 comments on commit edabb38

Please sign in to comment.