<!doctype html>

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Module docplex.cp.solver.solver &#8212; DOcplex.CP: Constraint Programming Modeling for Python V2.25 documentation</title>
    <link rel="stylesheet" href="_static/bizstyle.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="_static/language_data.js"></script>
    <script type="text/javascript" src="_static/bizstyle.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Module docplex.cp.solver.solver_listener" href="docplex.cp.solver.solver_listener.py.html" />
    <link rel="prev" title="Module docplex.cp.config" href="docplex.cp.config.py.html" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <!--[if lt IE 9]>
    <script type="text/javascript" src="_static/css3-mediaqueries.js"></script>
    <![endif]-->
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="docplex.cp.solver.solver_listener.py.html" title="Module docplex.cp.solver.solver_listener"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="docplex.cp.config.py.html" title="Module docplex.cp.config"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">DOcplex.CP: Constraint Programming Modeling for Python V2.25 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="refman.html" accesskey="U"><strong>docplex.cp</strong> reference manual</a> &#187;</li> 
      </ul>
    </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Module <strong>docplex.cp.solver.solver</strong></a><ul>
<li><a class="reference internal" href="#detailed-description">Detailed description</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="docplex.cp.config.py.html"
                        title="previous chapter">Module <strong>docplex.cp.config</strong></a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="docplex.cp.solver.solver_listener.py.html"
                        title="next chapter">Module <strong>docplex.cp.solver.solver_listener</strong></a></p>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="module-docplex-cp-solver-solver">
<h1>Module <strong>docplex.cp.solver.solver</strong><a class="headerlink" href="#module-docplex-cp-solver-solver" title="Permalink to this headline">&para;</a></h1>
<div class="toctree-wrapper compound">
</div>
<span class="target" id="module-docplex.cp.solver.solver"></span><p>This module implements appropriate software to solve a CPO model represented by a
<a class="reference internal" href="docplex.cp.model.py.html#docplex.cp.model.CpoModel" title="docplex.cp.model.CpoModel"><code class="xref py py-class docutils literal notranslate"><span class="pre">docplex.cp.model.CpoModel</span></code></a> object.</p>
<p>It implements the following object classes:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver" title="docplex.cp.solver.solver.CpoSolver"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolver</span></code></a> contains the public interface allowing to make solving requests with a model.</li>
<li><a class="reference internal" href="#docplex.cp.solver.solver.CpoSolverAgent" title="docplex.cp.solver.solver.CpoSolverAgent"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolverAgent</span></code></a> is an abstract class that is extended by the actual implementation(s) of
the solving functions.</li>
</ul>
</div></blockquote>
<p>The <a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver" title="docplex.cp.solver.solver.CpoSolver"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolver</span></code></a> identifies and creates the required <a class="reference internal" href="#docplex.cp.solver.solver.CpoSolverAgent" title="docplex.cp.solver.solver.CpoSolverAgent"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolverAgent</span></code></a> depending on the configuration
parameter <em>context.solver.agent</em> that contains the name of the agent to be used. This name is used to
access the configuration context <em>context.solver.&lt;agent&gt;</em> that contains the details about this agent.</p>
<p>For example, the default configuration refers to <em>local</em> as default solver agent, to solve model using local process
<em>CP Optimizer Interactive</em>.
This means that at least following configuration elements must be set:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">context</span><span class="o">.</span><span class="n">solver</span><span class="o">.</span><span class="n">agent</span> <span class="o">=</span> <span class="s1">&#39;local&#39;</span>
<span class="n">context</span><span class="o">.</span><span class="n">solver</span><span class="o">.</span><span class="n">local</span><span class="o">.</span><span class="n">execfile</span> <span class="o">=</span> <span class="o">&lt;</span><span class="n">Name</span> <span class="ow">or</span> <span class="n">path</span> <span class="n">of</span> <span class="n">the</span> <span class="n">process</span> <span class="s1">&#39;CP Optimizer Interactive&#39;</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>The different methods that can be called on a CpoSolver object are:</p>
<blockquote>
<div><ul class="simple">
<li><a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver.solve" title="docplex.cp.solver.solver.CpoSolver.solve"><code class="xref py py-meth docutils literal notranslate"><span class="pre">solve()</span></code></a> simply solve the model and returns a solve result, if any.
For convenience reason, this method is also directly available on the CpoModel object (<a class="reference internal" href="docplex.cp.model.py.html#docplex.cp.model.CpoModel.solve" title="docplex.cp.model.CpoModel.solve"><code class="xref py py-meth docutils literal notranslate"><span class="pre">docplex.cp.model.CpoModel.solve()</span></code></a>).</li>
<li><a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver.search_next" title="docplex.cp.solver.solver.CpoSolver.search_next"><code class="xref py py-meth docutils literal notranslate"><span class="pre">search_next()</span></code></a> and <a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver.end_search" title="docplex.cp.solver.solver.CpoSolver.end_search"><code class="xref py py-meth docutils literal notranslate"><span class="pre">end_search()</span></code></a> allows to iterate on different solutions of the model.</li>
<li><a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver.refine_conflict" title="docplex.cp.solver.solver.CpoSolver.refine_conflict"><code class="xref py py-meth docutils literal notranslate"><span class="pre">refine_conflict()</span></code></a> calls the conflict refiner that identifies a minimal conflict for the infeasibility of
the model.</li>
<li><a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver.propagate" title="docplex.cp.solver.solver.CpoSolver.propagate"><code class="xref py py-meth docutils literal notranslate"><span class="pre">propagate()</span></code></a> calls the propagation that communicates the domain reduction of a decision variable to
all of the constraints that are stated over this variable.</li>
</ul>
</div></blockquote>
<p>Except <code class="xref py py-meth docutils literal notranslate"><span class="pre">solve()</span></code>, these functions are only available with a local solver with release greater or equal to 12.7.0.0
When a method is not available, an exception <em>CpoNotSupportedException</em> is raised.</p>
<p>If the methods <a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver.search_next" title="docplex.cp.solver.solver.CpoSolver.search_next"><code class="xref py py-meth docutils literal notranslate"><span class="pre">search_next()</span></code></a> and <a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver.end_search" title="docplex.cp.solver.solver.CpoSolver.end_search"><code class="xref py py-meth docutils literal notranslate"><span class="pre">end_search()</span></code></a> are available in the underlying
solver agent, the <a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver" title="docplex.cp.solver.solver.CpoSolver"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolver</span></code></a> object acts as an iterator. All solutions are retrieved using a loop like:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">solver</span> <span class="o">=</span> <span class="n">CpoSolver</span><span class="p">(</span><span class="n">mdl</span><span class="p">)</span>
<span class="k">for</span> <span class="n">sol</span> <span class="ow">in</span> <span class="n">solver</span><span class="p">:</span>
    <span class="n">sol</span><span class="o">.</span><span class="n">write</span><span class="p">()</span>
</pre></div>
</div>
<p>A such solution iteration can be interrupted at any time by calling <a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver.end_search" title="docplex.cp.solver.solver.CpoSolver.end_search"><code class="xref py py-meth docutils literal notranslate"><span class="pre">end_search()</span></code></a> that returns
a fail solution including the last solve status.</p>
<div class="section" id="detailed-description">
<h2>Detailed description<a class="headerlink" href="#detailed-description" title="Permalink to this headline">&para;</a></h2>
<dl class="class">
<dt id="docplex.cp.solver.solver.CpoSolver">
<em class="property">class </em><code class="descclassname">docplex.cp.solver.solver.</code><code class="descname">CpoSolver</code><span class="sig-paren">(</span><em>model</em>, <em>**kwargs</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver" title="Permalink to this definition">&para;</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>This class represents the public API of the object allowing to solve a CPO model.</p>
<p>It create the appropriate <a class="reference internal" href="#docplex.cp.solver.solver.CpoSolverAgent" title="docplex.cp.solver.solver.CpoSolverAgent"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolverAgent</span></code></a> that actually implements solving functions, depending
on the value of the configuration parameter <em>context.solver.agent</em>.</p>
<p><strong>Constructor</strong></p>
<p>All necessary solving parameters are taken from the solving context that is constructed from the following list
of sources, each one overwriting the previous:</p>
<blockquote>
<div><ul class="simple">
<li>the default solving context that is defined in the module <a class="reference internal" href="docplex.cp.config.py.html#module-docplex.cp.config" title="docplex.cp.config"><code class="xref py py-mod docutils literal notranslate"><span class="pre">config</span></code></a></li>
<li>the user-specific customizations of the context that may be defined (see <a class="reference internal" href="docplex.cp.config.py.html#module-docplex.cp.config" title="docplex.cp.config"><code class="xref py py-mod docutils literal notranslate"><span class="pre">config</span></code></a> for details),</li>
<li>the parameters that are set in the model itself,</li>
<li>the optional arguments of this method.</li>
</ul>
</div></blockquote>
<p>If an optional argument other than <cite>context</cite> or <cite>params</cite> is given to this method, it is searched in the
context where its value is replaced by the new one.
If not found, it is then considered as a solver parameter.
In this case, only public parameters are allowed, except if the context attribute <cite>solver.enable_undocumented_params</cite>
is set to True. This can be done directly when creating the solver, as for example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">slvr</span> <span class="o">=</span> <span class="n">CpoSolver</span><span class="p">(</span><span class="n">mdl</span><span class="p">,</span> <span class="n">enable_undocumented_params</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">MyPrivateParam</span><span class="o">=</span><span class="n">MyValue</span><span class="p">)</span>
</pre></div>
</div>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>context</strong> (<em>Optional</em>) &#8211; Complete solving context.
If not given, solving context is the default one that is defined in the module
<a class="reference internal" href="docplex.cp.config.py.html#module-docplex.cp.config" title="docplex.cp.config"><code class="xref py py-mod docutils literal notranslate"><span class="pre">config</span></code></a>.</li>
<li><strong>params</strong> (<em>Optional</em>) &#8211; Solving parameters (object of class <a class="reference internal" href="docplex.cp.parameters.py.html#docplex.cp.parameters.CpoParameters" title="docplex.cp.parameters.CpoParameters"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoParameters</span></code></a>)
that overwrite those in the solving context.</li>
<li><strong>(</strong><strong>param</strong><strong>)</strong> (<em>Optional</em>) &#8211; Any individual solving parameter as defined in class <a class="reference internal" href="docplex.cp.parameters.py.html#docplex.cp.parameters.CpoParameters" title="docplex.cp.parameters.CpoParameters"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoParameters</span></code></a>
(for example <em>TimeLimit</em>, <em>Workers</em>, <em>SearchType</em>, etc).</li>
<li><strong>(</strong><strong>others</strong><strong>)</strong> (<em>Optional</em>) &#8211; Any leaf attribute with the same name in the solving context
(for example <em>agent</em>, <em>trace_log</em>, <em>trace_cpo</em>, etc).</li>
<li><strong>(</strong><strong>listeners</strong><strong>)</strong> (<em>Optional</em>) &#8211; List of solution listeners</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.add_callback">
<code class="descname">add_callback</code><span class="sig-paren">(</span><em>cback</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.add_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.add_callback" title="Permalink to this definition">&para;</a></dt>
<dd><p>Add a CPO solver callback.</p>
<p>A solver callback is an object extending the class <a class="reference internal" href="docplex.cp.solver.cpo_callback.py.html#docplex.cp.solver.cpo_callback.CpoCallback" title="docplex.cp.solver.cpo_callback.CpoCallback"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoCallback</span></code></a>
which provides multiple functions that are called to notify about the different solving steps.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>cback</strong> &#8211; Solver callback</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.add_listener">
<code class="descname">add_listener</code><span class="sig-paren">(</span><em>lstnr</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.add_listener"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.add_listener" title="Permalink to this definition">&para;</a></dt>
<dd><p>Add a solver listener.</p>
<p>A solver listener is an object extending the class <a class="reference internal" href="docplex.cp.solver.solver_listener.py.html#docplex.cp.solver.solver_listener.CpoSolverListener" title="docplex.cp.solver.solver_listener.CpoSolverListener"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolverListener</span></code></a>
which provides multiple functions that are called to notify about the different solving steps.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>lstnr</strong> &#8211; Solver listener</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.end_search">
<code class="descname">end_search</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.end_search"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.end_search" title="Permalink to this definition">&para;</a></dt>
<dd><p>End current search.</p>
<p>This function is available only with local CPO solver with release number greater or equal to 12.7.0.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Last model solution with last solve information,
object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoSolveResult" title="docplex.cp.solution.CpoSolveResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolveResult</span></code></a>.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoNotSupportedException</span></code> &#8211; if method not available in the solver agent.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.explain_failure">
<code class="descname">explain_failure</code><span class="sig-paren">(</span><em>ltags=None</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.explain_failure"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.explain_failure" title="Permalink to this definition">&para;</a></dt>
<dd><p>This method allows to explain solve failures.</p>
<p>If called with no arguments, this method invokes a solve of the model with appropriate parameters
that enable, in the log, the print of a number tag for each solve failure.</p>
<p>If called with a list of failure tag to explain, the solver is invoked again in a way that it explains,
in the log, the reason for the failure of the required failure tags.</p>
<p>This method sets the following solve parameters before calling the solver:</p>
<blockquote>
<div><ul class="simple">
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">LogSearchTags</span></code> = &#8216;On&#8217;</li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">Workers</span></code> = 1</li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">LogPeriod</span></code> = 1</li>
<li><code class="xref py py-attr docutils literal notranslate"><span class="pre">SearchType</span></code> = &#8216;DepthFirst&#8217;</li>
</ul>
</div></blockquote>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>ltags</strong> &#8211; List of tag ids to explain. If empty or None, the solver is just invoked with appropriate
solve parameters to make failure tags displayed in the log.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Solve result, object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoSolveResult" title="docplex.cp.solution.CpoSolveResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolveResult</span></code></a>.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoNotSupportedException</span></code> &#8211; method not available in this solver agent.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.get_cpo_model_string">
<code class="descname">get_cpo_model_string</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.get_cpo_model_string"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.get_cpo_model_string" title="Permalink to this definition">&para;</a></dt>
<dd><p>Get the CPO model as a string, as it is sent to the solver.</p>
<p>Result string is the exact string that is sent to solver, including all variations caused by configuration
or changes made when creating the solver.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">String containing the CPO model in CPO file format</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.get_last_result">
<code class="descname">get_last_result</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.get_last_result"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.get_last_result" title="Permalink to this definition">&para;</a></dt>
<dd><p>Get the last result returned by this solver.</p>
<p>Calling this method can be useful to determine, for example, if the last solution returned
by a sequence of start_search() and search_next(), or by a solution iterator, is optimal.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Solve result, object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoSolveResult" title="docplex.cp.solution.CpoSolveResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolveResult</span></code></a>.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.get_last_solution">
<code class="descname">get_last_solution</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.get_last_solution"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.get_last_solution" title="Permalink to this definition">&para;</a></dt>
<dd><p>Get the last result returned by this solver.</p>
<p>DEPRECATED. Use get_last_result instead.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Solve result, object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoSolveResult" title="docplex.cp.solution.CpoSolveResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolveResult</span></code></a>.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.get_model">
<code class="descname">get_model</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.get_model"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.get_model" title="Permalink to this definition">&para;</a></dt>
<dd><p>Returns the model solved by this solver.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Model solved by this solver</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.get_model_format_version">
<code class="descname">get_model_format_version</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.get_model_format_version"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.get_model_format_version" title="Permalink to this definition">&para;</a></dt>
<dd><p>If defined, returns the format version of the model.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Model format version, None if not defined.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.get_parameters">
<code class="descname">get_parameters</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.get_parameters"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.get_parameters" title="Permalink to this definition">&para;</a></dt>
<dd><p>Get the actual solver parameters, as modified by configuration or arguments.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Solver parameters, object of class <a class="reference internal" href="docplex.cp.parameters.py.html#docplex.cp.parameters.CpoParameters" title="docplex.cp.parameters.CpoParameters"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoParameters</span></code></a>.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.get_solver_version">
<code class="descname">get_solver_version</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.get_solver_version"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.get_solver_version" title="Permalink to this definition">&para;</a></dt>
<dd><p>Returns, if available, the version of the underlying solver.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Solver version, None if not defined.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.propagate">
<code class="descname">propagate</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.propagate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.propagate" title="Permalink to this definition">&para;</a></dt>
<dd><p>This method invokes the propagation on the current model.</p>
<p>Constraint propagation is the process of communicating the domain reduction of a decision variable to
all of the constraints that are stated over this variable.
This process can result in more domain reductions.
These domain reductions, in turn, are communicated to the appropriate constraints.
This process continues until no more variable domains can be reduced or when a domain becomes empty
and a failure occurs.
An empty domain during the initial constraint propagation means that the model has no solution.</p>
<p>The result is a object of class CpoSolveResult, the same than the one returned by solve() method.
However, variable domains may not be completely defined.</p>
<p>This function is available only with local CPO solver with release number greater or equal to 12.7.0.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Propagation result, object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoSolveResult" title="docplex.cp.solution.CpoSolveResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolveResult</span></code></a>.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoNotSupportedException</span></code> &#8211; method not available in configured solver agent.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.refine_conflict">
<code class="descname">refine_conflict</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.refine_conflict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.refine_conflict" title="Permalink to this definition">&para;</a></dt>
<dd><p>This method identifies a minimal conflict for the infeasibility of the current model.</p>
<p>Given an infeasible model, the conflict refiner can identify conflicting constraints and variable domains
within the model to help you identify the causes of the infeasibility.
In this context, a conflict is a subset of the constraints and/or variable domains of the model
which are mutually contradictory.
Since the conflict is minimal, removal of any one of these constraints will remove that
particular cause for infeasibility.
There may be other conflicts in the model; consequently, repair of a given conflict
does not guarantee feasibility of the remaining model.</p>
<p>Conflict refiner is controlled by the following parameters (that can be set at CpoSolver creation):</p>
<blockquote>
<div><ul class="simple">
<li>ConflictRefinerBranchLimit</li>
<li>ConflictRefinerFailLimit</li>
<li>ConflictRefinerIterationLimit</li>
<li>ConflictRefinerOnVariables</li>
<li>ConflictRefinerTimeLimit</li>
</ul>
</div></blockquote>
<p>that are described in module <a class="reference internal" href="docplex.cp.parameters.py.html#module-docplex.cp.parameters" title="docplex.cp.parameters"><code class="xref py py-mod docutils literal notranslate"><span class="pre">docplex.cp.parameters</span></code></a>.</p>
<p>Note that the general <em>TimeLimit</em> parameter is used as a limiter for each conflict refiner iteration, but the
global limitation in time must be set using <em>ConflictRefinerTimeLimit</em> that is infinite by default.</p>
<p>This function is available only with local CPO solver with release number greater or equal to 12.7.0.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">List of constraints that cause the conflict,
object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoRefineConflictResult" title="docplex.cp.solution.CpoRefineConflictResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoRefineConflictResult</span></code></a>.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoNotSupportedException</span></code> &#8211; if method not available in the solver agent.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.remove_callback">
<code class="descname">remove_callback</code><span class="sig-paren">(</span><em>cback</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.remove_callback"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.remove_callback" title="Permalink to this definition">&para;</a></dt>
<dd><p>Remove a CPO solver callback. previously added with <a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver.add_callback" title="docplex.cp.solver.solver.CpoSolver.add_callback"><code class="xref py py-meth docutils literal notranslate"><span class="pre">add_callback()</span></code></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>cback</strong> &#8211; Callback to remove.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.remove_listener">
<code class="descname">remove_listener</code><span class="sig-paren">(</span><em>lstnr</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.remove_listener"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.remove_listener" title="Permalink to this definition">&para;</a></dt>
<dd><p>Remove a solver listener previously added with <a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver.add_listener" title="docplex.cp.solver.solver.CpoSolver.add_listener"><code class="xref py py-meth docutils literal notranslate"><span class="pre">add_listener()</span></code></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>lstnr</strong> &#8211; Listener to remove.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.run_seeds">
<code class="descname">run_seeds</code><span class="sig-paren">(</span><em>nbrun</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.run_seeds"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.run_seeds" title="Permalink to this definition">&para;</a></dt>
<dd><p>This method runs <em>nbrun</em> times the CP optimizer search with different random seeds
and computes statistics from the result of these runs.</p>
<p>Result statistics are displayed on the log output that should be activated.
If the appropriate configuration variable <em>context.solver.add_log_to_solution</em> is set to True (default),
log is also available in the <em>CpoRunResult</em> result object, accessible as a string using the method
<a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoRunResult.get_solver_log" title="docplex.cp.solution.CpoRunResult.get_solver_log"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_solver_log()</span></code></a></p>
<p>Each run of the solver is stopped according to single solve conditions (TimeLimit for example).
Total run time is then expected to take <em>nbruns</em> times the duration of a single run.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>nbrun</strong> &#8211; Number of runs with different seeds.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Run result, object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoRunResult" title="docplex.cp.solution.CpoRunResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoRunResult</span></code></a>.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoNotSupportedException</span></code> &#8211; method not available in configured solver agent.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.search_next">
<code class="descname">search_next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.search_next"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.search_next" title="Permalink to this definition">&para;</a></dt>
<dd><p>Get the next available solution.</p>
<p>This method returns an object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoSolveResult" title="docplex.cp.solution.CpoSolveResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolveResult</span></code></a> whose method
<a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoSolveResult.is_solution" title="docplex.cp.solution.CpoSolveResult.is_solution"><code class="xref py py-meth docutils literal notranslate"><span class="pre">is_solution()</span></code></a> returns True if a new solution is found.
This method returns False if there is no solution, or if the solution is the same than the previous
one but the solve status has moved from Feasible to Optimal.
In this last case, the optimality of the last solution can be checked using the following code:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">optimal</span> <span class="o">=</span> <span class="n">slvr</span><span class="o">.</span><span class="n">get_last_result</span><span class="p">()</span><span class="o">.</span><span class="n">is_solution_optimal</span><span class="p">()</span>
</pre></div>
</div>
<p>This function is available with local CPO solver for release number greater or equal to 12.7.0.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Next solve result, object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoSolveResult" title="docplex.cp.solution.CpoSolveResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolveResult</span></code></a>.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoNotSupportedException</span></code> &#8211; if method not available in the solver agent.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.set_solve_with_search_next">
<code class="descname">set_solve_with_search_next</code><span class="sig-paren">(</span><em>swsn</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.set_solve_with_search_next"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.set_solve_with_search_next" title="Permalink to this definition">&para;</a></dt>
<dd><p>Set the flag indicating to solve with a search_next sequence instead of a single solve.</p>
<p>If this indicator is set, a call to method <a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver.solve" title="docplex.cp.solver.solver.CpoSolver.solve"><code class="xref py py-meth docutils literal notranslate"><span class="pre">solve()</span></code></a> will automatically call method
<a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver.solve_with_search_next" title="docplex.cp.solver.solver.CpoSolver.solve_with_search_next"><code class="xref py py-meth docutils literal notranslate"><span class="pre">solve_with_search_next()</span></code></a> instead,
allowing listeners to be warned about all intermediate solutions.</p>
<p>The same behavior is also obtained if the configuration attribute context.solver.solve_with_search_next
is set to True.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>swsn</strong> &#8211; Solve wist start-next indicator</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.solve">
<code class="descname">solve</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.solve"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.solve" title="Permalink to this definition">&para;</a></dt>
<dd><p>Solve the model</p>
<p>This function solves the model using CP Optimizer&#8217;s built-in strategy.
The built-in strategy is determined by setting the parameter SearchType (see docplex.cp.parameters).
If the model contains an objective, then the optimal solution with respect to the objective will be calculated.
Otherwise, a solution satisfying all problem constraints will be calculated.</p>
<p>The function returns an object of the class CpoSolveResult (see docplex.cp.solution) that contains the solution
if exists, plus different information on the solving process.</p>
<p>If the context parameter <em>solve_with_search_next</em> (or config parameter <em>context.solver.solve_with_search_next</em>)
is set to True, the call to solve() is replaced by loop of search_next() calls which returns the last
solution found.
Difference is that, if a solver listener has been added to the solver, it is warned of all intermediate solutions.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Solve result, object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoSolveResult" title="docplex.cp.solution.CpoSolveResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolveResult</span></code></a>.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoException</span></code> &#8211; (or derived) if error.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolver.solve_with_search_next">
<code class="descname">solve_with_search_next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolver.solve_with_search_next"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolver.solve_with_search_next" title="Permalink to this definition">&para;</a></dt>
<dd><p>Solve the model using a start/next loop instead of standard solve.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Last solve result</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="docplex.cp.solver.solver.CpoSolverAgent">
<em class="property">class </em><code class="descclassname">docplex.cp.solver.solver.</code><code class="descname">CpoSolverAgent</code><span class="sig-paren">(</span><em>solver</em>, <em>context</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolverAgent"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolverAgent" title="Permalink to this definition">&para;</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>This class is an abstract class that must be extended by every solver agent that intend
to be called by <a class="reference internal" href="#docplex.cp.solver.solver.CpoSolver" title="docplex.cp.solver.solver.CpoSolver"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolver</span></code></a> to solve a CPO model.</p>
<p><strong>Constructor</strong></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>solver</strong> &#8211; Parent solver, object of type CpoSolver</li>
<li><strong>context</strong> &#8211; Solver agent context</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><p class="first last">CpoException if agent can not be created properly.</p>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolverAgent.abort_search">
<code class="descname">abort_search</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolverAgent.abort_search"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolverAgent.abort_search" title="Permalink to this definition">&para;</a></dt>
<dd><p>Abort current search.
This method is designed to be called by a different thread than the one currently solving.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoNotSupportedException</span></code> &#8211; method not available in this solver agent.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolverAgent.end">
<code class="descname">end</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolverAgent.end"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolverAgent.end" title="Permalink to this definition">&para;</a></dt>
<dd><p>End solver agent and release all resources.</p>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolverAgent.end_search">
<code class="descname">end_search</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolverAgent.end_search"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolverAgent.end_search" title="Permalink to this definition">&para;</a></dt>
<dd><p>End current search.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Last (fail) solve result with last solve information,
object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoSolveResult" title="docplex.cp.solution.CpoSolveResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolveResult</span></code></a>.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoNotSupportedException</span></code> &#8211; method not available in this solver agent.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolverAgent.propagate">
<code class="descname">propagate</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolverAgent.propagate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolverAgent.propagate" title="Permalink to this definition">&para;</a></dt>
<dd><p>This method invokes the propagation on the current model.</p>
<p>Constraint propagation is the process of communicating the domain reduction of a decision variable to
all of the constraints that are stated over this variable.
This process can result in more domain reductions.
These domain reductions, in turn, are communicated to the appropriate constraints.
This process continues until no more variable domains can be reduced or when a domain becomes empty
and a failure occurs.
An empty domain during the initial constraint propagation means that the model has no solution.</p>
<p>The result is a object of class CpoSolveResult, the same than the one returned by solve() method.
However, in this case, variable domains may not be completely defined.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Propagation result,
object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoSolveResult" title="docplex.cp.solution.CpoSolveResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolveResult</span></code></a>.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoNotSupportedException</span></code> &#8211; method not available in this solver agent.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolverAgent.refine_conflict">
<code class="descname">refine_conflict</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolverAgent.refine_conflict"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolverAgent.refine_conflict" title="Permalink to this definition">&para;</a></dt>
<dd><p>This method identifies a minimal conflict for the infeasibility of the current model.</p>
<p>Given an infeasible model, the conflict refiner can identify conflicting constraints and variable domains
within the model to help you identify the causes of the infeasibility.
In this context, a conflict is a subset of the constraints and/or variable domains of the model
which are mutually contradictory.
Since the conflict is minimal, removal of any one of these constraints will remove that
particular cause for infeasibility.
There may be other conflicts in the model; consequently, repair of a given conflict
does not guarantee feasibility of the remaining model.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Conflict result,
object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoRefineConflictResult" title="docplex.cp.solution.CpoRefineConflictResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoRefineConflictResult</span></code></a>.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoNotSupportedException</span></code> &#8211; method not available in this solver agent.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolverAgent.run_seeds">
<code class="descname">run_seeds</code><span class="sig-paren">(</span><em>nbrun</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolverAgent.run_seeds"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolverAgent.run_seeds" title="Permalink to this definition">&para;</a></dt>
<dd><p>This method runs <em>nbrun</em> times the CP optimizer search with different random seeds
and computes statistics from the result of these runs.</p>
<p>Result statistics are displayed on the log output that should be activated.
If the appropriate configuration variable <em>context.solver.add_log_to_solution</em> is set to True (default),
log is also available in the <em>CpoRunResult</em> result object, accessible as a string using the method
<a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoRunResult.get_solver_log" title="docplex.cp.solution.CpoRunResult.get_solver_log"><code class="xref py py-meth docutils literal notranslate"><span class="pre">get_solver_log()</span></code></a></p>
<p>Each run of the solver is stopped according to single solve conditions (TimeLimit for example).
Total run time is then expected to take <em>nbruns</em> times the duration of a single run.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>nbrun</strong> &#8211; Number of runs with different seeds.</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">Run result, object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoRunResult" title="docplex.cp.solution.CpoRunResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoRunResult</span></code></a>.</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoNotSupportedException</span></code> &#8211; method not available in this solver agent.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolverAgent.search_next">
<code class="descname">search_next</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolverAgent.search_next"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolverAgent.search_next" title="Permalink to this definition">&para;</a></dt>
<dd><p>Search the next available solution.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Next solve result,
object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoSolveResult" title="docplex.cp.solution.CpoSolveResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolveResult</span></code></a>.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoNotSupportedException</span></code> &#8211; method not available in this solver agent.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolverAgent.set_explain_failure_tags">
<code class="descname">set_explain_failure_tags</code><span class="sig-paren">(</span><em>ltags</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolverAgent.set_explain_failure_tags"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolverAgent.set_explain_failure_tags" title="Permalink to this definition">&para;</a></dt>
<dd><p>This method allows to set the list of failure tags to explain in the next solve.</p>
<p>The failure tags are displayed in the log when the parameter <code class="xref py py-attr docutils literal notranslate"><span class="pre">LogSearchTags</span></code>
is set to &#8216;On&#8217;.
All existing failure tags previously set are cleared prior to set the new ones.
Calling this method with an empty list is then equivalent to just clear tags.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>ltags</strong> &#8211; List of tag ids to explain</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoNotSupportedException</span></code> &#8211; method not available in this solver agent.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolverAgent.solve">
<code class="descname">solve</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolverAgent.solve"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolverAgent.solve" title="Permalink to this definition">&para;</a></dt>
<dd><p>Solve the model</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Model solve result, object of class <a class="reference internal" href="docplex.cp.solution.py.html#docplex.cp.solution.CpoSolveResult" title="docplex.cp.solution.CpoSolveResult"><code class="xref py py-class docutils literal notranslate"><span class="pre">CpoSolveResult</span></code></a>.</td>
</tr>
<tr class="field-even field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoNotSupportedException</span></code> &#8211; method not available in this solver agent.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="method">
<dt id="docplex.cp.solver.solver.CpoSolverAgent.start_search">
<code class="descname">start_search</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolverAgent.start_search"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolverAgent.start_search" title="Permalink to this definition">&para;</a></dt>
<dd><p>Start a new search. Solutions are retrieved using method search_next().</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><code class="xref py py-exc docutils literal notranslate"><span class="pre">CpoNotSupportedException</span></code> &#8211; method not available in this solver agent.</td>
</tr>
</tbody>
</table>
</dd></dl>

</dd></dl>

<dl class="exception">
<dt id="docplex.cp.solver.solver.CpoSolverException">
<em class="property">exception </em><code class="descclassname">docplex.cp.solver.solver.</code><code class="descname">CpoSolverException</code><span class="sig-paren">(</span><em>msg</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#CpoSolverException"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.CpoSolverException" title="Permalink to this definition">&para;</a></dt>
<dd><p>Bases: <a class="reference internal" href="docplex.cp.utils.py.html#docplex.cp.utils.CpoException" title="docplex.cp.utils.CpoException"><code class="xref py py-class docutils literal notranslate"><span class="pre">docplex.cp.utils.CpoException</span></code></a></p>
<p>Exceptions raised for problems related to solver.</p>
<p>Create a new exception
:param msg: Error message</p>
</dd></dl>

<dl class="function">
<dt id="docplex.cp.solver.solver.get_solver_version">
<code class="descclassname">docplex.cp.solver.solver.</code><code class="descname">get_solver_version</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#get_solver_version"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.get_solver_version" title="Permalink to this definition">&para;</a></dt>
<dd><p>If the solver agent defined in the configuration enables this function,
this method returns solver version number.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Solver version string, or None if not available.</td>
</tr>
</tbody>
</table>
</dd></dl>

<dl class="function">
<dt id="docplex.cp.solver.solver.get_version_info">
<code class="descclassname">docplex.cp.solver.solver.</code><code class="descname">get_version_info</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/docplex/cp/solver/solver.html#get_version_info"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#docplex.cp.solver.solver.get_version_info" title="Permalink to this definition">&para;</a></dt>
<dd><p>If the solver agent defined in the configuration enables this function,
this method returns solver version information.</p>
<p>This method creates a CP solver using the default configuration parameters.
It then retrieves this information, and close the solver.
The returned value is a dictionary with various information, as in the
following example:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
</pre></div>
</div>
<blockquote>
<div>&#8220;ProxyVersion&#8221; : 5,
&#8220;SourceDate&#8221; : &#8220;Sep 12 2017&#8221;,
&#8220;SolverVersion&#8221; : &#8220;12.8.0.0&#8221;,
&#8220;IntMin&#8221; : -9007199254740991,
&#8220;IntMax&#8221; : 9007199254740991,
&#8220;IntervalMin&#8221; : -4503599627370494,
&#8220;IntervalMax&#8221; : 4503599627370494,</div></blockquote>
<p>}</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Returns:</th><td class="field-body">Solver information dictionary, or empty dictionary if not available.</td>
</tr>
</tbody>
</table>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="docplex.cp.solver.solver_listener.py.html" title="Module docplex.cp.solver.solver_listener"
             >next</a> |</li>
        <li class="right" >
          <a href="docplex.cp.config.py.html" title="Module docplex.cp.config"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">DOcplex.CP: Constraint Programming Modeling for Python V2.25 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="refman.html" ><strong>docplex.cp</strong> reference manual</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2022, IBM.
    </div>
  </body>
</html>