Files
ortools-clone/docs/cpp_sat/time__limit_8h_source.html

91 lines
70 KiB
HTML
Raw Normal View History

2019-09-03 15:42:34 +02:00
<!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">
2019-09-12 09:22:44 +02:00
<span id="sfml">Google OR-Tools 7.4</span>
2019-09-03 15:42:34 +02:00
</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>
2019-09-12 09:22:44 +02:00
<!-- Generated by Doxygen 1.8.15 -->
2019-09-03 15:42:34 +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>
<li class="current"><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="dir_a7cc1eeded8f693d0da6c729bc88c45a.html">ortools</a></li><li class="navelem"><a class="el" href="dir_a3328a0ea67a2aaa160c2783ffbaa5dc.html">util</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">time_limit.h</div> </div>
</div><!--header-->
<div class="contents">
2019-09-12 09:22:44 +02:00
<a href="time__limit_8h.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="preprocessor">#ifndef OR_TOOLS_UTIL_TIME_LIMIT_H_</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="preprocessor">#define OR_TOOLS_UTIL_TIME_LIMIT_H_</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="preprocessor">#include &lt;algorithm&gt;</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#include &lt;atomic&gt;</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#include &lt;cstdlib&gt;</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#include &lt;limits&gt;</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#include &lt;memory&gt;</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &quot;absl/container/flat_hash_map.h&quot;</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;absl/memory/memory.h&quot;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;absl/time/clock.h&quot;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;ortools/base/commandlineflags.h&quot;
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a1837453fa693143e6ec334701557a448"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a1837453fa693143e6ec334701557a448">operations_research::TimeLimit::kSafetyBufferSeconds</a></div><div class="ttdeci">static const double kSafetyBufferSeconds</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00107">time_limit.h:107</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a4cb3517d59bf4642a85294267736af20"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a4cb3517d59bf4642a85294267736af20">operations_research::TimeLimit::ReadInstructionCounter</a></div><div class="ttdeci">double ReadInstructionCounter()</div><div class="ttdoc">Returns the number of instructions executed since the creation of this object.</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00469">time_limit.h:469</a></div></div>
<div class="ttc" id="classoperations__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 class="ttc" id="classoperations__research_1_1TimeLimit_html_ac7e861414a70fc937d18bc7ca743fc98"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#ac7e861414a70fc937d18bc7ca743fc98">operations_research::TimeLimit::GetElapsedDeterministicTime</a></div><div class="ttdeci">double GetElapsedDeterministicTime() const</div><div class="ttdoc">Returns the elapsed deterministic time since the construction of this object.</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00260">time_limit.h:260</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a0be73bea3d751ca2926c1cd616abb31e"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a0be73bea3d751ca2926c1cd616abb31e">operations_research::TimeLimit::GetInstructionsLeft</a></div><div class="ttdeci">double GetInstructionsLeft()</div><div class="ttdoc">Returns the number of instructions left to reach the limit.</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00528">time_limit.h:528</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a810d5f7aaf80cc09cf5a094e20c1aaca"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a810d5f7aaf80cc09cf5a094e20c1aaca">operations_research::TimeLimit::LimitReached</a></div><div class="ttdeci">bool LimitReached()</div><div class="ttdoc">Returns true when the external limit is true, or the deterministic time is over the deterministic lim...</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00479">time_limit.h:479</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a517ffd071860d7efd76134e25f6f03e1"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a517ffd071860d7efd76134e25f6f03e1">operations_research::TimeLimit::Infinite</a></div><div class="ttdeci">static std::unique_ptr&lt; TimeLimit &gt; Infinite()</div><div class="ttdoc">Creates a time limit object that uses infinite time for wall time, deterministic time and instruction...</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00134">time_limit.h:134</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_ae3fe2e2b613455b49c6cc74dd3c7581e"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#ae3fe2e2b613455b49c6cc74dd3c7581e">operations_research::TimeLimit::GetElapsedTime</a></div><div class="ttdeci">double GetElapsedTime() const</div><div class="ttdoc">Returns the time elapsed in seconds since the construction of this object.</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00251">time_limit.h:251</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a96f95e438ca7940b115c838c96c06d87"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a96f95e438ca7940b115c838c96c06d87">operations_research::TimeLimit::FromParameters</a></div><div class="ttdeci">static std::unique_ptr&lt; TimeLimit &gt; FromParameters(const Parameters &amp;parameters)</div><div class="ttdoc">Creates a time limit object initialized from an object that provides methods max_time_in_seconds() an...</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00159">time_limit.h:159</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a4273b83b06bfbf856393db6d0a9b8715"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a4273b83b06bfbf856393db6d0a9b8715">operations_research::TimeLimit::GetTimeLeft</a></div><div class="ttdeci">double GetTimeLeft() const</div><div class="ttdoc">Returns the time left on this limit, or 0 if the limit was reached (it never returns a negative value...</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00517">time_limit.h:517</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a640ae7a07a6de8fe45a5526326f3b028"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a640ae7a07a6de8fe45a5526326f3b028">operations_research::TimeLimit::FromDeterministicTime</a></div><div class="ttdeci">static std::unique_ptr&lt; TimeLimit &gt; FromDeterministicTime(double deterministic_limit)</div><div class="ttdoc">Creates a time limit object that puts limit only on the deterministic time.</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00144">time_limit.h:144</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_ad068edb54c705c548c20e4ba47b4e3a8"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#ad068edb54c705c548c20e4ba47b4e3a8">operations_research::TimeLimit::AdvanceDeterministicTime</a></div><div class="ttdeci">void AdvanceDeterministicTime(double deterministic_duration, const char *counter_name)</div><div class="ttdoc">Advances the deterministic time.</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00240">time_limit.h:240</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a30ac580cb264bf8e92696890f212727e"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a30ac580cb264bf8e92696890f212727e">operations_research::TimeLimit::ExternalBooleanAsLimit</a></div><div class="ttdeci">std::atomic&lt; bool &gt; * ExternalBooleanAsLimit() const</div><div class="ttdoc">Returns the current external Boolean limit.</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00282">time_limit.h:282</a></div></div>
<div class="ttc" id="classoperations__research_1_1NestedTimeLimit_html_a7e35d44d642ce651a7b5c7264ed6cc9c"><div class="ttname"><a href="classoperations__research_1_1NestedTimeLimit.html#a7e35d44d642ce651a7b5c7264ed6cc9c">operations_research::NestedTimeLimit::GetTimeLimit</a></div><div class="ttdeci">TimeLimit * GetTimeLimit()</div><div class="ttdoc">Returns a time limit object that represents the combination of the overall time limit and the part-sp...</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00404">time_limit.h:404</a></div></div>
<div class="ttc" id="time__limit_8h_html_a05c25f55df53c30b07aa2585a8424921"><div class="ttname"><a href="time__limit_8h.html#a05c25f55df53c30b07aa2585a8424921">DECLARE_bool</a></div><div class="ttdeci">DECLARE_bool(time_limit_use_usertime)</div><div class="ttdoc">Enables changing the behavior of the TimeLimit class to use -b usertime instead of walltime.</div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a9d28f062361ac553f8bc1da250b205bd"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a9d28f062361ac553f8bc1da250b205bd">operations_research::TimeLimit::operator=</a></div><div class="ttdeci">TimeLimit &amp; operator=(const TimeLimit &amp;)=delete</div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a43229b9a540c5b4c3751ebb13e73ace8"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a43229b9a540c5b4c3751ebb13e73ace8">operations_research::TimeLimit::SetInstructionLimit</a></div><div class="ttdeci">void SetInstructionLimit(double instruction_limit)</div><div class="ttdoc">Sets the instruction limit.</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00171">time_limit.h:171</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html">operations_research::TimeLimit</a></div><div class="ttdoc">A simple class to enforce both an elapsed time limit and a deterministic time limit in the same threa...</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00105">time_limit.h:105</a></div></div>
<div class="ttc" id="classoperations__research_1_1NestedTimeLimit_html"><div class="ttname"><a href="classoperations__research_1_1NestedTimeLimit.html">operations_research::NestedTimeLimit</a></div><div class="ttdoc">Provides a way to nest time limits for algorithms where a certain part of the computation is bounded ...</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00369">time_limit.h:369</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a312550ebabce586fb77c49e813c610f8"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a312550ebabce586fb77c49e813c610f8">operations_research::TimeLimit::ResetLimitFromParameters</a></div><div class="ttdeci">void ResetLimitFromParameters(const Parameters &amp;parameters)</div><div class="ttdoc">Sets new time limits.</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00452">time_limit.h:452</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_ac62fbbc5383a86a9fe334e3213f6244b"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#ac62fbbc5383a86a9fe334e3213f6244b">operations_research::TimeLimit::kHistorySize</a></div><div class="ttdeci">static const int kHistorySize</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00108">time_limit.h:108</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a0598aaf87dab140f870c8ada2a1f3a39"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a0598aaf87dab140f870c8ada2a1f3a39">operations_research::TimeLimit::TimeLimit</a></div><div class="ttdeci">TimeLimit()</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00126">time_limit.h:126</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a764be64f3029f8b8e23511061d8de355"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a764be64f3029f8b8e23511061d8de355">operations_research::TimeLimit::DebugString</a></div><div class="ttdeci">std::string DebugString() const</div><div class="ttdoc">Returns information about the time limit object in a human-readable form.</div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_af90cfd1fc238433fc303ee28c5914eb9"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#af90cfd1fc238433fc303ee28c5914eb9">operations_research::TimeLimit::AdvanceDeterministicTime</a></div><div class="ttdeci">void AdvanceDeterministicTime(double deterministic_duration)</div><div class="ttdoc">Advances the deterministic time.</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00226">time_limit.h:226</a></div></div>
<div class="ttc" id="classoperations__research_1_1NestedTimeLimit_html_a3b7596f291aadf69b593164aca3505ef"><div class="ttname"><a href="classoperations__research_1_1NestedTimeLimit.html#a3b7596f291aadf69b593164aca3505ef">operations_research::NestedTimeLimit::FromBaseTimeLimitAndParameters</a></div><div class="ttdeci">static std::unique_ptr&lt; NestedTimeLimit &gt; FromBaseTimeLimitAndParameters(TimeLimit *time_limit, const Parameters &amp;parameters)</div><div class="ttdoc">Creates a time limit object initialized from a base time limit and an object that provides methods ma...</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00391">time_limit.h:391</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a362a88bfe50d83c028154a62ef53e780"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a362a88bfe50d83c028154a62ef53e780">operations_research::TimeLimit::GetDeterministicTimeLeft</a></div><div class="ttdeci">double GetDeterministicTimeLeft() const</div><div class="ttdoc">Returns the remaining deterministic time before LimitReached() returns true due to the deterministic ...</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00212">time_limit.h:212</a></div></div>
<div class="ttc" id="namespaceoperations__research_html"><div class="ttname"><a href="namespaceoperations__research.html">operations_research</a></div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00052">cp_model.h:52</a></div></div>
<div class="ttc" id="classoperations__research_1_1NestedTimeLimit_html_acc74615391497a1874ffb69d751f80af"><div class="ttname"><a href="classoperations__research_1_1NestedTimeLimit.html#acc74615391497a1874ffb69d751f80af">operations_research::NestedTimeLimit::~NestedTimeLimit</a></div><div class="ttdeci">~NestedTimeLimit()</div><div class="ttdoc">Updates elapsed deterministic time in the base time limit object.</div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_ad0cdf04d71ac4f14262eb4871041ddbd"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#ad0cdf04d71ac4f14262eb4871041ddbd">operations_research::TimeLimit::MergeWithGlobalTimeLimit</a></div><div class="ttdeci">void MergeWithGlobalTimeLimit(TimeLimit *other)</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00458">time_limit.h:458</a></div></div>
<div class="ttc" id="classoperations__research_1_1TimeLimit_html_a4c1bbdcb2a449b42a788178d2c3d2477"><div class="ttname"><a href="classoperations__research_1_1TimeLimit.html#a4c1bbdcb2a449b42a788178d2c3d2477">operations_research::TimeLimit::ParallelTimeLimit</a></div><div class="ttdeci">friend class ParallelTimeLimit</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00336">time_limit.h:336</a></div></div>
2019-09-03 15:42:34 +02:00
</div><!-- fragment --></div><!-- contents -->
</div>
</div>
<div id="footer-container">
<div id="footer">
</div>
</div>
</body>
</html>