You can run this problem in a local environment with Docker using the following code.
Use the following command to installopthub-runner-pythonfrom PyPI.
pip install opthub-runner-pythonYou can use the evaluation function for masbench-sop with the following code.
You need to start Docker before running.
from opthub_runner.evaluator import Evaluator
evaluator = Evaluator(
"tkmnet/masbench:encrypted", # Docker image
{
"PASS": YOUR_PASS, #
"MODEL": YOUR_MODEL, #
}
)
result = evaluator.run(your_solution)
print(result["objective"]) # The objective value
print(result["feasible"]) # Feasibility of the solution
print(result["constraint"]) # Constraint
print(result["info"]) # Additional informationFor details on the Evaluator class, please refer tohttps://github.com/opthub-org/comp-runner-python.