Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mdl.minimize(mdl.sum(qty[s] * s.cost for s in server))
mdl.print_information()
url = None
key = None
if not mdl.solve(url=url, key=key):
print("*** Problem has no solution")
else:
mdl.float_precision = 3
print("* model solved as function:")
mdl.report()
mdl.print_solution()
mdl.report_kpis()
mdl.export_as_lp("cplex.lp")
os.system("cat cplex.lp")
# Save the CPLEX solution as "solution.json" program output
with get_environment().get_output_stream("instances.json") as fp:
mdl.solution.export(fp, "json")
return