Skip to content

Commit

Permalink
Add an assertion that checks if a model is optimal
Browse files Browse the repository at this point in the history
  • Loading branch information
teiesti committed Feb 22, 2024
1 parent 24dd784 commit 4d9a391
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions clintest/assertion.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,18 @@ def holds_for(self, model: Model) -> bool:
return set(model.symbols(shown=True)).issuperset(self.__symbols)


class Optimal(Assertion):
"""
An assertion that holds if the optimality of a model is proven.
"""

def __repr__(self):
return f"{self.__class__.__name__}()"

def holds_for(self, model: Model) -> bool:
return model.optimality_proven


class True_(Assertion):
"""
The assertion that is true for each model.
Expand Down

0 comments on commit 4d9a391

Please sign in to comment.