mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 20:18:18 +00:00
y
This commit is contained in:
parent
99a9a4af03
commit
0ba306e7b3
|
@ -7926,9 +7926,12 @@ _on_model_eh = on_model_eh_type(_global_on_model)
|
||||||
class Optimize(Z3PPObject):
|
class Optimize(Z3PPObject):
|
||||||
"""Optimize API provides methods for solving using objective functions and weighted soft constraints"""
|
"""Optimize API provides methods for solving using objective functions and weighted soft constraints"""
|
||||||
|
|
||||||
def __init__(self, ctx=None):
|
def __init__(self, optimize=None, ctx=None):
|
||||||
self.ctx = _get_ctx(ctx)
|
self.ctx = _get_ctx(ctx)
|
||||||
self.optimize = Z3_mk_optimize(self.ctx.ref())
|
if optimize is None:
|
||||||
|
self.optimize = Z3_mk_optimize(self.ctx.ref())
|
||||||
|
else:
|
||||||
|
self.optimize = optimize
|
||||||
self._on_models_id = None
|
self._on_models_id = None
|
||||||
Z3_optimize_inc_ref(self.ctx.ref(), self.optimize)
|
Z3_optimize_inc_ref(self.ctx.ref(), self.optimize)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue