Files
ortools-clone/docs/java/CpSolverSolutionCallback_8java_source.html
2019-06-13 13:08:49 +02:00

63 lines
13 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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"/>-->
<link rel="stylesheet" type="text/css" href="doxygen.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">
<span id="sfml">OR-Tools 7.1@</span>
</div>
</div>
<div id="content">
<!-- Generated by Doxygen 1.8.15 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
</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">CpSolverSolutionCallback.java</div> </div>
</div><!--header-->
<div class="contents">
<a href="CpSolverSolutionCallback_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="l00039"></a><span class="lineno"><a class="line" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html"> 39</a></span>&#160;<span class="keyword">public</span> <span class="keyword">class </span><a class="code" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html">CpSolverSolutionCallback</a> <span class="keyword">extends</span> <a class="code" href="classcom_1_1google_1_1ortools_1_1sat_1_1SolutionCallback.html">SolutionCallback</a> {</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#a2a6ef1a10b6476a826dda52e9c1996b0"> 41</a></span>&#160; <span class="keyword">public</span> <span class="keywordtype">long</span> <a class="code" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#a2a6ef1a10b6476a826dda52e9c1996b0">value</a>(<a class="code" href="classcom_1_1google_1_1ortools_1_1sat_1_1IntVar.html">IntVar</a> var) {</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="keywordtype">int</span> index = var.<a class="code" href="classcom_1_1google_1_1ortools_1_1sat_1_1IntVar.html#a49d108125696400e851418c655de4a6b">getIndex</a>();</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classcom_1_1google_1_1ortools_1_1sat_1_1SolutionCallback.html#a18f4cbeca86ff7d2c8a15874c7bafbea">solutionIntegerValue</a>(index);</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; }</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;</div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#abff660d4b7d7cb5b5d4b5ba20fdd460e"> 47</a></span>&#160; <span class="keyword">public</span> Boolean <a class="code" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#abff660d4b7d7cb5b5d4b5ba20fdd460e">booleanValue</a>(<a class="code" href="interfacecom_1_1google_1_1ortools_1_1sat_1_1Literal.html">Literal</a> literal) {</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classcom_1_1google_1_1ortools_1_1sat_1_1SolutionCallback.html#a658676d83fa802d587c4eece3182a5ec">solutionBooleanValue</a>(literal.<a class="code" href="interfacecom_1_1google_1_1ortools_1_1sat_1_1Literal.html#a8053cba104ece21727a1372f62cace36">getIndex</a>());</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; }</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; @Override</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#a7bf7d9db1f8c2b54808658a8ff6c7254"> 53</a></span>&#160; <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#a7bf7d9db1f8c2b54808658a8ff6c7254">onSolutionCallback</a>() {}</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;}</div><div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1IntVar_html_a49d108125696400e851418c655de4a6b"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1IntVar.html#a49d108125696400e851418c655de4a6b">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_1CpSolverSolutionCallback_html_abff660d4b7d7cb5b5d4b5ba20fdd460e"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#abff660d4b7d7cb5b5d4b5ba20fdd460e">com.google.ortools.sat.CpSolverSolutionCallback.booleanValue</a></div><div class="ttdeci">Boolean booleanValue(Literal literal)</div><div class="ttdoc">Returns the Boolean value of the literal in the current solution.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolverSolutionCallback_8java_source.html#l00047">CpSolverSolutionCallback.java:47</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1SolutionCallback_html_a658676d83fa802d587c4eece3182a5ec"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1SolutionCallback.html#a658676d83fa802d587c4eece3182a5ec">com.google.ortools.sat.SolutionCallback.solutionBooleanValue</a></div><div class="ttdeci">boolean solutionBooleanValue(int index)</div><div class="ttdef"><b>Definition:</b> <a href="SolutionCallback_8java_source.html#l00097">SolutionCallback.java:97</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback_html_a2a6ef1a10b6476a826dda52e9c1996b0"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#a2a6ef1a10b6476a826dda52e9c1996b0">com.google.ortools.sat.CpSolverSolutionCallback.value</a></div><div class="ttdeci">long value(IntVar var)</div><div class="ttdoc">Returns the value of the variable in the current solution.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolverSolutionCallback_8java_source.html#l00041">CpSolverSolutionCallback.java:41</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_1CpSolverSolutionCallback_html_a7bf7d9db1f8c2b54808658a8ff6c7254"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#a7bf7d9db1f8c2b54808658a8ff6c7254">com.google.ortools.sat.CpSolverSolutionCallback.onSolutionCallback</a></div><div class="ttdeci">void onSolutionCallback()</div><div class="ttdoc">Callback method to override.</div><div class="ttdef"><b>Definition:</b> <a href="CpSolverSolutionCallback_8java_source.html#l00053">CpSolverSolutionCallback.java:53</a></div></div>
<div class="ttc" id="interfacecom_1_1google_1_1ortools_1_1sat_1_1Literal_html_a8053cba104ece21727a1372f62cace36"><div class="ttname"><a href="interfacecom_1_1google_1_1ortools_1_1sat_1_1Literal.html#a8053cba104ece21727a1372f62cace36">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_1SolutionCallback_html"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1SolutionCallback.html">com.google.ortools.sat.SolutionCallback</a></div><div class="ttdef"><b>Definition:</b> <a href="SolutionCallback_8java_source.html#l00011">SolutionCallback.java:11</a></div></div>
<div class="ttc" id="classcom_1_1google_1_1ortools_1_1sat_1_1SolutionCallback_html_a18f4cbeca86ff7d2c8a15874c7bafbea"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1SolutionCallback.html#a18f4cbeca86ff7d2c8a15874c7bafbea">com.google.ortools.sat.SolutionCallback.solutionIntegerValue</a></div><div class="ttdeci">long solutionIntegerValue(int index)</div><div class="ttdef"><b>Definition:</b> <a href="SolutionCallback_8java_source.html#l00093">SolutionCallback.java:93</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><!-- fragment --></div><!-- contents -->
</div>
<div id="footer-container">
<div id="footer">
</div>
</div>
</body>
</html>