145 lines
18 KiB
HTML
145 lines
18 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"/>-->
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="styleSheet.tmp.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<div id="banner-container">
|
|
<div id="banner">
|
|
<span id="sfml">Google OR-Tools 9.2</span>
|
|
</div>
|
|
</div>
|
|
<div id="content" style="width: 100%; overflow: hidden;">
|
|
<div style="margin-left: 15px; margin-top: 5px; float: left; color: #145A32;">
|
|
<h2>Java Reference</h2>
|
|
<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">
|
|
<div align="center">
|
|
<h1 style="color: #145A32;">Java Reference</h1>
|
|
</div>
|
|
<!-- Generated by Doxygen 1.9.3 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(document).ready(function(){initNavTree('CpSolverSolutionCallback_8java_source.html',''); initResizable(); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<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 id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright 2010-2021 Google LLC</span></div>
|
|
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></div>
|
|
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// you may not use this file except in compliance with the License.</span></div>
|
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// You may obtain a copy of the License at</span></div>
|
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">//</span></div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">//</span></div>
|
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
|
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></div>
|
|
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// See the License for the specific language governing permissions and</span></div>
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">// limitations under the License.</span></div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="keyword">package </span>com.google.ortools.sat;</div>
|
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html"> 39</a></span><span class="keyword">public</span> <span class="keyword">class </span><a class="code hl_class" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html">CpSolverSolutionCallback</a> <span class="keyword">extends</span> <a class="code hl_class" href="classcom_1_1google_1_1ortools_1_1sat_1_1SolutionCallback.html">SolutionCallback</a> {</div>
|
|
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#a223d9fe8c0446517983a4cce6e8611ea"> 41</a></span> <span class="keyword">public</span> <span class="keywordtype">long</span> <a class="code hl_function" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#a223d9fe8c0446517983a4cce6e8611ea">value</a>(<a class="code hl_interface" href="interfacecom_1_1google_1_1ortools_1_1sat_1_1LinearArgument.html">LinearArgument</a> expr) {</div>
|
|
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keyword">final</span> <a class="code hl_interface" href="interfacecom_1_1google_1_1ortools_1_1sat_1_1LinearExpr.html">LinearExpr</a> e = expr.<a class="code hl_function" href="interfacecom_1_1google_1_1ortools_1_1sat_1_1LinearArgument.html#a68a038d4ae2f7cf74dfa8e8fe21c4feb">build</a>();</div>
|
|
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="keywordtype">long</span> result = e.<a class="code hl_function" href="interfacecom_1_1google_1_1ortools_1_1sat_1_1LinearExpr.html#aa7d6a5c7e69f4efdc6a44b85bbe22f1a">getOffset</a>();</div>
|
|
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < e.<a class="code hl_function" href="interfacecom_1_1google_1_1ortools_1_1sat_1_1LinearExpr.html#a59f9cb76db051cd784a42f38220f896d">numElements</a>(); ++i) {</div>
|
|
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> result += <a class="code hl_function" href="classcom_1_1google_1_1ortools_1_1sat_1_1SolutionCallback.html#a3d16eb05922bf42e541c5cc331679ef1">solutionIntegerValue</a>(e.<a class="code hl_function" href="interfacecom_1_1google_1_1ortools_1_1sat_1_1LinearExpr.html#ae9592a449a7c3bdebd04b8ea4f174871">getVariableIndex</a>(i)) * e.<a class="code hl_function" href="interfacecom_1_1google_1_1ortools_1_1sat_1_1LinearExpr.html#a2c77626134edecc47b69efe661ea1904">getCoefficient</a>(i);</div>
|
|
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> }</div>
|
|
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordflow">return</span> result;</div>
|
|
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> }</div>
|
|
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> </div>
|
|
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#af090e0f2ac5bdfda82b62d7541e5fe86"> 51</a></span> <span class="keyword">public</span> Boolean <a class="code hl_function" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#af090e0f2ac5bdfda82b62d7541e5fe86">booleanValue</a>(<a class="code hl_interface" href="interfacecom_1_1google_1_1ortools_1_1sat_1_1Literal.html">Literal</a> literal) {</div>
|
|
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordflow">return</span> <a class="code hl_function" href="classcom_1_1google_1_1ortools_1_1sat_1_1SolutionCallback.html#a50aaa4b1d065156a10cdf6689d6f141f">solutionBooleanValue</a>(literal.<a class="code hl_function" href="interfacecom_1_1google_1_1ortools_1_1sat_1_1Literal.html#a59d053c950ff1e9f8a004d493f34e754">getIndex</a>());</div>
|
|
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> }</div>
|
|
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
|
|
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> @Override</div>
|
|
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#a4cb3ffdfd02cc63f767833ed23e89c81"> 57</a></span> <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#a4cb3ffdfd02cc63f767833ed23e89c81">onSolutionCallback</a>() {}</div>
|
|
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span>}</div>
|
|
<div class="ttc" id="aclasscom_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="aclasscom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback_html_a223d9fe8c0446517983a4cce6e8611ea"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#a223d9fe8c0446517983a4cce6e8611ea">com.google.ortools.sat.CpSolverSolutionCallback.value</a></div><div class="ttdeci">long value(LinearArgument expr)</div><div class="ttdoc">Returns the value of the linear expression 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="aclasscom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback_html_a4cb3ffdfd02cc63f767833ed23e89c81"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#a4cb3ffdfd02cc63f767833ed23e89c81">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#l00057">CpSolverSolutionCallback.java:57</a></div></div>
|
|
<div class="ttc" id="aclasscom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback_html_af090e0f2ac5bdfda82b62d7541e5fe86"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1CpSolverSolutionCallback.html#af090e0f2ac5bdfda82b62d7541e5fe86">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#l00051">CpSolverSolutionCallback.java:51</a></div></div>
|
|
<div class="ttc" id="aclasscom_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="aclasscom_1_1google_1_1ortools_1_1sat_1_1SolutionCallback_html_a3d16eb05922bf42e541c5cc331679ef1"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1SolutionCallback.html#a3d16eb05922bf42e541c5cc331679ef1">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#l00094">SolutionCallback.java:94</a></div></div>
|
|
<div class="ttc" id="aclasscom_1_1google_1_1ortools_1_1sat_1_1SolutionCallback_html_a50aaa4b1d065156a10cdf6689d6f141f"><div class="ttname"><a href="classcom_1_1google_1_1ortools_1_1sat_1_1SolutionCallback.html#a50aaa4b1d065156a10cdf6689d6f141f">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#l00098">SolutionCallback.java:98</a></div></div>
|
|
<div class="ttc" id="ainterfacecom_1_1google_1_1ortools_1_1sat_1_1LinearArgument_html"><div class="ttname"><a href="interfacecom_1_1google_1_1ortools_1_1sat_1_1LinearArgument.html">com.google.ortools.sat.LinearArgument</a></div><div class="ttdoc">A object that can build a LinearExpr object.</div><div class="ttdef"><b>Definition:</b> <a href="LinearArgument_8java_source.html#l00021">LinearArgument.java:21</a></div></div>
|
|
<div class="ttc" id="ainterfacecom_1_1google_1_1ortools_1_1sat_1_1LinearArgument_html_a68a038d4ae2f7cf74dfa8e8fe21c4feb"><div class="ttname"><a href="interfacecom_1_1google_1_1ortools_1_1sat_1_1LinearArgument.html#a68a038d4ae2f7cf74dfa8e8fe21c4feb">com.google.ortools.sat.LinearArgument.build</a></div><div class="ttdeci">LinearExpr build()</div><div class="ttdoc">Builds a linear expression.</div></div>
|
|
<div class="ttc" id="ainterfacecom_1_1google_1_1ortools_1_1sat_1_1LinearExpr_html"><div class="ttname"><a href="interfacecom_1_1google_1_1ortools_1_1sat_1_1LinearExpr.html">com.google.ortools.sat.LinearExpr</a></div><div class="ttdoc">A linear expression (sum (ai * xi) + b).</div><div class="ttdef"><b>Definition:</b> <a href="LinearExpr_8java_source.html#l00019">LinearExpr.java:19</a></div></div>
|
|
<div class="ttc" id="ainterfacecom_1_1google_1_1ortools_1_1sat_1_1LinearExpr_html_a2c77626134edecc47b69efe661ea1904"><div class="ttname"><a href="interfacecom_1_1google_1_1ortools_1_1sat_1_1LinearExpr.html#a2c77626134edecc47b69efe661ea1904">com.google.ortools.sat.LinearExpr.getCoefficient</a></div><div class="ttdeci">long getCoefficient(int index)</div><div class="ttdoc">Returns the ith coefficient.</div></div>
|
|
<div class="ttc" id="ainterfacecom_1_1google_1_1ortools_1_1sat_1_1LinearExpr_html_a59f9cb76db051cd784a42f38220f896d"><div class="ttname"><a href="interfacecom_1_1google_1_1ortools_1_1sat_1_1LinearExpr.html#a59f9cb76db051cd784a42f38220f896d">com.google.ortools.sat.LinearExpr.numElements</a></div><div class="ttdeci">int numElements()</div><div class="ttdoc">Returns the number of terms (excluding the constant one) in this expression.</div></div>
|
|
<div class="ttc" id="ainterfacecom_1_1google_1_1ortools_1_1sat_1_1LinearExpr_html_aa7d6a5c7e69f4efdc6a44b85bbe22f1a"><div class="ttname"><a href="interfacecom_1_1google_1_1ortools_1_1sat_1_1LinearExpr.html#aa7d6a5c7e69f4efdc6a44b85bbe22f1a">com.google.ortools.sat.LinearExpr.getOffset</a></div><div class="ttdeci">long getOffset()</div><div class="ttdoc">Returns the constant part of the expression.</div></div>
|
|
<div class="ttc" id="ainterfacecom_1_1google_1_1ortools_1_1sat_1_1LinearExpr_html_ae9592a449a7c3bdebd04b8ea4f174871"><div class="ttname"><a href="interfacecom_1_1google_1_1ortools_1_1sat_1_1LinearExpr.html#ae9592a449a7c3bdebd04b8ea4f174871">com.google.ortools.sat.LinearExpr.getVariableIndex</a></div><div class="ttdeci">int getVariableIndex(int index)</div><div class="ttdoc">Returns the index of the ith variable.</div></div>
|
|
<div class="ttc" id="ainterfacecom_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="ainterfacecom_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><!-- fragment --></div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
</div>
|
|
</div>
|
|
<div id="footer-container">
|
|
<div id="footer">
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|