Files
ortools-clone/docs/java/CpSolver_8java_source.html

93 lines
35 KiB
HTML
Raw Normal View History

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2019-06-13 02:45:44 +02:00
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>OR-Tools</title>
<meta http-equiv="Content-Type" content="text/html;"/>
<meta charset="utf-8"/>
<!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
2019-06-20 23:19:36 +02:00
<link rel="stylesheet" type="text/css" href="ortools.css" title="default" media="screen,print" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
</head>
<body>
<div id="banner-container">
<div id="banner">
2019-09-12 09:22:44 +02:00
<span id="sfml">Google OR-Tools 7.4</span>
</div>
</div>
2019-08-07 18:01:08 -07:00
<div id="content" style="width: 100%; overflow: hidden;">
<div style="margin-left: 15px; margin-top: 5px; float: left; color: #145A32;">
2019-08-12 09:16:03 -07:00
<h2>Java Reference</h2>
2019-08-07 18:01:08 -07:00
<ul>
<li><a href="../java/namespacecom_1_1google_1_1ortools_1_1sat.html">CP-SAT</a></li>
<li><a href="../java/namespacecom_1_1google_1_1ortools_1_1graph.html">Graph</a></li>
<li><a href="../java/namespacecom_1_1google_1_1ortools_1_1algorithms.html">Knapsack solver</a></li>
<li><a href="../java/namespacecom_1_1google_1_1ortools_1_1linearsolver.html">Linear solver</a></li>
<li><a href="../java/namespacecom_1_1google_1_1ortools_1_1constraintsolver.html">Routing</a></li>
<li><a href="../java/namespacecom_1_1google_1_1ortools_1_1util.html">Util</a></li>
</ul>
</div>
<div id="content">
2019-08-07 18:01:08 -07:00
<div align="center">
<h1 style="color: #145A32;">Java Reference</h1>
</div>
2019-09-12 09:22:44 +02:00
<!-- Generated by Doxygen 1.8.15 -->
2019-06-13 02:45:44 +02:00
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
2019-07-15 17:42:24 -07:00
<li class="current"><a href="files.html"><span>Files</span></a></li>
2019-06-13 02:45:44 +02:00
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_a7cc1eeded8f693d0da6c729bc88c45a.html">ortools</a></li><li class="navelem"><a class="el" href="dir_ed7866a075c77e634cb451a432014e49.html">com</a></li><li class="navelem"><a class="el" href="dir_ed93e231cce03906e5c9f1a0e4259679.html">google</a></li><li class="navelem"><a class="el" href="dir_e79f93676144f0f6b8f1180b80d43c5b.html">ortools</a></li><li class="navelem"><a class="el" href="dir_e5ee533e9c8def55a36155ecb53c6410.html">sat</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">CpSolver.java</div> </div>
</div><!--header-->
<div class="contents">
2019-09-12 09:22:44 +02:00
<a href="CpSolver_8java.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">// Copyright 2010-2018 Google LLC</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">// you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">// You may obtain a copy of the License at</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment">// distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment">// See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment">// limitations under the License.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="keyword">package </span>com.google.ortools.sat;</div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;</div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="keyword">import</span> <a class="code" href="namespacecom.html">com</a>.<a class="code" href="namespacecom_1_1google.html">google</a>.<a class="code" href="namespacecom_1_1google_1_1ortools.html">ortools</a>.<a class="code" href="namespacecom_1_1google_1_1ortools_1_1sat.html">sat</a>.<a class="code" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverResponse.html">CpSolverResponse</a>;</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="keyword">import</span> <a class="code" href="namespacecom.html">com</a>.<a class="code" href="namespacecom_1_1google.html">google</a>.<a class="code" href="namespacecom_1_1google_1_1ortools.html">ortools</a>.<a class="code" href="namespacecom_1_1google_1_1ortools_1_1sat.html">sat</a>.<a class="code" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverStatus.html">CpSolverStatus</a>;</div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="keyword">import</span> <a class="code" href="namespacecom.html">com</a>.<a class="code" href="namespacecom_1_1google.html">google</a>.<a class="code" href="namespacecom_1_1google_1_1ortools.html">ortools</a>.<a class="code" href="namespacecom_1_1google_1_1ortools_1_1sat.html">sat</a>.<a class="code" href="classcom_1_1google_1_1ortools_1_1sat_1_1SatParameters.html">SatParameters</a>;</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;</div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html"> 26</a></span>&#160;<span class="keyword">public</span> <spa
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverResponse_html"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverResponse.html">CpSolverResponse</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a192d2a91adc9495a4109c494f976ee4d"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a192d2a91adc9495a4109c494f976ee4d">com.google.ortools.sat.CpSolver.objectiveValue</a></div><div class="ttdeci">double objectiveValue()</div><div class="ttdoc">Returns the best objective value found during search.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00066">CpSolver.java:66</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a4b61919bdcff3d458bf6807086c48be6"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a4b61919bdcff3d458bf6807086c48be6">com.google.ortools.sat.CpSolver.solveWithSolutionCallback</a></div><div class="ttdeci">CpSolverStatus solveWithSolutionCallback(CpModel model, CpSolverSolutionCallback cb)</div><div class="ttdoc">Solves a problem and passes each solution found to the callback.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00039">CpSolver.java:39</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverStatus_html"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverStatus.html">CpSolverStatus</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a6eba1a016a99e80decec8801337f35de"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a6eba1a016a99e80decec8801337f35de">com.google.ortools.sat.CpSolver.numBranches</a></div><div class="ttdeci">long numBranches()</div><div class="ttdoc">Returns the number of branches explored during search.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00099">CpSolver.java:99</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a2eb2b2447bd59c1f00a9495e63d6b7e3"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a2eb2b2447bd59c1f00a9495e63d6b7e3">com.google.ortools.sat.CpSolver.wallTime</a></div><div class="ttdeci">double wallTime()</div><div class="ttdoc">Returns the wall time of the search.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00109">CpSolver.java:109</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_ad6a3705cb3e6ea4939bfb0bb578d4d01"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#ad6a3705cb3e6ea4939bfb0bb578d4d01">com.google.ortools.sat.CpSolver.booleanValue</a></div><div class="ttdeci">Boolean booleanValue(Literal var)</div><div class="ttdoc">Returns the Boolean value of a literal in the last solution found.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00084">CpSolver.java:84</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1SatParameters_html"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1SatParameters.html">com.google.ortools.sat.SatParameters</a></div><div class="ttdef"><b>Definition:</b> <a href="SatParameters_8java_source.html#l00015">SatParameters.java:15</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html">com.google.ortools.sat.CpSolver</a></div><div class="ttdoc">Wrapper around the SAT solver.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00026">CpSolver.java:26</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a94cfac9362c485d50a8930688fe81a3e"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a94cfac9362c485d50a8930688fe81a3e">com.google.ortools.sat.CpSolver.solve</a></div><div class="ttdeci">CpSolverStatus solve(CpModel model)</div><div class="ttdoc">Solves the given module, and returns the solve status.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00033">CpSolver.java:33</a></div></div>
<div class="ttc" id="namespacecom_html"><div class="ttname"><a href="namespacecom.html">com</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a14e6e324b58ee2744bfed85969fd0f10"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a14e6e324b58ee2744bfed85969fd0f10">com.google.ortools.sat.CpSolver.CpSolver</a></div><div class="ttdeci">CpSolver()</div><div class="ttdoc">Main construction of the CpSolver class.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00028">CpSolver.java:28</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a1cd8aaaecd8d26aeb54f5503a459b1d9"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a1cd8aaaecd8d26aeb54f5503a459b1d9">com.google.ortools.sat.CpSolver.userTime</a></div><div class="ttdeci">double userTime()</div><div class="ttdoc">Returns the user time of the search.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00114">CpSolver.java:114</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a41cc6d27816df71c3a42837dd3d7548c"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a41cc6d27816df71c3a42837dd3d7548c">com.google.ortools.sat.CpSolver.response</a></div><div class="ttdeci">CpSolverResponse response()</div><div class="ttdoc">Returns the internal response protobuf that is returned internally by the SAT solver.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00094">CpSolver.java:94</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1SatParameters_1_1Builder_html"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1SatParameters_1_1Builder.html">com.google.ortools.sat.SatParameters.Builder</a></div><div class="ttdef"><b>Definition:</b> <a href="SatParameters_8java_source.html#l07593">SatParameters.java:7593</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_ab987e56bbb2a5c4e6f224469986eead3"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#ab987e56bbb2a5c4e6f224469986eead3">com.google.ortools.sat.CpSolver.getParameters</a></div><div class="ttdeci">SatParameters.Builder getParameters()</div><div class="ttdoc">Returns the builder of the parameters of the SAT solver for modification.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00119">CpSolver.java:119</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a963b901c7681493ccc15bc769a397be5"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a963b901c7681493ccc15bc769a397be5">com.google.ortools.sat.CpSolver.numConflicts</a></div><div class="ttdeci">long numConflicts()</div><div class="ttdoc">Returns the number of conflicts created during search.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00104">CpSolver.java:104</a></div></div>
<div class="ttc" id="interfacecom_1_1google_1_1ortools_1_1sat_1_1Literal_html_a59d053c950ff1e9f8a004d493f34e754"><div class="ttname"><a href="interfacecom_1_1google_1_1ortools_1_1sat_1_1Literal.html#a59d053c950ff1e9f8a004d493f34e754">com.google.ortools.sat.Literal.getIndex</a></div><div class="ttdeci">int getIndex()</div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1SatParameters_html_aeff24d3f13ca1e88dc9427c640b64314"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1SatParameters.html#aeff24d3f13ca1e88dc9427c640b64314">com.google.ortools.sat.SatParameters.newBuilder</a></div><div class="ttdeci">static Builder newBuilder()</div><div class="ttdef"><b>Definition:</b> <a href="SatParameters_8java_source.html#l07566">SatParameters.java:7566</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a3675e4eff4f3825c371d8afaa003d365"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a3675e4eff4f3825c371d8afaa003d365">com.google.ortools.sat.CpSolver.bestObjectiveBound</a></div><div class="ttdeci">double bestObjectiveBound()</div><div class="ttdoc">Returns the best lower bound found when minimizing, of the best upper bound found when maximizing.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00074">CpSolver.java:74</a></div></div>
<div class="ttc" id="namespacecom_1_1google_1_1ortools_html"><div class="ttname"><a href="namespacecom_1_1google_1_1ortools.html">com.google.ortools</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpModel_html_a0553dcb0013a4abf06580f642177d776"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpModel.html#a0553dcb0013a4abf06580f642177d776">com.google.ortools.sat.CpModel.model</a></div><div class="ttdeci">CpModelProto model()</div><div class="ttdef"><b>Definition:</b> <a href="CpModel_8java_source.html#l01026">CpModel.java:1026</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_adb1b01f7ab8973fc2b7a5f279dddc185"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#adb1b01f7ab8973fc2b7a5f279dddc185">com.google.ortools.sat.CpSolver.responseStats</a></div><div class="ttdeci">String responseStats()</div><div class="ttdoc">Returns some statistics on the solution found as a string.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00124">CpSolver.java:124</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1IntVar_html"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1IntVar.html">com.google.ortools.sat.IntVar</a></div><div class="ttdoc">An integer variable.</div><div class="ttdef"><b>Definition:</b> <a href="com_2google_2ortools_2sat_2IntVar_8java_source.html#l00021">com/google/ortools/sat/IntVar.java:21</a></div></div>
<div class="ttc" id="interfacecom_1_1google_1_1ortools_1_1sat_1_1Literal_html"><div class="ttname"><a href="interfacecom_1_1google_1_1ortools_1_1sat_1_1Literal.html">com.google.ortools.sat.Literal</a></div><div class="ttdoc">Interface to describe a boolean variable or its negation.</div><div class="ttdef"><b>Definition:</b> <a href="Literal_8java_source.html#l00017">Literal.java:17</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpModel_html"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpModel.html">com.google.ortools.sat.CpModel</a></div><div class="ttdoc">Main modeling class.</div><div class="ttdef"><b>Definition:</b> <a href="CpModel_8java_source.html#l00040">CpModel.java:40</a></div></div>
<div class="ttc" id="namespacecom_1_1google_html"><div class="ttname"><a href="namespacecom_1_1google.html">com.google</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a7ffc251fef14d87ad82ac59f98d96cf9"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a7ffc251fef14d87ad82ac59f98d96cf9">com.google.ortools.sat.CpSolver.searchAllSolutions</a></div><div class="ttdeci">CpSolverStatus searchAllSolutions(CpModel model, CpSolverSolutionCallback cb)</div><div class="ttdoc">Searches for all solutions of a satisfiability problem.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00057">CpSolver.java:57</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback_html"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html">com.google.ortools.sat.CpSolverSolutionCallback</a></div><div class="ttdoc">Parent class to create a callback called at each solution.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolverSolutionCallback_8java_source.html#l00039">CpSolverSolutionCallback.java:39</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1IntVar_html_a59d053c950ff1e9f8a004d493f34e754"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1IntVar.html#a59d053c950ff1e9f8a004d493f34e754">com.google.ortools.sat.IntVar.getIndex</a></div><div class="ttdeci">int getIndex()</div><div class="ttdoc">Internal, returns the index of the variable in the underlying CpModelProto.</div><div class="ttdef"><b>Definition:</b> <a href="com_2google_2ortools_2sat_2IntVar_8java_source.html#l00045">com/google/ortools/sat/IntVar.java:45</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver_html_a61e7d175c0ca4cd5a12965af3fe358c4"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolver.html#a61e7d175c0ca4cd5a12965af3fe358c4">com.google.ortools.sat.CpSolver.value</a></div><div class="ttdeci">long value(IntVar var)</div><div class="ttdoc">Returns the value of a variable in the last solution found.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolver_8java_source.html#l00079">CpSolver.java:79</a></div></div>
2019-06-13 02:45:44 +02:00
</div><!-- fragment --></div><!-- contents -->
2019-08-07 18:01:08 -07:00
</div>
</div>
<div id="footer-container">
<div id="footer">
</div>
</div>
</body>
2019-06-13 02:45:44 +02:00
</html>