229 lines
14 KiB
HTML
229 lines
14 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="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">
|
|
<span id="sfml">Google OR-Tools 7.5</span>
|
|
</div>
|
|
</div>
|
|
<div id="content" style="width: 100%; overflow: hidden;">
|
|
<div style="margin-left: 15px; margin-top: 5px; float: left; color: #145A32;">
|
|
<h2>C++ Reference</h2>
|
|
<ul>
|
|
<li><a href="../cpp_algorithms/annotated.html">Algorithms</a></li>
|
|
<li><a href="../cpp_sat/annotated.html">CP-SAT</a></li>
|
|
<li><a href="../cpp_graph/annotated.html">Graph</a></li>
|
|
<li><a href="../cpp_routing/annotated.html">Routing</a></li>
|
|
<li><a href="../cpp_linear/annotated.html">Linear solver</a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="content">
|
|
<div align="center">
|
|
<h1 style="color: #145A32;">C++ Reference: CP-SAT</h1>
|
|
</div>
|
|
<!-- Generated by Doxygen 1.8.16 -->
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="nav-path" class="navpath">
|
|
<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> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="#pub-static-methods">Static Public Member Functions</a> |
|
|
<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(&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"> </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"> </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"> </td></tr>
|
|
<tr class="memitem:acc74615391497a1874ffb69d751f80af"><td class="memItemLeft" align="right" valign="top"> </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"> </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"> </td></tr>
|
|
<tr class="memitem:a7e35d44d642ce651a7b5c7264ed6cc9c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classoperations__research_1_1TimeLimit.html">TimeLimit</a> * </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"> </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"> </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<typename Parameters > </td></tr>
|
|
<tr class="memitem:a3b7596f291aadf69b593164aca3505ef"><td class="memTemplItemLeft" align="right" valign="top">static std::unique_ptr< <a class="el" href="classoperations__research_1_1NestedTimeLimit.html">NestedTimeLimit</a> > </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> *time_limit, const Parameters &parameters)</td></tr>
|
|
<tr class="memdesc:a3b7596f291aadf69b593164aca3505ef"><td class="mdescLeft"> </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"> </td></tr>
|
|
</table>
|
|
<h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
|
<a id="af23d2dc1b291081b642a728cf0033987"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#af23d2dc1b291081b642a728cf0033987">◆ </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> * </td>
|
|
<td class="paramname"><em>base_time_limit</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double </td>
|
|
<td class="paramname"><em>limit_in_seconds</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double </td>
|
|
<td class="paramname"><em>deterministic_limit</em> </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>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="acc74615391497a1874ffb69d751f80af"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#acc74615391497a1874ffb69d751f80af">◆ </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>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="a3b7596f291aadf69b593164aca3505ef"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a3b7596f291aadf69b593164aca3505ef">◆ </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<<a class="el" href="classoperations__research_1_1NestedTimeLimit.html">NestedTimeLimit</a>> FromBaseTimeLimitAndParameters </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classoperations__research_1_1TimeLimit.html">TimeLimit</a> * </td>
|
|
<td class="paramname"><em>time_limit</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const Parameters & </td>
|
|
<td class="paramname"><em>parameters</em> </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">◆ </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 file:<ul>
|
|
<li><a class="el" href="time__limit_8h_source.html">time_limit.h</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
<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>
|
|
</div>
|
|
</div>
|
|
<div id="footer-container">
|
|
<div id="footer">
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|