<ahref="demon__profiler_8cc.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">// Copyright 2010-2021 Google LLC</span></div><divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> <spanclass="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></div><divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment">// you may not use this file except in compliance with the License.</span></div><divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment">// You may obtain a copy of the License at</span></div><divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="comment">//</span></div><divclass="line"><aname="l00006"></a><spanclass="lineno"> 6</span> <spanclass="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div><divclass="line"><aname="l00007"></a><spanclass="lineno"> 7</span> <spanclass="comment">//</span></div><divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <spanclass="comment">// Unless required by applicable law or agreed to in writing, software</span></div><divclass="line"><aname="l00009"></a><spanclass="lineno"> 9</span> <spanclass="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></div><divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment">// See the License for the specific language governing permissions and</span></div><divclass="line"><aname="l00012"></a><spanclass="lineno"> 12</span> <spanclass="comment">// limitations under the License.</span></div><divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> </div><divclass="line"><aname="l00014"></a><spanclass="lineno"> 14</span> <spanclass="preprocessor">#include <algorithm></span></div><divclass="line"><aname="l00015"></a><spanclass="lineno"> 15</span> <spanclass="preprocessor">#include <cmath></span></div><divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> <spanclass="preprocessor">#include <cstddef></span></div><divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="preprocessor">#include <cstdint></span></div><divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> <spanclass="preprocessor">#include <string></span></div><divclass="line"><aname="l00019"></a><spanclass="lineno"> 19</span> <spanclass="preprocessor">#include <utility></span></div><divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> <spanclass="preprocessor">#include <vector></span></div><divclass="line"><aname="l00021"></a><spanclass="lineno"> 21</span> </div><divclass="line"><aname="l00022"></a><spanclass="lineno"> 22</span> <spanclass="preprocessor">#include "absl/container/flat_hash_map.h"</span></div><divclass="line"><aname="l00023"></a><spanclass="lineno"> 23</span> <spanclass="preprocessor">#include "absl/status/status.h"</span></div><divclass="line"><aname="l00024"></a><spanclass="lineno"> 24</span> <spanclass="preprocessor">#include "absl/strings/str_format.h"</span></div><divclass="line"><aname="l00025"></a><spanclass="lineno"> 25</span> <spanclass="preprocessor">#include "absl/time/clock.h"</span></div><divclass="line"><aname="l00026"></a><spanclass="lineno"> 26</span> <spanclass="preprocessor">#include "absl/time/time.h"</span></div><divclass="line"><aname="l00027"></a><spanclass="lineno"> 27</span> <sp
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_af18fc987873b89ac3070f5a5fabc2af5"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#af18fc987873b89ac3070f5a5fabc2af5">operations_research::DemonProfiler::RankNotFirst</a></div><divclass="ttdeci">void RankNotFirst(SequenceVar *const var, int index) override</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00238">demon_profiler.cc:238</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_ac2abdd04ae12161735a0d737f8b81eaf"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#ac2abdd04ae12161735a0d737f8b81eaf">operations_research::DemonProfiler::RankNotLast</a></div><divclass="ttdeci">void RankNotLast(SequenceVar *const var, int index) override</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00240">demon_profiler.cc:240</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_runs_html_a9b306a60f7a74576625a7ba0c3fffde0"><divclass="ttname"><ahref="classoperations__research_1_1_demon_runs.html#a9b306a60f7a74576625a7ba0c3fffde0">operations_research::DemonRuns::demon_id</a></div><divclass="ttdeci">const std::string & demon_id() const</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8pb_8h_source.html#l00515">demon_profiler.pb.h:515</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_a34cc59e89ecf25a04aac5b4fb9129ff9"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#a34cc59e89ecf25a04aac5b4fb9129ff9">operations_research::DemonProfiler::SetEndMax</a></div><divclass="ttdeci">void SetEndMax(IntervalVar *const var, int64_t new_max) override</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00229">demon_profiler.cc:229</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_html"><divclass="ttname"><ahref="classoperations__research_1_1_demon.html">operations_research::Demon</a></div><divclass="ttdoc">A Demon is the base element of a propagation queue.</div><divclass="ttdef"><b>Definition:</b><ahref="constraint__solver_8h_source.html#l03303">constraint_solver.h:3303</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_constraint_html"><divclass="ttname"><ahref="classoperations__research_1_1_constraint.html">operations_research::Constraint</a></div><divclass="ttdoc">A constraint is the main modeling object.</div><divclass="ttdef"><b>Definition:</b><ahref="constraint__solver_8h_source.html#l03587">constraint_solver.h:3587</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_a2536fa74dc1f0964122b676b944dcab0"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#a2536fa74dc1f0964122b676b944dcab0">operations_research::DemonProfiler::RestartSearch</a></div><divclass="ttdeci">void RestartSearch() override</div><divclass="ttdoc">Restart the search.</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00199">demon_profiler.cc:199</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_constraint_runs_html_a665b951a203e83ab611df47483430d46"><divclass="ttname"><ahref="classoperations__research_1_1_constraint_runs.html#a665b951a203e83ab611df47483430d46">operations_research::ConstraintRuns::demons</a></div><divclass="ttdeci">const ::operations_research::DemonRuns & demons(int index) const</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8pb_8h_source.html#l00857">demon_profiler.pb.h:857</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_a91e8a37b6d9e7c8825a1669c695deaf9"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#a91e8a37b6d9e7c8825a1669c695deaf9">operations_research::DemonProfiler::SetDurationMin</a></div><divclass="ttdeci">void SetDurationMin(IntervalVar *const var, int64_t new_min) override</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00232">demon_profiler.cc:232</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_a2230170d3a7afe1e79bb46553d29926b"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#a2230170d3a7afe1e79bb46553d29926b">operations_research::DemonProfiler::SetMin</a></div><divclass="ttdeci">void SetMin(IntVar *const var, int64_t new_min) override</div><divclass="ttdoc">IntVar modifiers.</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00213">demon_profiler.cc:213</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_solver_html_ae5dafec4a3984f3a489f81ad5af0e4c1"><divclass="ttname"><ahref="classoperations__research_1_1_solver.html#ae5dafec4a3984f3a489f81ad5af0e4c1">operations_research::Solver::InstrumentsDemons</a></div><divclass="ttdeci">bool InstrumentsDemons() const</div><divclass="ttdoc">Returns whether we are instrumenting demons.</div><divclass="ttdef"><b>Definition:</b><ahref="constraint__solver_8cc_source.html#l00172">constraint_solver.cc:172</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_html_ae47aecad15d101db52a7d6bd114565d3"><divclass="ttname"><ahref="classoperations__research_1_1_demon.html#ae47aecad15d101db52a7d6bd114565d3">operations_research::Demon::priority</a></div><divclass="ttdeci">virtual Solver::DemonPriority priority() const</div><divclass="ttdoc">This method returns the priority of the demon.</div><divclass="ttdef"><b>Definition:</b><ahref="constraint__solver_8cc_source.html#l00196">constraint_solver.cc:196</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_interval_var_html"><divclass="ttname"><ahref="classoperations__research_1_1_interval_var.html">operations_research::IntervalVar</a></div><divclass="ttdoc">Interval variables are often used in scheduling.</div><divclass="ttdef"><b>Definition:</b><ahref="constraint__solver_8h_source.html#l04398">constraint_solver.h:4398</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_solver_html_adb5dd2b903aed4484d190730863f26c2"><divclass="ttname"><ahref="classoperations__research_1_1_solver.html#adb5dd2b903aed4484d190730863f26c2">operations_research::Solver::ExportProfilingOverview</a></div><divclass="ttdeci">void ExportProfilingOverview(const std::string &filename)</div><divclass="ttdoc">Exports the profiling information in a human readable overview.</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00433">demon_profiler.cc:433</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_solver_html_a2f2bea2202c96738b11b050e71a28e63adf2a840a07b929c95099a490d2e4d013"><divclass="ttname"><ahref="classoperations__research_1_1_solver.html#a2f2bea2202c96738b11b050e71a28e63adf2a840a07b929c95099a490d2e4d013">operations_research::Solver::IN_SEARCH</a></div><divclass="ttdoc">Executing the search code.</div><divclass="ttdef"><b>Definition:</b><ahref="constraint__solver_8h_source.html#l00720">constraint_solver.h:720</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_a7792a3aafa67476d71edcca0e3c6b756"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#a7792a3aafa67476d71edcca0e3c6b756">operations_research::DemonProfiler::RankSequence</a></div><divclass="ttdeci">void RankSequence(SequenceVar *const var, const std::vector< int >&rank_first, const std::vector< int >&rank_last, const std::vector< int >&unperformed) override</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00241">demon_profiler.cc:241</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_solver_html_a293233c46e5eaa308f65c7c2350553f7a29446873dacaf3696a89dfb1e617a5f5"><divclass="ttname"><ahref="classoperations__research_1_1_solver.html#a293233c46e5eaa308f65c7c2350553f7a29446873dacaf3696a89dfb1e617a5f5">operations_research::Solver::VAR_PRIORITY</a></div><divclass="ttdoc">VAR_PRIORITY is between DELAYED_PRIORITY and NORMAL_PRIORITY.</div><divclass="ttdef"><b>Definition:</b><ahref="constraint__solver_8h_source.html#l00609">constraint_solver.h:609</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_adf01a07b52ce24e0d194a15f08f124f4"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#adf01a07b52ce24e0d194a15f08f124f4">operations_research::DemonProfiler::RemoveValue</a></div><divclass="ttdeci">void RemoveValue(IntVar *const var, int64_t value) override</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00216">demon_profiler.cc:216</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_a45c3310763a94de75e15604f49b2dc21"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#a45c3310763a94de75e15604f49b2dc21">operations_research::DemonProfiler::SetStartMin</a></div><divclass="ttdeci">void SetStartMin(IntervalVar *const var, int64_t new_min) override</div><divclass="ttdoc">IntervalVar modifiers.</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00224">demon_profiler.cc:224</a></div></div>
<divclass="ttc"id="default__search_8cc_html_a29f7ae4ecca887a7b2778dfdce83700d"><divclass="ttname"><ahref="default__search_8cc.html#a29f7ae4ecca887a7b2778dfdce83700d">runs</a></div><divclass="ttdeci">const int runs</div><divclass="ttdef"><b>Definition:</b><ahref="default__search_8cc_source.html#l00817">default_search.cc:817</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_a6cea9979ee2ea1d9319bd538f554528d"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#a6cea9979ee2ea1d9319bd538f554528d">operations_research::DemonProfiler::SetStartRange</a></div><divclass="ttdeci">void SetStartRange(IntervalVar *const var, int64_t new_min, int64_t new_max) override</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00226">demon_profiler.cc:226</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_solver_html_a3dc3be2f47a73287c5edd7cf80beaa89"><divclass="ttname"><ahref="classoperations__research_1_1_solver.html#a3dc3be2f47a73287c5edd7cf80beaa89">operations_research::Solver::IsProfilingEnabled</a></div><divclass="ttdeci">bool IsProfilingEnabled() const</div><divclass="ttdoc">Returns whether we are profiling the solver.</div><divclass="ttdef"><b>Definition:</b><ahref="constraint__solver_8cc_source.html#l00176">constraint_solver.cc:176</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_solver_html_a7a202227fee0ce0a3cbf8218379a410d"><divclass="ttname"><ahref="classoperations__research_1_1_solver.html#a7a202227fee0ce0a3cbf8218379a410d">operations_research::Solver::RegisterDemon</a></div><divclass="ttdeci">Demon * RegisterDemon(Demon *const demon)</div><divclass="ttdoc">Adds a new demon and wraps it inside a DemonProfiler if necessary.</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00453">demon_profiler.cc:453</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_a4daddad6c4bbde6560c1a520465ef185"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#a4daddad6c4bbde6560c1a520465ef185">operations_research::DemonProfiler::SetPerformed</a></div><divclass="ttdeci">void SetPerformed(IntervalVar *const var, bool value) override</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00236">demon_profiler.cc:236</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_a1e1eb7790cbda1a50bd427ee6106d83b"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#a1e1eb7790cbda1a50bd427ee6106d83b">operations_research::DemonProfiler::SetStartMax</a></div><divclass="ttdeci">void SetStartMax(IntervalVar *const var, int64_t new_max) override</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00225">demon_profiler.cc:225</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_search_monitor_html_af01d6e340e0ee803b6587a736745a78c"><divclass="ttname"><ahref="classoperations__research_1_1_search_monitor.html#af01d6e340e0ee803b6587a736745a78c">operations_research::SearchMonitor::Install</a></div><divclass="ttdeci">virtual void Install()</div><divclass="ttdoc">Registers itself on the solver such that it gets notified of the search and propagation events.</div><divclass="ttdef"><b>Definition:</b><ahref="constraint__solver_8cc_source.html#l02897">constraint_solver.cc:2897</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_int_var_html"><divclass="ttname"><ahref="classoperations__research_1_1_int_var.html">operations_research::IntVar</a></div><divclass="ttdoc">The class IntVar is a subset of IntExpr.</div><divclass="ttdef"><b>Definition:</b><ahref="constraint__solver_8h_source.html#l04001">constraint_solver.h:4001</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_int_expr_html"><divclass="ttname"><ahref="classoperations__research_1_1_int_expr.html">operations_research::IntExpr</a></div><divclass="ttdoc">The class IntExpr is the base of all integer expressions in constraint programming.</div><divclass="ttdef"><b>Definition:</b><ahref="constraint__solver_8h_source.html#l03839">constraint_solver.h:3839</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_a127c860aa3b5024666f308c553edf2a5"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#a127c860aa3b5024666f308c553edf2a5">operations_research::DemonProfiler::Install</a></div><divclass="ttdeci">void Install() override</div><divclass="ttdoc">Install itself on the solver.</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00419">demon_profiler.cc:419</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_aeb1775549ade1d322b7aee5490ed327a"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#aeb1775549ade1d322b7aee5490ed327a">operations_research::DemonProfiler::SetEndMin</a></div><divclass="ttdeci">void SetEndMin(IntervalVar *const var, int64_t new_min) override</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00228">demon_profiler.cc:228</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_aea88ded8342379f2dd7cf420f5d5b217"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#aea88ded8342379f2dd7cf420f5d5b217">operations_research::DemonProfiler::RankFirst</a></div><divclass="ttdeci">void RankFirst(SequenceVar *const var, int index) override</div><divclass="ttdoc">SequenceVar modifiers.</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00237">demon_profiler.cc:237</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_sequence_var_html"><divclass="ttname"><ahref="classoperations__research_1_1_sequence_var.html">operations_research::SequenceVar</a></div><divclass="ttdoc">A sequence variable is a variable whose domain is a set of possible orderings of the interval variabl...</div><divclass="ttdef"><b>Definition:</b><ahref="constraint__solver_8h_source.html#l04552">constraint_solver.h:4552</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_ab5291cccd49074641e68cfc668f43392"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#ab5291cccd49074641e68cfc668f43392">operations_research::DemonProfiler::RankLast</a></div><divclass="ttdeci">void RankLast(SequenceVar *const var, int index) override</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00239">demon_profiler.cc:239</a></div></div>
<divclass="ttc"id="namespaceoperations__research_html"><divclass="ttname"><ahref="namespaceoperations__research.html">operations_research</a></div><divclass="ttdoc">Collection of objects used to extend the Constraint Solver library.</div><divclass="ttdef"><b>Definition:</b><ahref="dense__doubly__linked__list_8h_source.html#l00021">dense_doubly_linked_list.h:21</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_solver_html_a9c44ecfda194a78c5167e7c9d3579b01"><divclass="ttname"><ahref="classoperations__research_1_1_solver.html#a9c44ecfda194a78c5167e7c9d3579b01">operations_research::Solver::model_name</a></div><divclass="ttdeci">std::string model_name() const</div><divclass="ttdoc">Returns the name of the model.</div><divclass="ttdef"><b>Definition:</b><ahref="constraint__solver_8cc_source.html#l01400">constraint_solver.cc:1400</a></div></div>
<divclass="ttc"id="classoperations__research_1_1_demon_profiler_html_a00e1c5e76ceb9b425ddea62748673d9b"><divclass="ttname"><ahref="classoperations__research_1_1_demon_profiler.html#a00e1c5e76ceb9b425ddea62748673d9b">operations_research::DemonProfiler::BeginFail</a></div><divclass="ttdeci">void BeginFail() override</div><divclass="ttdoc">Just when the failure occurs.</div><divclass="ttdef"><b>Definition:</b><ahref="demon__profiler_8cc_source.html#l00178">demon_profiler.cc:178</a></div></div>