<ahref="CpSolver_8java.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">// Copyright 2010-2018 Google LLC</span></div><divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> <spanclass="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></div><divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment">// you may not use this file except in compliance with the License.</span></div><divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment">// You may obtain a copy of the License at</span></div><divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="comment">//</span></div><divclass="line"><aname="l00006"></a><spanclass="lineno"> 6</span> <spanclass="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div><divclass="line"><aname="l00007"></a><spanclass="lineno"> 7</span> <spanclass="comment">//</span></div><divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <spanclass="comment">// Unless required by applicable law or agreed to in writing, software</span></div><divclass="line"><aname="l00009"></a><spanclass="lineno"> 9</span> <spanclass="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></div><divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment">// See the License for the specific language governing permissions and</span></div><divclass="line"><aname="l00012"></a><spanclass="lineno"> 12</span> <spanclass="comment">// limitations under the License.</span></div><divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> </div><divclass="line"><aname="l00014"></a><spanclass="lineno"> 14</span> <spanclass="keyword">package </span>com.google.ortools.sat;</div><divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> </div><divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> <spanclass="keyword">import</span><aclass="code"href="namespacecom.html">com</a>.<aclass="code"href="namespacecom_1_1google.html">google</a>.<aclass="code"href="namespacecom_1_1google_1_1ortools.html">ortools</a>.<aclass="code"href="namespacecom_1_1google_1_1ortools_1_1sat.html">sat</a>.<aclass="code"href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverResponse.html">CpSolverResponse</a>;</div><divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="keyword">import</span><aclass="code"href="namespacecom.html">com</a>.<aclass="code"href="namespacecom_1_1google.html">google</a>.<aclass="code"href="namespacecom_1_1google_1_1ortools.html">ortools</a>.<aclass="code"href="namespacecom_1_1google_1_1ortools_1_1sat.html">sat</a>.<aclass="code"href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverStatus.html">CpSolverStatus</a>;</div><divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> <spanclass="keyword">import</span><aclass="code"href="namespacecom.html">com</a>.<aclass="code"href="namespacecom_1_1google.html">google</a>.<aclass="code"href="namespacecom_1_1google_1_1ortools.html">ortools</a>.<aclass="code"href="namespacecom_1_1google_1_1ortools_1_1sat.html">sat</a>.<aclass="code"href="classcom_1_1google_1_1ortools_1_1sat_1_1SatParameters.html">SatParameters</a>;</div><divclass="line"><aname="l00019"></a><spanclass="lineno"> 19</span> </div><divclass="line"><aname="l00026"></a><spanclass="lineno"><aclass="line"href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html"> 26</a></span> <spanclass="keyword">public</span><spa
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a192d2a91adc9495a4109c494f976ee4d"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a192d2a91adc9495a4109c494f976ee4d">com.google.ortools.sat.CpSolver.objectiveValue</a></div><divclass="ttdeci">double objectiveValue()</div><divclass="ttdoc">Returns the best objective value found during search.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00066">CpSolver.java:66</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a4b61919bdcff3d458bf6807086c48be6"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a4b61919bdcff3d458bf6807086c48be6">com.google.ortools.sat.CpSolver.solveWithSolutionCallback</a></div><divclass="ttdeci">CpSolverStatus solveWithSolutionCallback(CpModel model, CpSolverSolutionCallback cb)</div><divclass="ttdoc">Solves a problem and passes each solution found to the callback.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00039">CpSolver.java:39</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a6eba1a016a99e80decec8801337f35de"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a6eba1a016a99e80decec8801337f35de">com.google.ortools.sat.CpSolver.numBranches</a></div><divclass="ttdeci">long numBranches()</div><divclass="ttdoc">Returns the number of branches explored during search.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00099">CpSolver.java:99</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a2eb2b2447bd59c1f00a9495e63d6b7e3"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a2eb2b2447bd59c1f00a9495e63d6b7e3">com.google.ortools.sat.CpSolver.wallTime</a></div><divclass="ttdeci">double wallTime()</div><divclass="ttdoc">Returns the wall time of the search.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00109">CpSolver.java:109</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_ad6a3705cb3e6ea4939bfb0bb578d4d01"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#ad6a3705cb3e6ea4939bfb0bb578d4d01">com.google.ortools.sat.CpSolver.booleanValue</a></div><divclass="ttdeci">Boolean booleanValue(Literal var)</div><divclass="ttdoc">Returns the Boolean value of a literal in the last solution found.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00084">CpSolver.java:84</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html">com.google.ortools.sat.CpSolver</a></div><divclass="ttdoc">Wrapper around the SAT solver.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00026">CpSolver.java:26</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a94cfac9362c485d50a8930688fe81a3e"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a94cfac9362c485d50a8930688fe81a3e">com.google.ortools.sat.CpSolver.solve</a></div><divclass="ttdeci">CpSolverStatus solve(CpModel model)</div><divclass="ttdoc">Solves the given module, and returns the solve status.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00033">CpSolver.java:33</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a14e6e324b58ee2744bfed85969fd0f10"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a14e6e324b58ee2744bfed85969fd0f10">com.google.ortools.sat.CpSolver.CpSolver</a></div><divclass="ttdeci">CpSolver()</div><divclass="ttdoc">Main construction of the CpSolver class.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00028">CpSolver.java:28</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a1cd8aaaecd8d26aeb54f5503a459b1d9"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a1cd8aaaecd8d26aeb54f5503a459b1d9">com.google.ortools.sat.CpSolver.userTime</a></div><divclass="ttdeci">double userTime()</div><divclass="ttdoc">Returns the user time of the search.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00114">CpSolver.java:114</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a41cc6d27816df71c3a42837dd3d7548c"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a41cc6d27816df71c3a42837dd3d7548c">com.google.ortools.sat.CpSolver.response</a></div><divclass="ttdeci">CpSolverResponse response()</div><divclass="ttdoc">Returns the internal response protobuf that is returned internally by the SAT solver.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00094">CpSolver.java:94</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_ab987e56bbb2a5c4e6f224469986eead3"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#ab987e56bbb2a5c4e6f224469986eead3">com.google.ortools.sat.CpSolver.getParameters</a></div><divclass="ttdeci">SatParameters.Builder getParameters()</div><divclass="ttdoc">Returns the builder of the parameters of the SAT solver for modification.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00119">CpSolver.java:119</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a963b901c7681493ccc15bc769a397be5"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a963b901c7681493ccc15bc769a397be5">com.google.ortools.sat.CpSolver.numConflicts</a></div><divclass="ttdeci">long numConflicts()</div><divclass="ttdoc">Returns the number of conflicts created during search.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00104">CpSolver.java:104</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a3675e4eff4f3825c371d8afaa003d365"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a3675e4eff4f3825c371d8afaa003d365">com.google.ortools.sat.CpSolver.bestObjectiveBound</a></div><divclass="ttdeci">double bestObjectiveBound()</div><divclass="ttdoc">Returns the best lower bound found when minimizing, of the best upper bound found when maximizing.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00074">CpSolver.java:74</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_adb1b01f7ab8973fc2b7a5f279dddc185"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#adb1b01f7ab8973fc2b7a5f279dddc185">com.google.ortools.sat.CpSolver.responseStats</a></div><divclass="ttdeci">String responseStats()</div><divclass="ttdoc">Returns some statistics on the solution found as a string.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00124">CpSolver.java:124</a></div></div>
<divclass="ttc"id="interfacecom_1_1google_1_1ortools_1_1sat_1_1Literal_html"><divclass="ttname"><ahref="interfacecom_1_1google_1_1ortools_1_1sat_1_1Literal.html">com.google.ortools.sat.Literal</a></div><divclass="ttdoc">Interface to describe a boolean variable or its negation.</div><divclass="ttdef"><b>Definition:</b><ahref="Literal_8java_source.html#l00017">Literal.java:17</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a7ffc251fef14d87ad82ac59f98d96cf9"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a7ffc251fef14d87ad82ac59f98d96cf9">com.google.ortools.sat.CpSolver.searchAllSolutions</a></div><divclass="ttdeci">CpSolverStatus searchAllSolutions(CpModel model, CpSolverSolutionCallback cb)</div><divclass="ttdoc">Searches for all solutions of a satisfiability problem.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00057">CpSolver.java:57</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback_html"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html">com.google.ortools.sat.CpSolverSolutionCallback</a></div><divclass="ttdoc">Parent class to create a callback called at each solution.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolverSolutionCallback_8java_source.html#l00039">CpSolverSolutionCallback.java:39</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1IntVar_html_a59d053c950ff1e9f8a004d493f34e754"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1IntVar.html#a59d053c950ff1e9f8a004d493f34e754">com.google.ortools.sat.IntVar.getIndex</a></div><divclass="ttdeci">int getIndex()</div><divclass="ttdoc">Internal, returns the index of the variable in the underlying CpModelProto.</div><divclass="ttdef"><b>Definition:</b><ahref="com_2google_2ortools_2sat_2IntVar_8java_source.html#l00045">com/google/ortools/sat/IntVar.java:45</a></div></div>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a61e7d175c0ca4cd5a12965af3fe358c4"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a61e7d175c0ca4cd5a12965af3fe358c4">com.google.ortools.sat.CpSolver.value</a></div><divclass="ttdeci">long value(IntVar var)</div><divclass="ttdoc">Returns the value of a variable in the last solution found.</div><divclass="ttdef"><b>Definition:</b><ahref="CpSolver_8java_source.html#l00079">CpSolver.java:79</a></div></div>