Files
ortools-clone/docs/cpp/classoperations__research_1_1NestedTimeLimit.html
2020-09-01 16:01:06 +02:00

280 lines
16 KiB
HTML

<!-- HTML header for doxygen 1.8.18-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OR-Tools: NestedTimeLimit</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.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="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="orLogo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">OR-Tools
&#160;<span id="projectnumber">8.0</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(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:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classoperations__research_1_1NestedTimeLimit.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="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classoperations__research_1_1NestedTimeLimit-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">NestedTimeLimit</div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Provides a way to nest time limits for algorithms where a certain part of the computation is bounded not just by the overall time limit, but also by a stricter time limit specific just for this particular part. </p>
<p>This class takes a base time limit object (the overall time limit) and the part-specific time limit, and creates a new time limit object for the part. This new time limit object will expire when either the overall time limit expires or when the part-specific time limit expires.</p>
<p>Example usage: </p><div class="fragment"><div class="line">TimeLimit overall_time_limit(...);</div>
<div class="line"><a class="code" href="classoperations__research_1_1NestedTimeLimit.html#af23d2dc1b291081b642a728cf0033987">NestedTimeLimit</a> subalgorith_time_limit(&amp;overall_time_limit,</div>
<div class="line"> subalgorithm_limit_in_seconds,</div>
<div class="line"> subalgorithm_deterministic_limit);</div>
<div class="line">RunTheSubalgorithm(subalgorithm_time_limit.GetTimeLimit());</div>
</div><!-- fragment --><p>Note that remaining wall time in the base time limit is decreasing "automatically", but the deterministic time needs to be updated manually. This update is done only once, during the destruction of the nested time limit object. To track the deterministic time properly, the user must avoid modifying the base time limit object when a nested time limit exists.</p>
<p>The nested time limits supports the external time limit condition in the sense, that if the overall time limit has an external boolean registered, the nested time limit object will use the same boolean value as an external time limit too. </p>
<p class="definition">Definition at line <a class="el" href="time__limit_8h_source.html#l00425">425</a> of file <a class="el" href="time__limit_8h_source.html">time_limit.h</a>.</p>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:af23d2dc1b291081b642a728cf0033987"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1NestedTimeLimit.html#af23d2dc1b291081b642a728cf0033987">NestedTimeLimit</a> (<a class="el" href="classoperations__research_1_1TimeLimit.html">TimeLimit</a> *base_time_limit, double limit_in_seconds, double deterministic_limit)</td></tr>
<tr class="memdesc:af23d2dc1b291081b642a728cf0033987"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates the nested time limit. <a href="classoperations__research_1_1NestedTimeLimit.html#af23d2dc1b291081b642a728cf0033987">More...</a><br /></td></tr>
<tr class="separator:af23d2dc1b291081b642a728cf0033987"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc74615391497a1874ffb69d751f80af"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1NestedTimeLimit.html#acc74615391497a1874ffb69d751f80af">~NestedTimeLimit</a> ()</td></tr>
<tr class="memdesc:acc74615391497a1874ffb69d751f80af"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates elapsed deterministic time in the base time limit object. <a href="classoperations__research_1_1NestedTimeLimit.html#acc74615391497a1874ffb69d751f80af">More...</a><br /></td></tr>
<tr class="separator:acc74615391497a1874ffb69d751f80af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e35d44d642ce651a7b5c7264ed6cc9c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classoperations__research_1_1TimeLimit.html">TimeLimit</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1NestedTimeLimit.html#a7e35d44d642ce651a7b5c7264ed6cc9c">GetTimeLimit</a> ()</td></tr>
<tr class="memdesc:a7e35d44d642ce651a7b5c7264ed6cc9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a time limit object that represents the combination of the overall time limit and the part-specific time limit. <a href="classoperations__research_1_1NestedTimeLimit.html#a7e35d44d642ce651a7b5c7264ed6cc9c">More...</a><br /></td></tr>
<tr class="separator:a7e35d44d642ce651a7b5c7264ed6cc9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a3b7596f291aadf69b593164aca3505ef"><td class="memTemplParams" colspan="2">template&lt;typename Parameters &gt; </td></tr>
<tr class="memitem:a3b7596f291aadf69b593164aca3505ef"><td class="memTemplItemLeft" align="right" valign="top">static std::unique_ptr&lt; <a class="el" href="classoperations__research_1_1NestedTimeLimit.html">NestedTimeLimit</a> &gt;&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1NestedTimeLimit.html#a3b7596f291aadf69b593164aca3505ef">FromBaseTimeLimitAndParameters</a> (<a class="el" href="classoperations__research_1_1TimeLimit.html">TimeLimit</a> *<a class="el" href="cp__model__solver_8cc.html#ac3cf9db02b23ea1455b5ae6955d03e47">time_limit</a>, const Parameters &amp;<a class="el" href="cp__model__fz__solver_8cc.html#a10a1eab179b472c030bdc2a2efef7219">parameters</a>)</td></tr>
<tr class="memdesc:a3b7596f291aadf69b593164aca3505ef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a time limit object initialized from a base time limit and an object that provides methods max_time_in_seconds() and max_deterministic_time(). <a href="classoperations__research_1_1NestedTimeLimit.html#a3b7596f291aadf69b593164aca3505ef">More...</a><br /></td></tr>
<tr class="separator:a3b7596f291aadf69b593164aca3505ef"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="af23d2dc1b291081b642a728cf0033987"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af23d2dc1b291081b642a728cf0033987">&#9670;&nbsp;</a></span>NestedTimeLimit()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classoperations__research_1_1NestedTimeLimit.html">NestedTimeLimit</a> </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classoperations__research_1_1TimeLimit.html">TimeLimit</a> *&#160;</td>
<td class="paramname"><em>base_time_limit</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>limit_in_seconds</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double&#160;</td>
<td class="paramname"><em>deterministic_limit</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates the nested time limit. </p>
<p>Note that 'base_time_limit' must remain valid for the whole lifetime of the nested time limit object. </p>
<p class="definition">Definition at line <a class="el" href="time__limit_8cc_source.html#l00047">47</a> of file <a class="el" href="time__limit_8cc_source.html">time_limit.cc</a>.</p>
</div>
</div>
<a id="acc74615391497a1874ffb69d751f80af"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acc74615391497a1874ffb69d751f80af">&#9670;&nbsp;</a></span>~NestedTimeLimit()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">~<a class="el" href="classoperations__research_1_1NestedTimeLimit.html">NestedTimeLimit</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Updates elapsed deterministic time in the base time limit object. </p>
<p class="definition">Definition at line <a class="el" href="time__limit_8cc_source.html#l00060">60</a> of file <a class="el" href="time__limit_8cc_source.html">time_limit.cc</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a3b7596f291aadf69b593164aca3505ef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3b7596f291aadf69b593164aca3505ef">&#9670;&nbsp;</a></span>FromBaseTimeLimitAndParameters()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static std::unique_ptr&lt;<a class="el" href="classoperations__research_1_1NestedTimeLimit.html">NestedTimeLimit</a>&gt; FromBaseTimeLimitAndParameters </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classoperations__research_1_1TimeLimit.html">TimeLimit</a> *&#160;</td>
<td class="paramname"><em>time_limit</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const Parameters &amp;&#160;</td>
<td class="paramname"><em>parameters</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a time limit object initialized from a base time limit and an object that provides methods max_time_in_seconds() and max_deterministic_time(). </p>
<p>This method is designed specifically to work with solver parameter protos, e.g. BopParameters, MipParameters and SatParameters. </p>
<p class="definition">Definition at line <a class="el" href="time__limit_8h_source.html#l00447">447</a> of file <a class="el" href="time__limit_8h_source.html">time_limit.h</a>.</p>
</div>
</div>
<a id="a7e35d44d642ce651a7b5c7264ed6cc9c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7e35d44d642ce651a7b5c7264ed6cc9c">&#9670;&nbsp;</a></span>GetTimeLimit()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classoperations__research_1_1TimeLimit.html">TimeLimit</a>* GetTimeLimit </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns a time limit object that represents the combination of the overall time limit and the part-specific time limit. </p>
<p>The returned time limit object is owned by the nested time limit object that returns it, and it will remain valid until the nested time limit object is destroyed. </p>
<p class="definition">Definition at line <a class="el" href="time__limit_8h_source.html#l00460">460</a> of file <a class="el" href="time__limit_8h_source.html">time_limit.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="time__limit_8h_source.html">time_limit.h</a></li>
<li><a class="el" href="time__limit_8cc_source.html">time_limit.cc</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aclassoperations__research_1_1NestedTimeLimit_html_af23d2dc1b291081b642a728cf0033987"><div class="ttname"><a href="classoperations__research_1_1NestedTimeLimit.html#af23d2dc1b291081b642a728cf0033987">operations_research::NestedTimeLimit::NestedTimeLimit</a></div><div class="ttdeci">NestedTimeLimit(TimeLimit *base_time_limit, double limit_in_seconds, double deterministic_limit)</div><div class="ttdoc">Creates the nested time limit.</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8cc_source.html#l00047">time_limit.cc:47</a></div></div>
<!-- HTML footer for doxygen 1.8.18-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespaceoperations__research.html">operations_research</a></li><li class="navelem"><a class="el" href="classoperations__research_1_1NestedTimeLimit.html">NestedTimeLimit</a></li>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.18 </li>
</ul>
</div>
</body>
</html>