<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="enumcom_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><span
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_ad7c755da81776f896e5908d4aaace66e"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#ad7c755da81776f896e5908d4aaace66e">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_1IntVar_html_a49d108125696400e851418c655de4a6b"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1IntVar.html#a49d108125696400e851418c655de4a6b">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"><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_a31f1aedfbce9383722beae45bb6c56d9"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a31f1aedfbce9383722beae45bb6c56d9">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_a9b7c07281602ed5206bf5eb7f57bd063"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a9b7c07281602ed5206bf5eb7f57bd063">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_afec653ca08cdff3ec58642c199bbdb55"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#afec653ca08cdff3ec58642c199bbdb55">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>
<divclass="ttc"id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a84e1cdd7d7e3fea0690232d068a7d12c"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a84e1cdd7d7e3fea0690232d068a7d12c">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_a529ec05c15cfb3ecdb30f3331e32fd4b"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a529ec05c15cfb3ecdb30f3331e32fd4b">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_a21e42b4db90799992f39abf1a37da2e0"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a21e42b4db90799992f39abf1a37da2e0">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="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_a7c3c5dc674530a7989b0fdf3bf1af90a"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a7c3c5dc674530a7989b0fdf3bf1af90a">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_abffb3b7a081be116fdb8fa4238d6e51d"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#abffb3b7a081be116fdb8fa4238d6e51d">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="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_ad64fabf13468253f9f080e4eeb1d3655"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#ad64fabf13468253f9f080e4eeb1d3655">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_1CpSolver_html_a3d6654a7d7606fe5f81ab3be7a3f8cfa"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a3d6654a7d7606fe5f81ab3be7a3f8cfa">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_a9e01621422716fb1d27b81543e1bf485"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a9e01621422716fb1d27b81543e1bf485">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_a509d914bed7992922c785ef6686f4fd8"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a509d914bed7992922c785ef6686f4fd8">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_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_1CpSolver_html_a25f9fb12f1b0d0cd22a71763b470b4d9"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a25f9fb12f1b0d0cd22a71763b470b4d9">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_aad90759e27de74339bfb97c3f31bc509"><divclass="ttname"><ahref="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#aad90759e27de74339bfb97c3f31bc509">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>