Files
ortools-clone/docs/cpp_sat/cp__model_8h_source.html
Laurent Perron 6230c8e7a4 polish cpp doc
2019-07-12 13:25:23 -07:00

211 lines
206 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">OR-Tools 7.2</span>
</div>
</div>
<link rel="icon" href="https://developers.google.com/optimization/images/orLogo.png">
<div id="content">
<!-- Generated by Doxygen 1.8.15 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&#160;List</span></a></li>
<li><a href="globals.html"><span>File&#160;Members</span></a></li>
</ul>
</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('cp__model_8h_source.html','');});
/* @license-end */
</script>
<div id="doc-content">
<div class="header">
<div class="headertitle">
<div class="title">cp_model.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="cp__model_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="comment">// This file implements a wrapper around the CP-SAT model proto.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment">// Here is a minimal example that shows how to create a model, solve it, and</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment">// print out the solution.</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment">// CpModelBuilder cp_model;</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="comment">// Domain all_animals(0, 20);</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="comment">// IntVar rabbits = cp_model.NewIntVar(all_animals).WithName(&quot;rabbits&quot;);</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="comment">// IntVar pheasants = cp_model.NewIntVar(all_animals).WithName(&quot;pheasants&quot;);</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="comment">// cp_model.AddEquality(LinearExpr::Sum({rabbits, pheasants}), 20);</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="comment">// cp_model.AddEquality(LinearExpr::ScalProd({rabbits, pheasants}, {4, 2}), 56);</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="comment">// const CpSolverResponse response = Solve(cp_model);</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="comment">// if (response.status() == CpSolverStatus::FEASIBLE) {</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="comment">// LOG(INFO) &lt;&lt; SolutionIntegerValue(response, rabbits)</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="comment">// &lt;&lt; &quot; rabbits, and &quot; &lt;&lt; SolutionIntegerValue(response, pheasants)</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="comment">// &lt;&lt; &quot; pheasants.&quot;;</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="comment">// }</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#ifndef OR_TOOLS_SAT_CP_MODEL_H_</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#define OR_TOOLS_SAT_CP_MODEL_H_</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="preprocessor">#include &quot;absl/container/flat_hash_map.h&quot;</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="preprocessor">#include &quot;absl/types/span.h&quot;</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="cp__model_8pb_8h.html">ortools/sat/cp_model.pb.h</a>&quot;</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="cp__model__solver_8h.html">ortools/sat/cp_model_solver.h</a>&quot;</span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="preprocessor">#include &quot;ortools/sat/cp_model_utils.h&quot;</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="model_8h.html">ortools/sat/model.h</a>&quot;</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="sat__parameters_8pb_8h.html">ortools/sat/sat_parameters.pb.h</a>&quot;</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="sorted__interval__list_8h.html">ortools/util/sorted_interval_list.h</a>&quot;</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="namespaceoperations__research.html"> 48</a></span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceoperations__research.html">operations_research</a> {</div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html"> 49</a></span>&#160;<span class="keyword">namespace </span>sat {</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a>;</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>;</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160;<span class="comment">// A Boolean variable.</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="comment">// This class wraps an IntegerVariableProto with domain [0, 1].</span></div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<span class="comment">// It supports logical negation (Not).</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="comment">// This can only be constructed via CpModelBuilder.NewBoolVar().</span></div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1BoolVar.html"> 59</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> {</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#a8467b4b5dffef99ffb96ef6b9b4a4097">BoolVar</a>();</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="comment">// Sets the name of the variable.</span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#a1963637fcd9bfe8f9bd85a0971c0270d">WithName</a>(<span class="keyword">const</span> std::string&amp; name);</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;</div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1BoolVar.html#abcebeff89abbdb6b0b812616f1517f25"> 66</a></span>&#160; <span class="keyword">const</span> std::string&amp; <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#abcebeff89abbdb6b0b812616f1517f25">Name</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#a379713d334c199eeb834c338385293ba">Proto</a>().<a class="code" href="classoperations__research_1_1sat_1_1IntegerVariableProto.html#a5ae2400b8a1bbf76d789a2dfd6dcfcee">name</a>(); }</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="comment">// Returns the logical negation of the current Boolean variable.</span></div><div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1BoolVar.html#ac5a3346c2302559c71bd9cd1e989edf9"> 69</a></span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#ac5a3346c2302559c71bd9cd1e989edf9">Not</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#a8467b4b5dffef99ffb96ef6b9b4a4097">BoolVar</a>(NegatedRef(index_), cp_model_); }</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1BoolVar.html#afb7fdd0dab72ba28030fb6d03ce5c32f"> 71</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#afb7fdd0dab72ba28030fb6d03ce5c32f">operator==</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a>&amp; other)<span class="keyword"> const </span>{</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keywordflow">return</span> other.cp_model_ == cp_model_ &amp;&amp; other.index_ == index_;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; }</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1BoolVar.html#a6e9d4868f30b80fa5c37ac8991726110"> 75</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#a6e9d4868f30b80fa5c37ac8991726110">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a>&amp; other)<span class="keyword"> const </span>{</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keywordflow">return</span> other.cp_model_ != cp_model_ || other.index_ != index_;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; }</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; std::string <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#afb03d8ed70e426b0f7b83c76fce3c68f">DebugString</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="comment">// Useful for testing.</span></div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1BoolVar.html#a379713d334c199eeb834c338385293ba"> 82</a></span>&#160; <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1IntegerVariableProto.html">IntegerVariableProto</a>&amp; <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#a379713d334c199eeb834c338385293ba">Proto</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keywordflow">return</span> cp_model_-&gt;<a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html#ab0dda4e799f065179f785ede9a0a2540">variables</a>(index_);</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; }</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="comment">// Useful for model edition.</span></div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1BoolVar.html#ae7e96dfb8ae534a787632d78711f9a44"> 87</a></span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntegerVariableProto.html">IntegerVariableProto</a>* <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#ae7e96dfb8ae534a787632d78711f9a44">MutableProto</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keywordflow">return</span> cp_model_-&gt;<a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html#a16b8cc58fa3e670712e9cfe342e61be9">mutable_variables</a>(index_);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; }</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <span class="comment">// Returns the index of the variable in the model. If the variable is the</span></div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="comment">// negation of another variable v, its index is -v.index() - 1.</span></div><div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1BoolVar.html#a27d52277902e0d08306697a43863b5e8"> 93</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#a27d52277902e0d08306697a43863b5e8">index</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> index_; }</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1BoolVar.html#a946eae8a695dfad4799c1efecec379e6"> 96</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CircuitConstraint.html">CircuitConstraint</a>;</div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1BoolVar.html#a697ed9eaa8955d595a023663ab1e8418"> 97</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a>;</div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1BoolVar.html#ae04c85577cf33a05fb50bb361877fb42"> 98</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a>;</div><div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1BoolVar.html#a34419e55556ff4e92b447fe895bdb9c3"> 99</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a>;</div><div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1BoolVar.html#afc7f9983234a41167299a74f07ec6622"> 100</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html">IntervalVar</a>;</div><div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1BoolVar.html#a7678a938bf60a5c17fb47cf58995db0c"> 101</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>;</div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1BoolVar.html#ae0ff478f6506cb705bbc1737598276f4"> 102</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1ReservoirConstraint.html">ReservoirConstraint</a>;</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keyword">friend</span> <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#a8391a20c25890ccbf3f5e3982afed236">SolutionBooleanValue</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1CpSolverResponse.html">CpSolverResponse</a>&amp; r, <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> x);</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#a8467b4b5dffef99ffb96ef6b9b4a4097">BoolVar</a>(<span class="keywordtype">int</span> <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#a27d52277902e0d08306697a43863b5e8">index</a>, <a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html">CpModelProto</a>* cp_model);</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html">CpModelProto</a>* cp_model_ = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; <span class="keywordtype">int</span> index_ = kint32min;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;};</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;std::ostream&amp; <a class="code" href="namespaceoperations__research_1_1sat.html#a9c0ae0d048a431656985fc79428bbe67">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a>&amp; var);</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;<span class="comment">// A convenient wrapper so we can write Not(x) instead of x.Not() which is</span></div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;<span class="comment">// sometimes clearer.</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;<a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> <a class="code" href="namespaceoperations__research_1_1sat.html#a5e3de118c1f8dd5a7ec21704e05684b9">Not</a>(<a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> x);</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;<span class="comment">// An integer variable.</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;<span class="comment">// This class wraps an IntegerVariableProto.</span></div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;<span class="comment">// This can only be constructed via CpModelBuilder.NewIntVar().</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;<span class="comment">// Note that a BoolVar can be used in any place that accept an</span></div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;<span class="comment">// IntVar via an implicit cast. It will simply take the value</span></div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;<span class="comment">// 0 (when false) or 1 (when true).</span></div><div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntVar.html"> 124</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> {</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#a47cdd55b99ca5d29b194f54b14889819">IntVar</a>();</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <span class="comment">// Implicit cast BoolVar -&gt; IntVar.</span></div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#a47cdd55b99ca5d29b194f54b14889819">IntVar</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a>&amp; var); <span class="comment">// NOLINT(runtime/explicit)</span></div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160;</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="comment">// Sets the name of the variable.</span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#a5f1761c6d2c5f7908f5f92bb16b91de9">WithName</a>(<span class="keyword">const</span> std::string&amp; name);</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160;</div><div class="line"><a name="l00134"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntVar.html#aa8460c813c17ec5b7a137739c448bb98"> 134</a></span>&#160; <span class="keyword">const</span> std::string&amp; <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#aa8460c813c17ec5b7a137739c448bb98">Name</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#a426492195e6cdd88354def292ffa112f">Proto</a>().<a class="code" href="classoperations__research_1_1sat_1_1IntegerVariableProto.html#a5ae2400b8a1bbf76d789a2dfd6dcfcee">name</a>(); }</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntVar.html#a23d836e740ab297549905c5fa8539ba5"> 136</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#a23d836e740ab297549905c5fa8539ba5">operator==</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a>&amp; other)<span class="keyword"> const </span>{</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; <span class="keywordflow">return</span> other.cp_model_ == cp_model_ &amp;&amp; other.index_ == index_;</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; }</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntVar.html#a824aadc0688ab57929ae744b1f1a7a26"> 140</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#a824aadc0688ab57929ae744b1f1a7a26">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a>&amp; other)<span class="keyword"> const </span>{</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keywordflow">return</span> other.cp_model_ != cp_model_ || other.index_ != index_;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; }</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; std::string <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#aac78f1c00b73fbad7bd6577181f537fb">DebugString</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="comment">// Useful for testing.</span></div><div class="line"><a name="l00147"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntVar.html#a426492195e6cdd88354def292ffa112f"> 147</a></span>&#160; <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1IntegerVariableProto.html">IntegerVariableProto</a>&amp; <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#a426492195e6cdd88354def292ffa112f">Proto</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="keywordflow">return</span> cp_model_-&gt;<a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html#ab0dda4e799f065179f785ede9a0a2540">variables</a>(index_);</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; }</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="comment">// Useful for model edition.</span></div><div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntVar.html#a68349a30f6936d8f5a3d00d342ec5f3a"> 152</a></span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntegerVariableProto.html">IntegerVariableProto</a>* <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#a68349a30f6936d8f5a3d00d342ec5f3a">MutableProto</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keywordflow">return</span> cp_model_-&gt;<a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html#a16b8cc58fa3e670712e9cfe342e61be9">mutable_variables</a>(index_);</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; }</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="comment">// Returns the index of the variable in the model.</span></div><div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntVar.html#ade91cda36a02fffbd115f1ec65746af1"> 157</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#ade91cda36a02fffbd115f1ec65746af1">index</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> index_; }</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntVar.html#ae04c85577cf33a05fb50bb361877fb42"> 160</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a>;</div><div class="line"><a name="l00161"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntVar.html#a9d31ad87d4edee55fc3cb5e239077720"> 161</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CumulativeConstraint.html">CumulativeConstraint</a>;</div><div class="line"><a name="l00162"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntVar.html#a7678a938bf60a5c17fb47cf58995db0c"> 162</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>;</div><div class="line"><a name="l00163"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntVar.html#afc7f9983234a41167299a74f07ec6622"> 163</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html">IntervalVar</a>;</div><div class="line"><a name="l00164"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntVar.html#ae0ff478f6506cb705bbc1737598276f4"> 164</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1ReservoirConstraint.html">ReservoirConstraint</a>;</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="keyword">friend</span> int64 <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#a64bd6fadf44a9840c837cc701b2b9043">SolutionIntegerValue</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1CpSolverResponse.html">CpSolverResponse</a>&amp; r,</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; expr);</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; <span class="keyword">friend</span> int64 <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#a8ec929aea42c9e50e2f1daf56525e379">SolutionIntegerMin</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1CpSolverResponse.html">CpSolverResponse</a>&amp; r, <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> x);</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; <span class="keyword">friend</span> int64 <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#a79061f94ca7a97d0616f8b270358c771">SolutionIntegerMax</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1CpSolverResponse.html">CpSolverResponse</a>&amp; r, <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> x);</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160;</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#a47cdd55b99ca5d29b194f54b14889819">IntVar</a>(<span class="keywordtype">int</span> <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html#ade91cda36a02fffbd115f1ec65746af1">index</a>, <a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html">CpModelProto</a>* cp_model);</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160;</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html">CpModelProto</a>* cp_model_ = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; <span class="keywordtype">int</span> index_ = kint32min;</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160;};</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160;</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160;std::ostream&amp; <a class="code" href="namespaceoperations__research_1_1sat.html#a9c0ae0d048a431656985fc79428bbe67">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a>&amp; var);</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;</div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160;<span class="comment">// A dedicated container for linear expressions.</span></div><div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160;<span class="comment">// This class helps building and manipulating linear expressions.</span></div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160;<span class="comment">// With the use of implicit constructors, it can accept integer values, Boolean</span></div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160;<span class="comment">// and Integer variables. Note that Not(x) will be silently transformed into</span></div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160;<span class="comment">// 1 - x when added to the linear expression.</span></div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;<span class="comment">// Furthermore, static methods allows sums and scalar products, with or without</span></div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160;<span class="comment">// an additional constant.</span></div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160;<span class="comment">// Usage:</span></div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160;<span class="comment">// CpModelBuilder cp_model;</span></div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160;<span class="comment">// IntVar x = model.NewIntVar(0, 10, &quot;x&quot;);</span></div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160;<span class="comment">// IntVar y = model.NewIntVar(0, 10, &quot;y&quot;);</span></div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160;<span class="comment">// BoolVar b = model.NewBoolVar().WithName(&quot;b&quot;);</span></div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160;<span class="comment">// BoolVar c = model.NewBoolVar().WithName(&quot;c&quot;);</span></div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160;<span class="comment">// LinearExpr e1(x); // e1 = x.</span></div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160;<span class="comment">// LinearExpr e2 = LinearExpr::Sum({x, y}).AddConstant(5); // e2 = x + y + 5;</span></div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160;<span class="comment">// LinearExpr e3 = LinearExpr::ScalProd({x, y}, {2, -1}); // e3 = 2 * x - y.</span></div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160;<span class="comment">// LinearExpr e4(b); // e4 = b.</span></div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160;<span class="comment">// LinearExpr e5(b.Not()); // e5 = 1 - b.</span></div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160;<span class="comment">// // If passing a std::vector&lt;BoolVar&gt;, a specialized method must be called.</span></div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160;<span class="comment">// std::vector&lt;BoolVar&gt; bools = {b, Not(c)};</span></div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160;<span class="comment">// LinearExpr e6 = LinearExpr::BooleanSum(bools); // e6 = b + 1 - c;</span></div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160;<span class="comment">// // e7 = -3 * b + 1 - c;</span></div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160;<span class="comment">// LinearExpr e7 = LinearExpr::BooleanScalProd(bools, {-3, 1});</span></div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160;<span class="comment">// This can be used implicitly in some of the CpModelBuilder methods.</span></div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160;<span class="comment">// cp_model.AddGreaterThan(x, 5); // x &gt; 5</span></div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160;<span class="comment">// cp_model.AddEquality(x, LinearExpr(y).AddConstant(5)); // x == y + 5</span></div><div class="line"><a name="l00208"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1LinearExpr.html"> 208</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a> {</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html#ab33a810593c0a9f585133edcb22deb55">LinearExpr</a>();</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160;</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <span class="comment">// Constructs a linear expression from a Boolean variable.</span></div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>&#160; <span class="comment">// It deals with logical negation correctly.</span></div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html#ab33a810593c0a9f585133edcb22deb55">LinearExpr</a>(<a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> var); <span class="comment">// NOLINT(runtime/explicit)</span></div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160;</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="comment">// Constructs a linear expression from an integer variable.</span></div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html#ab33a810593c0a9f585133edcb22deb55">LinearExpr</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> var); <span class="comment">// NOLINT(runtime/explicit)</span></div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160;</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <span class="comment">// Constructs a constant linear expression.</span></div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html#ab33a810593c0a9f585133edcb22deb55">LinearExpr</a>(int64 <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html#a050775df6d69660af8f78d577fd327cc">constant</a>); <span class="comment">// NOLINT(runtime/explicit)</span></div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160;</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="comment">// Adds a constant value to the linear expression.</span></div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html#abed3c016b025d92058b1c29ddeef9341">AddConstant</a>(int64 value);</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160;</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <span class="comment">// Adds a single integer variable to the linear expression.</span></div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html#afb9c31fb1176a9ba22d4b82fa285a5c7">AddVar</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> var);</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160;</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="comment">// Adds a term (var * coeff) to the linear expression.</span></div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html#aa8bfd52517f0e1ca2a9adef474f1ff0c">AddTerm</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> var, int64 coeff);</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160;</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="comment">// Constructs the sum of a list of variables.</span></div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; <span class="keyword">static</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html#a74026647307b38916135e8c3dad3421f">Sum</a>(absl::Span&lt;const IntVar&gt; vars);</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <span class="comment">// Constructs the scalar product of variables and coefficients.</span></div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <span class="keyword">static</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html#a3b49fe9924ad61a609f65f4a7bc4c861">ScalProd</a>(absl::Span&lt;const IntVar&gt; vars,</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; absl::Span&lt;const int64&gt; coeffs);</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160;</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; <span class="comment">// Constructs the sum of a list of Booleans.</span></div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; <span class="keyword">static</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html#a0a6ff6ac94b7e556ff06df6f8211182f">BooleanSum</a>(absl::Span&lt;const BoolVar&gt; vars);</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160;</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="comment">// Constructs the scalar product of Booleans and coefficients.</span></div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <span class="keyword">static</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html#ae62c3c0da3b623e5e43530c08f7bf379">BooleanScalProd</a>(absl::Span&lt;const BoolVar&gt; vars,</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; absl::Span&lt;const int64&gt; coeffs);</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160;</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <span class="comment">// Useful for testing.</span></div><div class="line"><a name="l00246"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1LinearExpr.html#af5805ba35a6efa9460c5d8eab8301172"> 246</a></span>&#160; <span class="keyword">const</span> std::vector&lt;IntVar&gt;&amp; <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html#af5805ba35a6efa9460c5d8eab8301172">variables</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> variables_; }</div><div class="line"><a name="l00247"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1LinearExpr.html#a6f0e8040bcb0ee633efd0862c660cbf4"> 247</a></span>&#160; <span class="keyword">const</span> std::vector&lt;int64&gt;&amp; <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html#a6f0e8040bcb0ee633efd0862c660cbf4">coefficients</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> coefficients_; }</div><div class="line"><a name="l00248"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1LinearExpr.html#a050775df6d69660af8f78d577fd327cc"> 248</a></span>&#160; int64 <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html#a050775df6d69660af8f78d577fd327cc">constant</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> constant_; }</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160;</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; <span class="comment">// TODO(user): LinearExpr.DebugString() and operator&lt;&lt;.</span></div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160;</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; std::vector&lt;IntVar&gt; variables_;</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; std::vector&lt;int64&gt; coefficients_;</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; int64 constant_ = 0;</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160;};</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160;</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160;<span class="comment">// Represents a Interval variable.</span></div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160;<span class="comment">// An interval variable is both a constraint and a variable. It is defined by</span></div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160;<span class="comment">// three integer variables: start, size, and end.</span></div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;<span class="comment">// It is a constraint because, internally, it enforces that start + size == end.</span></div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160;<span class="comment">// It is also a variable as it can appear in specific scheduling constraints:</span></div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160;<span class="comment">// NoOverlap, NoOverlap2D, Cumulative.</span></div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;<span class="comment">// Optionally, a presence literal can be added to this constraint. This presence</span></div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160;<span class="comment">// literal is understood by the same constraints. These constraints ignore</span></div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160;<span class="comment">// interval variables with precence literals assigned to false. Conversely,</span></div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160;<span class="comment">// these constraints will also set these presence literals to false if they</span></div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160;<span class="comment">// cannot fit these intervals into the schedule.</span></div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160;<span class="comment">// It can only be constructed via CpModelBuilder.NewIntervalVar().</span></div><div class="line"><a name="l00275"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntervalVar.html"> 275</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html">IntervalVar</a> {</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; <span class="comment">// Default ctor.</span></div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#a106c293c6b0cac8589bc6b5b4ff0446c">IntervalVar</a>();</div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160;</div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <span class="comment">// Sets the name of the variable.</span></div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html">IntervalVar</a> <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#a1b7333dffeb56f1cffe35973cab19dd1">WithName</a>(<span class="keyword">const</span> std::string&amp; name);</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160;</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; std::string <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#a48f98ff3c12aecf540170647a72ce860">Name</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160;</div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; <span class="comment">// Returns the start variable.</span></div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#a6228ce653636516ab2b2f760aa61a57e">StartVar</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160;</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <span class="comment">// Returns the size variable.</span></div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#a9decc39f3f2079f78cdebd974972bc0f">SizeVar</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160;</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; <span class="comment">// Returns the end variable.</span></div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#ac86513192443e57e505b8e8c9ffb77f2">EndVar</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160;</div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; <span class="comment">// Returns a BoolVar indicating the presence of this interval.</span></div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; <span class="comment">// It returns CpModelBuilder.TrueVar() if the interval is not optional.</span></div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#aa5cc77b54d51bda6a6c8e30907b9a917">PresenceBoolVar</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160;</div><div class="line"><a name="l00298"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntervalVar.html#a34a66e31983270cb695c271d0b869ab3"> 298</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#a34a66e31983270cb695c271d0b869ab3">operator==</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html">IntervalVar</a>&amp; other)<span class="keyword"> const </span>{</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; <span class="keywordflow">return</span> other.cp_model_ == cp_model_ &amp;&amp; other.index_ == index_;</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; }</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160;</div><div class="line"><a name="l00302"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntervalVar.html#a6816a7260a80aa691b7cc1e748323d21"> 302</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#a6816a7260a80aa691b7cc1e748323d21">operator!=</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html">IntervalVar</a>&amp; other)<span class="keyword"> const </span>{</div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; <span class="keywordflow">return</span> other.cp_model_ != cp_model_ || other.index_ != index_;</div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; }</div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160;</div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; std::string <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#af90bf96ccc72778be5ebd9668e10d842">DebugString</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160;</div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; <span class="comment">// Useful for testing.</span></div><div class="line"><a name="l00309"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntervalVar.html#a34c3fc0d93697326a7e398cd45b1374d"> 309</a></span>&#160; <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1IntervalConstraintProto.html">IntervalConstraintProto</a>&amp; <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#a34c3fc0d93697326a7e398cd45b1374d">Proto</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; <span class="keywordflow">return</span> cp_model_-&gt;<a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html#aef37b42d42f179a384a7cf514c58ba5f">constraints</a>(index_).<a class="code" href="classoperations__research_1_1sat_1_1ConstraintProto.html#ade0baf9bbe5b09d470ab30ae8b730cc4">interval</a>();</div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; }</div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160;</div><div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160; <span class="comment">// Useful for model edition.</span></div><div class="line"><a name="l00314"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntervalVar.html#a4d10907c6da83ee20c29312f1064361f"> 314</a></span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntervalConstraintProto.html">IntervalConstraintProto</a>* <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#a4d10907c6da83ee20c29312f1064361f">MutableProto</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; <span class="keywordflow">return</span> cp_model_-&gt;<a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html#ad81813da437a67ae5f1a28b8fe290614">mutable_constraints</a>(index_)-&gt;<a class="code" href="classoperations__research_1_1sat_1_1ConstraintProto.html#a86f1152bd1888743f98a99b789d3295b">mutable_interval</a>();</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; }</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160;</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160; <span class="comment">// Returns the index of the interval constraint in the model.</span></div><div class="line"><a name="l00319"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntervalVar.html#ac591e644d995d2520e859ee639695754"> 319</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#ac591e644d995d2520e859ee639695754">index</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> index_; }</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160;</div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00322"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntervalVar.html#ae04c85577cf33a05fb50bb361877fb42"> 322</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a>;</div><div class="line"><a name="l00323"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntervalVar.html#a9d31ad87d4edee55fc3cb5e239077720"> 323</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CumulativeConstraint.html">CumulativeConstraint</a>;</div><div class="line"><a name="l00324"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1IntervalVar.html#abdbbe5d06195ef1dc4c30ad25b9017ac"> 324</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1NoOverlap2DConstraint.html">NoOverlap2DConstraint</a>;</div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160; <span class="keyword">friend</span> std::ostream&amp; <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#ad73e372cd9d1def69624f85777393123">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html">IntervalVar</a>&amp; var);</div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160;</div><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#a106c293c6b0cac8589bc6b5b4ff0446c">IntervalVar</a>(<span class="keywordtype">int</span> <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html#ac591e644d995d2520e859ee639695754">index</a>, <a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html">CpModelProto</a>* cp_model);</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160;</div><div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html">CpModelProto</a>* cp_model_ = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160; <span class="keywordtype">int</span> index_ = kint32min;</div><div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160;};</div><div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160;</div><div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160;std::ostream&amp; <a class="code" href="namespaceoperations__research_1_1sat.html#a9c0ae0d048a431656985fc79428bbe67">operator&lt;&lt;</a>(std::ostream&amp; os, <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html">IntervalVar</a>&amp; var);</div><div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160;</div><div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160;<span class="comment">// A constraint.</span></div><div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160;<span class="comment">// This class enable modifying the constraint that was added to the model.</span></div><div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160;<span class="comment">// It can anly be built by the different CpModelBuilder::AddXXX methods.</span></div><div class="line"><a name="l00340"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1Constraint.html"> 340</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> {</div><div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160; <span class="comment">// The constraint will be enforced iff all literals listed here are true. If</span></div><div class="line"><a name="l00343"></a><span class="lineno"> 343</span>&#160; <span class="comment">// this is empty, then the constraint will always be enforced. An enforced</span></div><div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; <span class="comment">// constraint must be satisfied, and an un-enforced one will simply be</span></div><div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160; <span class="comment">// ignored.</span></div><div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160; <span class="comment">// This is also called half-reification. To have an equivalence between a</span></div><div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160; <span class="comment">// literal and a constraint (full reification), one must add both a constraint</span></div><div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160; <span class="comment">// (controlled by a literal l) and its negation (controlled by the negation of</span></div><div class="line"><a name="l00350"></a><span class="lineno"> 350</span>&#160; <span class="comment">// l).</span></div><div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160; <span class="comment">// Important: as of September 2018, only a few constraint support enforcement:</span></div><div class="line"><a name="l00353"></a><span class="lineno"> 353</span>&#160; <span class="comment">// - bool_or, bool_and, linear: fully supported.</span></div><div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160; <span class="comment">// - interval: only support a single enforcement literal.</span></div><div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160; <span class="comment">// - other: no support (but can be added on a per-demand basis).</span></div><div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html#a9052e9e1dd8248433909b5542f314add">OnlyEnforceIf</a>(absl::Span&lt;const BoolVar&gt; literals);</div><div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160;</div><div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160; <span class="comment">// See OnlyEnforceIf(absl::Span&lt;const BoolVar&gt; literals).</span></div><div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html#a9052e9e1dd8248433909b5542f314add">OnlyEnforceIf</a>(<a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> literal);</div><div class="line"><a name="l00360"></a><span class="lineno"> 360</span>&#160;</div><div class="line"><a name="l00361"></a><span class="lineno"> 361</span>&#160; <span class="comment">// Sets the name of the constraint.</span></div><div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html#a9401ab195650160402df5b61f8ac9bda">WithName</a>(<span class="keyword">const</span> std::string&amp; name);</div><div class="line"><a name="l00363"></a><span class="lineno"> 363</span>&#160;</div><div class="line"><a name="l00364"></a><span class="lineno"> 364</span>&#160; <span class="keyword">const</span> std::string&amp; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html#aeaf30f4ee7d141e68905f1ac2432b937">Name</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00365"></a><span class="lineno"> 365</span>&#160;</div><div class="line"><a name="l00366"></a><span class="lineno"> 366</span>&#160; <span class="comment">// Useful for testing.</span></div><div class="line"><a name="l00367"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1Constraint.html#aa0b277df64333f670b66c8d5295b8250"> 367</a></span>&#160; <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1ConstraintProto.html">ConstraintProto</a>&amp; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html#aa0b277df64333f670b66c8d5295b8250">Proto</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> *<a class="code" href="classoperations__research_1_1sat_1_1Constraint.html#a9d74c3d77f601020ab87700745f830ad">proto_</a>; }</div><div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160;</div><div class="line"><a name="l00369"></a><span class="lineno"> 369</span>&#160; <span class="comment">// Useful for model edition.</span></div><div class="line"><a name="l00370"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1Constraint.html#acaa17b2fbfd62f6845329ae944835654"> 370</a></span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1ConstraintProto.html">ConstraintProto</a>* <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html#acaa17b2fbfd62f6845329ae944835654">MutableProto</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html#a9d74c3d77f601020ab87700745f830ad">proto_</a>; }</div><div class="line"><a name="l00371"></a><span class="lineno"> 371</span>&#160;</div><div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160; <span class="keyword">protected</span>:</div><div class="line"><a name="l00373"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1Constraint.html#ae04c85577cf33a05fb50bb361877fb42"> 373</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a>;</div><div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160;</div><div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160; <span class="keyword">explicit</span> <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html#a9a6b9b664d4d0d56e8c0d14c8ad3bad9">Constraint</a>(<a class="code" href="classoperations__research_1_1sat_1_1ConstraintProto.html">ConstraintProto</a>* proto);</div><div class="line"><a name="l00376"></a><span class="lineno"> 376</span>&#160;</div><div class="line"><a name="l00377"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1Constraint.html#a9d74c3d77f601020ab87700745f830ad"> 377</a></span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1ConstraintProto.html">ConstraintProto</a>* <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html#a9d74c3d77f601020ab87700745f830ad">proto_</a> = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00378"></a><span class="lineno"> 378</span>&#160;};</div><div class="line"><a name="l00379"></a><span class="lineno"> 379</span>&#160;</div><div class="line"><a name="l00380"></a><span class="lineno"> 380</span>&#160;<span class="comment">// Specialized circuit constraint.</span></div><div class="line"><a name="l00381"></a><span class="lineno"> 381</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00382"></a><span class="lineno"> 382</span>&#160;<span class="comment">// This constraint allows adding arcs to the circuit constraint incrementally.</span></div><div class="line"><a name="l00383"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1CircuitConstraint.html"> 383</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CircuitConstraint.html">CircuitConstraint</a> : <span class="keyword">public</span> <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> {</div><div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1CircuitConstraint.html#a9ee6aa474b9e4c2bcf8fab717079704d">AddArc</a>(<span class="keywordtype">int</span> tail, <span class="keywordtype">int</span> head, <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> literal);</div><div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160;</div><div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00388"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1CircuitConstraint.html#ae04c85577cf33a05fb50bb361877fb42"> 388</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a>;</div><div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160;</div><div class="line"><a name="l00390"></a><span class="lineno"> 390</span>&#160; <span class="keyword">using</span> <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html#a9a6b9b664d4d0d56e8c0d14c8ad3bad9">Constraint::Constraint</a>;</div><div class="line"><a name="l00391"></a><span class="lineno"> 391</span>&#160;};</div><div class="line"><a name="l00392"></a><span class="lineno"> 392</span>&#160;</div><div class="line"><a name="l00393"></a><span class="lineno"> 393</span>&#160;<span class="comment">// Specialized assignment constraint.</span></div><div class="line"><a name="l00394"></a><span class="lineno"> 394</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160;<span class="comment">// This constraint allows adding tuples to the allowed/forbidden assignment</span></div><div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160;<span class="comment">// constraint incrementally.</span></div><div class="line"><a name="l00397"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1TableConstraint.html"> 397</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1TableConstraint.html">TableConstraint</a> : <span class="keyword">public</span> <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> {</div><div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1TableConstraint.html#a90017a38e8ac8eaf4644bdce5e5e1420">AddTuple</a>(absl::Span&lt;const int64&gt; tuple);</div><div class="line"><a name="l00400"></a><span class="lineno"> 400</span>&#160;</div><div class="line"><a name="l00401"></a><span class="lineno"> 401</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00402"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1TableConstraint.html#ae04c85577cf33a05fb50bb361877fb42"> 402</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a>;</div><div class="line"><a name="l00403"></a><span class="lineno"> 403</span>&#160;</div><div class="line"><a name="l00404"></a><span class="lineno"> 404</span>&#160; <span class="keyword">using</span> <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html#a9a6b9b664d4d0d56e8c0d14c8ad3bad9">Constraint::Constraint</a>;</div><div class="line"><a name="l00405"></a><span class="lineno"> 405</span>&#160;};</div><div class="line"><a name="l00406"></a><span class="lineno"> 406</span>&#160;</div><div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160;<span class="comment">// Specialized reservoir constraint.</span></div><div class="line"><a name="l00408"></a><span class="lineno"> 408</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00409"></a><span class="lineno"> 409</span>&#160;<span class="comment">// This constraint allows adding emptying/refilling events to the reservoir</span></div><div class="line"><a name="l00410"></a><span class="lineno"> 410</span>&#160;<span class="comment">// constraint incrementally.</span></div><div class="line"><a name="l00411"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1ReservoirConstraint.html"> 411</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1ReservoirConstraint.html">ReservoirConstraint</a> : <span class="keyword">public</span> <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> {</div><div class="line"><a name="l00412"></a><span class="lineno"> 412</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00413"></a><span class="lineno"> 413</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1ReservoirConstraint.html#aff0e9a5c156c176def60cf2985919bd6">AddEvent</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> time, int64 demand);</div><div class="line"><a name="l00414"></a><span class="lineno"> 414</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1ReservoirConstraint.html#aad9028f0c33c7d4799891b9f742148b6">AddOptionalEvent</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> time, int64 demand, <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> is_active);</div><div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160;</div><div class="line"><a name="l00416"></a><span class="lineno"> 416</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00417"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1ReservoirConstraint.html#ae04c85577cf33a05fb50bb361877fb42"> 417</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a>;</div><div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160;</div><div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1ReservoirConstraint.html">ReservoirConstraint</a>(<a class="code" href="classoperations__research_1_1sat_1_1ConstraintProto.html">ConstraintProto</a>* proto, <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a>* builder);</div><div class="line"><a name="l00420"></a><span class="lineno"> 420</span>&#160;</div><div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a>* builder_;</div><div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160;};</div><div class="line"><a name="l00423"></a><span class="lineno"> 423</span>&#160;</div><div class="line"><a name="l00424"></a><span class="lineno"> 424</span>&#160;<span class="comment">// Specialized automaton constraint.</span></div><div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00426"></a><span class="lineno"> 426</span>&#160;<span class="comment">// This constraint allows adding transitions to the automaton constraint</span></div><div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160;<span class="comment">// incrementally.</span></div><div class="line"><a name="l00428"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1AutomatonConstraint.html"> 428</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1AutomatonConstraint.html">AutomatonConstraint</a> : <span class="keyword">public</span> <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> {</div><div class="line"><a name="l00429"></a><span class="lineno"> 429</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00430"></a><span class="lineno"> 430</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1AutomatonConstraint.html#a4fa8634eeba27c91397c58105ff50eb7">AddTransition</a>(<span class="keywordtype">int</span> tail, <span class="keywordtype">int</span> head, int64 transition_label);</div><div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160;</div><div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00433"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1AutomatonConstraint.html#ae04c85577cf33a05fb50bb361877fb42"> 433</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a>;</div><div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160;</div><div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160; <span class="keyword">using</span> <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html#a9a6b9b664d4d0d56e8c0d14c8ad3bad9">Constraint::Constraint</a>;</div><div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160;};</div><div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160;</div><div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160;<span class="comment">// Specialized no_overlap2D constraint.</span></div><div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00440"></a><span class="lineno"> 440</span>&#160;<span class="comment">// This constraint allows adding rectangles to the no_overlap2D</span></div><div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160;<span class="comment">// constraint incrementally.</span></div><div class="line"><a name="l00442"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1NoOverlap2DConstraint.html"> 442</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1NoOverlap2DConstraint.html">NoOverlap2DConstraint</a> : <span class="keyword">public</span> <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> {</div><div class="line"><a name="l00443"></a><span class="lineno"> 443</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00444"></a><span class="lineno"> 444</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1NoOverlap2DConstraint.html#a7e76dae6971e2f38651b7eb8411ebe63">AddRectangle</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html">IntervalVar</a> x_coordinate, <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html">IntervalVar</a> y_coordinate);</div><div class="line"><a name="l00445"></a><span class="lineno"> 445</span>&#160;</div><div class="line"><a name="l00446"></a><span class="lineno"> 446</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00447"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1NoOverlap2DConstraint.html#ae04c85577cf33a05fb50bb361877fb42"> 447</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a>;</div><div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160;</div><div class="line"><a name="l00449"></a><span class="lineno"> 449</span>&#160; <span class="keyword">using</span> <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html#a9a6b9b664d4d0d56e8c0d14c8ad3bad9">Constraint::Constraint</a>;</div><div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160;};</div><div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160;</div><div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160;<span class="comment">// Specialized cumulative constraint.</span></div><div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160;<span class="comment">// This constraint allows adding fixed or variables demands to the cumulative</span></div><div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160;<span class="comment">// constraint incrementally.</span></div><div class="line"><a name="l00456"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1CumulativeConstraint.html"> 456</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CumulativeConstraint.html">CumulativeConstraint</a> : <span class="keyword">public</span> <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> {</div><div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1CumulativeConstraint.html#aded0689c7c92b1a7739758150131b531">AddDemand</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html">IntervalVar</a> interval, <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> demand);</div><div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160;</div><div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00461"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1CumulativeConstraint.html#ae04c85577cf33a05fb50bb361877fb42"> 461</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a>;</div><div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160;</div><div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1CumulativeConstraint.html">CumulativeConstraint</a>(<a class="code" href="classoperations__research_1_1sat_1_1ConstraintProto.html">ConstraintProto</a>* proto, <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a>* builder);</div><div class="line"><a name="l00464"></a><span class="lineno"> 464</span>&#160;</div><div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a>* builder_;</div><div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160;};</div><div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160;</div><div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160;<span class="comment">// Wrapper class around the cp_model proto.</span></div><div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160;<span class="comment">// This class provides two types of methods:</span></div><div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160;<span class="comment">// - NewXXX to create integer, boolean, or interval variables.</span></div><div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160;<span class="comment">// - AddXXX to create new constraints and add them to the model.</span></div><div class="line"><a name="l00473"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1CpModelBuilder.html"> 473</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html">CpModelBuilder</a> {</div><div class="line"><a name="l00474"></a><span class="lineno"> 474</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; <span class="comment">// Creates an integer variable with the given domain.</span></div><div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a0887a2fe4518bde7bbde18f592b6243f">NewIntVar</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1Domain.html">Domain</a>&amp; domain);</div><div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160;</div><div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160; <span class="comment">// Creates a Boolean variable.</span></div><div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a8fc4a0c717f985687d63a586dba04641">NewBoolVar</a>();</div><div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160;</div><div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160; <span class="comment">// Creates a constant variable.</span></div><div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#adac551c8b80fc7bdd7b30779fd20a4ea">NewConstant</a>(int64 value);</div><div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160;</div><div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160; <span class="comment">// Creates an always true Boolean variable.</span></div><div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a6dc655a67c5213fcefb82a213dac5e2c">TrueVar</a>();</div><div class="line"><a name="l00486"></a><span class="lineno"> 486</span>&#160;</div><div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160; <span class="comment">// Creates an always false Boolean variable.</span></div><div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a9a53531099bebddbf54dd15418817326">FalseVar</a>();</div><div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160;</div><div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160; <span class="comment">// Creates an interval variable.</span></div><div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html">IntervalVar</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a4e1c85e161ee8e50f2f2162cd7294d03">NewIntervalVar</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> start, <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> size, <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> end);</div><div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160;</div><div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160; <span class="comment">// Creates an optional interval variable.</span></div><div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntervalVar.html">IntervalVar</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a99c82eca478306942b3aed3372b38384">NewOptionalIntervalVar</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> start, <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> size, <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> end,</div><div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> presence);</div><div class="line"><a name="l00496"></a><span class="lineno"> 496</span>&#160;</div><div class="line"><a name="l00497"></a><span class="lineno"> 497</span>&#160; <span class="comment">// Adds the constraint that at least one of the literals must be true.</span></div><div class="line"><a name="l00498"></a><span class="lineno"> 498</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#ae8bd984917b305dc49abae6c19b69ea3">AddBoolOr</a>(absl::Span&lt;const BoolVar&gt; literals);</div><div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160;</div><div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160; <span class="comment">// Adds the constraint that all literals must be true.</span></div><div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a3088d984ab4874140f7c367dc457ac0f">AddBoolAnd</a>(absl::Span&lt;const BoolVar&gt; literals);</div><div class="line"><a name="l00502"></a><span class="lineno"> 502</span>&#160;</div><div class="line"><a name="l00504"></a><span class="lineno"> 504</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a18d2ca2be01dd3e67893f4e1dbe4af43">AddBoolXor</a>(absl::Span&lt;const BoolVar&gt; literals);</div><div class="line"><a name="l00505"></a><span class="lineno"> 505</span>&#160;</div><div class="line"><a name="l00506"></a><span class="lineno"> 506</span>&#160; <span class="comment">// Adds a =&gt; b.</span></div><div class="line"><a name="l00507"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a43ca3f9c073ea5078c1abd3bb0c563d4"> 507</a></span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a43ca3f9c073ea5078c1abd3bb0c563d4">AddImplication</a>(<a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> a, <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> b) {</div><div class="line"><a name="l00508"></a><span class="lineno"> 508</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#ae8bd984917b305dc49abae6c19b69ea3">AddBoolOr</a>({a.<a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html#ac5a3346c2302559c71bd9cd1e989edf9">Not</a>(), b});</div><div class="line"><a name="l00509"></a><span class="lineno"> 509</span>&#160; }</div><div class="line"><a name="l00510"></a><span class="lineno"> 510</span>&#160;</div><div class="line"><a name="l00511"></a><span class="lineno"> 511</span>&#160; <span class="comment">// Adds left == right.</span></div><div class="line"><a name="l00512"></a><span class="lineno"> 512</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#ad941d4f0156fc746c4ed12790bce7af7">AddEquality</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; left, <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; right);</div><div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160;</div><div class="line"><a name="l00514"></a><span class="lineno"> 514</span>&#160; <span class="comment">// Adds left &gt;= right.</span></div><div class="line"><a name="l00515"></a><span class="lineno"> 515</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a7a718730caef4f258e1cbbb2e3e3b452">AddGreaterOrEqual</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; left, <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; right);</div><div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160;</div><div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160; <span class="comment">// Adds left &gt; right.</span></div><div class="line"><a name="l00518"></a><span class="lineno"> 518</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#acf4c5429ec08207e147b65bd1330ba92">AddGreaterThan</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; left, <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; right);</div><div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160;</div><div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160; <span class="comment">// Adds left &lt;= right.</span></div><div class="line"><a name="l00521"></a><span class="lineno"> 521</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a4f1c8c11f9f840728e5c037249192b8f">AddLessOrEqual</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; left, <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; right);</div><div class="line"><a name="l00522"></a><span class="lineno"> 522</span>&#160;</div><div class="line"><a name="l00523"></a><span class="lineno"> 523</span>&#160; <span class="comment">// Adds left &lt; right.</span></div><div class="line"><a name="l00524"></a><span class="lineno"> 524</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a7cf9ff9df25ff433286b4f5bda41f990">AddLessThan</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; left, <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; right);</div><div class="line"><a name="l00525"></a><span class="lineno"> 525</span>&#160;</div><div class="line"><a name="l00526"></a><span class="lineno"> 526</span>&#160; <span class="comment">// Adds expr in domain.</span></div><div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a562a899753d60f28ae87ecb93e96b797">AddLinearConstraint</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; expr, <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1Domain.html">Domain</a>&amp; domain);</div><div class="line"><a name="l00528"></a><span class="lineno"> 528</span>&#160;</div><div class="line"><a name="l00529"></a><span class="lineno"> 529</span>&#160; <span class="comment">// Adds left != right.</span></div><div class="line"><a name="l00530"></a><span class="lineno"> 530</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#aa64c33dd1487bf4f0d575edf33ef2dc9">AddNotEqual</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; left, <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; right);</div><div class="line"><a name="l00531"></a><span class="lineno"> 531</span>&#160;</div><div class="line"><a name="l00532"></a><span class="lineno"> 532</span>&#160; <span class="comment">// this constraint forces all variables to have different values.</span></div><div class="line"><a name="l00533"></a><span class="lineno"> 533</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a605cc0b904f4d9b2de5fffbf6fa40c68">AddAllDifferent</a>(absl::Span&lt;const IntVar&gt; vars);</div><div class="line"><a name="l00534"></a><span class="lineno"> 534</span>&#160;</div><div class="line"><a name="l00535"></a><span class="lineno"> 535</span>&#160; <span class="comment">// Adds the element constraint: variables[index] == target</span></div><div class="line"><a name="l00536"></a><span class="lineno"> 536</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a001974a3f1f5e9d791ae10cd435f07cf">AddVariableElement</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> index,</div><div class="line"><a name="l00537"></a><span class="lineno"> 537</span>&#160; absl::Span&lt;const IntVar&gt; variables,</div><div class="line"><a name="l00538"></a><span class="lineno"> 538</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> target);</div><div class="line"><a name="l00539"></a><span class="lineno"> 539</span>&#160;</div><div class="line"><a name="l00540"></a><span class="lineno"> 540</span>&#160; <span class="comment">// Adds the element constraint: values[index] == target</span></div><div class="line"><a name="l00541"></a><span class="lineno"> 541</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#ada1b4fad9b4f017f9009ce3761123a8b">AddElement</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> index, absl::Span&lt;const int64&gt; values,</div><div class="line"><a name="l00542"></a><span class="lineno"> 542</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> target);</div><div class="line"><a name="l00543"></a><span class="lineno"> 543</span>&#160;</div><div class="line"><a name="l00544"></a><span class="lineno"> 544</span>&#160; <span class="comment">// Adds a circuit constraint.</span></div><div class="line"><a name="l00545"></a><span class="lineno"> 545</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00546"></a><span class="lineno"> 546</span>&#160; <span class="comment">// The circuit constraint is defined on a graph where the arc presence are</span></div><div class="line"><a name="l00547"></a><span class="lineno"> 547</span>&#160; <span class="comment">// controlled by literals. That is the arc is part of the circuit of its</span></div><div class="line"><a name="l00548"></a><span class="lineno"> 548</span>&#160; <span class="comment">// corresponding literal is assigned to true.</span></div><div class="line"><a name="l00549"></a><span class="lineno"> 549</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00550"></a><span class="lineno"> 550</span>&#160; <span class="comment">// For now, we ignore node indices with no incident arc. All the other nodes</span></div><div class="line"><a name="l00551"></a><span class="lineno"> 551</span>&#160; <span class="comment">// must have exactly one incoming and one outgoing selected arc (i.e. literal</span></div><div class="line"><a name="l00552"></a><span class="lineno"> 552</span>&#160; <span class="comment">// at true). All the selected arcs that are not self-loops must form a single</span></div><div class="line"><a name="l00553"></a><span class="lineno"> 553</span>&#160; <span class="comment">// circuit.</span></div><div class="line"><a name="l00554"></a><span class="lineno"> 554</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00555"></a><span class="lineno"> 555</span>&#160; <span class="comment">// It returns a circuit constraint that allows adding arcs incrementally after</span></div><div class="line"><a name="l00556"></a><span class="lineno"> 556</span>&#160; <span class="comment">// construction.</span></div><div class="line"><a name="l00557"></a><span class="lineno"> 557</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1CircuitConstraint.html">CircuitConstraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#ad5ec615a9107ebcb8a7516bb3ccfbcd2">AddCircuitConstraint</a>();</div><div class="line"><a name="l00558"></a><span class="lineno"> 558</span>&#160;</div><div class="line"><a name="l00559"></a><span class="lineno"> 559</span>&#160; <span class="comment">// Adds an allowed assignments constraint.</span></div><div class="line"><a name="l00560"></a><span class="lineno"> 560</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00561"></a><span class="lineno"> 561</span>&#160; <span class="comment">// An AllowedAssignments constraint is a constraint on an array of variables</span></div><div class="line"><a name="l00562"></a><span class="lineno"> 562</span>&#160; <span class="comment">// that forces, when all variables are fixed to a single value, that the</span></div><div class="line"><a name="l00563"></a><span class="lineno"> 563</span>&#160; <span class="comment">// corresponding list of values is equal to one of the tuple added to the</span></div><div class="line"><a name="l00564"></a><span class="lineno"> 564</span>&#160; <span class="comment">// constraint.</span></div><div class="line"><a name="l00565"></a><span class="lineno"> 565</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00566"></a><span class="lineno"> 566</span>&#160; <span class="comment">// It returns a table constraint that allows adding tuples incrementally after</span></div><div class="line"><a name="l00567"></a><span class="lineno"> 567</span>&#160; <span class="comment">// construction,</span></div><div class="line"><a name="l00568"></a><span class="lineno"> 568</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1TableConstraint.html">TableConstraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a7d05d91ffdd70f16ad170e25fd47e200">AddAllowedAssignments</a>(absl::Span&lt;const IntVar&gt; vars);</div><div class="line"><a name="l00569"></a><span class="lineno"> 569</span>&#160;</div><div class="line"><a name="l00570"></a><span class="lineno"> 570</span>&#160; <span class="comment">// Adds an forbidden assignments constraint.</span></div><div class="line"><a name="l00571"></a><span class="lineno"> 571</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00572"></a><span class="lineno"> 572</span>&#160; <span class="comment">// A ForbiddenAssignments constraint is a constraint on an array of variables</span></div><div class="line"><a name="l00573"></a><span class="lineno"> 573</span>&#160; <span class="comment">// where the list of impossible combinations is provided in the tuples added</span></div><div class="line"><a name="l00574"></a><span class="lineno"> 574</span>&#160; <span class="comment">// to the constraint.</span></div><div class="line"><a name="l00575"></a><span class="lineno"> 575</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00576"></a><span class="lineno"> 576</span>&#160; <span class="comment">// It returns a table constraint that allows adding tuples incrementally after</span></div><div class="line"><a name="l00577"></a><span class="lineno"> 577</span>&#160; <span class="comment">// construction,</span></div><div class="line"><a name="l00578"></a><span class="lineno"> 578</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1TableConstraint.html">TableConstraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a05b1310e7cfde91fbdc10798a84a2345">AddForbiddenAssignments</a>(absl::Span&lt;const IntVar&gt; vars);</div><div class="line"><a name="l00579"></a><span class="lineno"> 579</span>&#160;</div><div class="line"><a name="l00580"></a><span class="lineno"> 580</span>&#160; <span class="comment">// An inverse constraint enforces that if &#39;variables[i]&#39; is assigned a value</span></div><div class="line"><a name="l00581"></a><span class="lineno"> 581</span>&#160; <span class="comment">// &#39;j&#39;, then inverse_variables[j] is assigned a value &#39;i&#39;. And vice versa.</span></div><div class="line"><a name="l00582"></a><span class="lineno"> 582</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a0c391768bc423a43875a7867ee247a4b">AddInverseConstraint</a>(absl::Span&lt;const IntVar&gt; variables,</div><div class="line"><a name="l00583"></a><span class="lineno"> 583</span>&#160; absl::Span&lt;const IntVar&gt; inverse_variables);</div><div class="line"><a name="l00584"></a><span class="lineno"> 584</span>&#160;</div><div class="line"><a name="l00585"></a><span class="lineno"> 585</span>&#160; <span class="comment">// Adds a reservoir constraint with optional refill/emptying events.</span></div><div class="line"><a name="l00586"></a><span class="lineno"> 586</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00587"></a><span class="lineno"> 587</span>&#160; <span class="comment">// Maintain a reservoir level within bounds. The water level starts at 0, and</span></div><div class="line"><a name="l00588"></a><span class="lineno"> 588</span>&#160; <span class="comment">// at any time &gt;= 0, it must be within min_level, and max_level. Furthermore,</span></div><div class="line"><a name="l00589"></a><span class="lineno"> 589</span>&#160; <span class="comment">// this constraints expect all times variables to be &gt;= 0. Given an event</span></div><div class="line"><a name="l00590"></a><span class="lineno"> 590</span>&#160; <span class="comment">// (time, demand, active), if active is true, and if time is assigned a value</span></div><div class="line"><a name="l00591"></a><span class="lineno"> 591</span>&#160; <span class="comment">// t, then the level of the reservoir changes by demand (which is constant) at</span></div><div class="line"><a name="l00592"></a><span class="lineno"> 592</span>&#160; <span class="comment">// time t.</span></div><div class="line"><a name="l00593"></a><span class="lineno"> 593</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00594"></a><span class="lineno"> 594</span>&#160; <span class="comment">// Note that level_min can be &gt; 0, or level_max can be &lt; 0. It just forces</span></div><div class="line"><a name="l00595"></a><span class="lineno"> 595</span>&#160; <span class="comment">// some demands to be executed at time 0 to make sure that we are within those</span></div><div class="line"><a name="l00596"></a><span class="lineno"> 596</span>&#160; <span class="comment">// bounds with the executed demands. Therefore, at any time t &gt;= 0:</span></div><div class="line"><a name="l00597"></a><span class="lineno"> 597</span>&#160; <span class="comment">// sum(demands[i] * actives[i] if times[i] &lt;= t) in [min_level, max_level]</span></div><div class="line"><a name="l00598"></a><span class="lineno"> 598</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00599"></a><span class="lineno"> 599</span>&#160; <span class="comment">// It returns a ReservoirConstraint that allows adding optional and non</span></div><div class="line"><a name="l00600"></a><span class="lineno"> 600</span>&#160; <span class="comment">// optional events incrementally after construction.</span></div><div class="line"><a name="l00601"></a><span class="lineno"> 601</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1ReservoirConstraint.html">ReservoirConstraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a5d2c35d16d6b9cb25254ca6d3b963ac8">AddReservoirConstraint</a>(int64 min_level, int64 max_level);</div><div class="line"><a name="l00602"></a><span class="lineno"> 602</span>&#160;</div><div class="line"><a name="l00603"></a><span class="lineno"> 603</span>&#160; <span class="comment">// An automaton constraint takes a list of variables (of size n), an initial</span></div><div class="line"><a name="l00604"></a><span class="lineno"> 604</span>&#160; <span class="comment">// state, a set of final states, and a set of transitions. A transition is a</span></div><div class="line"><a name="l00605"></a><span class="lineno"> 605</span>&#160; <span class="comment">// triplet (&#39;tail&#39;, &#39;head&#39;, &#39;label&#39;), where &#39;tail&#39; and &#39;head&#39; are states,</span></div><div class="line"><a name="l00606"></a><span class="lineno"> 606</span>&#160; <span class="comment">// and &#39;label&#39; is the label of an arc from &#39;head&#39; to &#39;tail&#39;,</span></div><div class="line"><a name="l00607"></a><span class="lineno"> 607</span>&#160; <span class="comment">// corresponding to the value of one variable in the list of variables.</span></div><div class="line"><a name="l00608"></a><span class="lineno"> 608</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00609"></a><span class="lineno"> 609</span>&#160; <span class="comment">// This automaton will be unrolled into a flow with n + 1 phases. Each phase</span></div><div class="line"><a name="l00610"></a><span class="lineno"> 610</span>&#160; <span class="comment">// contains the possible states of the automaton. The first state contains the</span></div><div class="line"><a name="l00611"></a><span class="lineno"> 611</span>&#160; <span class="comment">// initial state. The last phase contains the final states.</span></div><div class="line"><a name="l00612"></a><span class="lineno"> 612</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00613"></a><span class="lineno"> 613</span>&#160; <span class="comment">// Between two consecutive phases i and i + 1, the automaton creates a set of</span></div><div class="line"><a name="l00614"></a><span class="lineno"> 614</span>&#160; <span class="comment">// arcs. For each transition (tail, head, label), it will add an arc from</span></div><div class="line"><a name="l00615"></a><span class="lineno"> 615</span>&#160; <span class="comment">// the state &#39;tail&#39; of phase i and the state &#39;head&#39; of phase i + 1. This arc</span></div><div class="line"><a name="l00616"></a><span class="lineno"> 616</span>&#160; <span class="comment">// labeled by the value &#39;label&#39; of the variables &#39;variables[i]&#39;. That is,</span></div><div class="line"><a name="l00617"></a><span class="lineno"> 617</span>&#160; <span class="comment">// this arc can only be selected if &#39;variables[i]&#39; is assigned the value</span></div><div class="line"><a name="l00618"></a><span class="lineno"> 618</span>&#160; <span class="comment">// &#39;label&#39;. A feasible solution of this constraint is an assignment of</span></div><div class="line"><a name="l00619"></a><span class="lineno"> 619</span>&#160; <span class="comment">// variables such that, starting from the initial state in phase 0, there is a</span></div><div class="line"><a name="l00620"></a><span class="lineno"> 620</span>&#160; <span class="comment">// path labeled by the values of the variables that ends in one of the final</span></div><div class="line"><a name="l00621"></a><span class="lineno"> 621</span>&#160; <span class="comment">// states in the final phase.</span></div><div class="line"><a name="l00622"></a><span class="lineno"> 622</span>&#160; <span class="comment">//</span></div><div class="line"><a name="l00623"></a><span class="lineno"> 623</span>&#160; <span class="comment">// It returns an AutomatonConstraint that allows adding transition</span></div><div class="line"><a name="l00624"></a><span class="lineno"> 624</span>&#160; <span class="comment">// incrementally after construction.</span></div><div class="line"><a name="l00625"></a><span class="lineno"> 625</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1AutomatonConstraint.html">AutomatonConstraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a5738c98c07c2e0ec747877eb3813a134">AddAutomaton</a>(</div><div class="line"><a name="l00626"></a><span class="lineno"> 626</span>&#160; absl::Span&lt;const IntVar&gt; transition_variables, <span class="keywordtype">int</span> starting_state,</div><div class="line"><a name="l00627"></a><span class="lineno"> 627</span>&#160; absl::Span&lt;const int&gt; final_states);</div><div class="line"><a name="l00628"></a><span class="lineno"> 628</span>&#160;</div><div class="line"><a name="l00629"></a><span class="lineno"> 629</span>&#160; <span class="comment">// Adds target == min(vars).</span></div><div class="line"><a name="l00630"></a><span class="lineno"> 630</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a967f11af5e1cfb143514e09925628be5">AddMinEquality</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> target, absl::Span&lt;const IntVar&gt; vars);</div><div class="line"><a name="l00631"></a><span class="lineno"> 631</span>&#160;</div><div class="line"><a name="l00632"></a><span class="lineno"> 632</span>&#160; <span class="comment">// Adds target == max(vars).</span></div><div class="line"><a name="l00633"></a><span class="lineno"> 633</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a902eb5d208511f7da9cdd9cde9a79c45">AddMaxEquality</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> target, absl::Span&lt;const IntVar&gt; vars);</div><div class="line"><a name="l00634"></a><span class="lineno"> 634</span>&#160;</div><div class="line"><a name="l00635"></a><span class="lineno"> 635</span>&#160; <span class="comment">// Adds target = num / denom (integer division rounded towards 0).</span></div><div class="line"><a name="l00636"></a><span class="lineno"> 636</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#adffb8e57735762a6f321279f2e60ae65">AddDivisionEquality</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> target, <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> numerator,</div><div class="line"><a name="l00637"></a><span class="lineno"> 637</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> denominator);</div><div class="line"><a name="l00638"></a><span class="lineno"> 638</span>&#160;</div><div class="line"><a name="l00639"></a><span class="lineno"> 639</span>&#160; <span class="comment">// Adds target == abs(var).</span></div><div class="line"><a name="l00640"></a><span class="lineno"> 640</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#aa1eae45130c127fe6cac9805736216ef">AddAbsEquality</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> target, <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> var);</div><div class="line"><a name="l00641"></a><span class="lineno"> 641</span>&#160;</div><div class="line"><a name="l00642"></a><span class="lineno"> 642</span>&#160; <span class="comment">// Adds target = var % mod.</span></div><div class="line"><a name="l00643"></a><span class="lineno"> 643</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#abd73201c6fbc455ca4783ff99ca2eed1">AddModuloEquality</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> target, <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> var, <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> mod);</div><div class="line"><a name="l00644"></a><span class="lineno"> 644</span>&#160;</div><div class="line"><a name="l00645"></a><span class="lineno"> 645</span>&#160; <span class="comment">// Adds target == prod(vars).</span></div><div class="line"><a name="l00646"></a><span class="lineno"> 646</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a991b6a2a16def3962ccc5727004638db">AddProductEquality</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> target, absl::Span&lt;const IntVar&gt; vars);</div><div class="line"><a name="l00647"></a><span class="lineno"> 647</span>&#160;</div><div class="line"><a name="l00648"></a><span class="lineno"> 648</span>&#160; <span class="comment">// Adds a constraint than ensures that all present intervals do not overlap</span></div><div class="line"><a name="l00649"></a><span class="lineno"> 649</span>&#160; <span class="comment">// in time.</span></div><div class="line"><a name="l00650"></a><span class="lineno"> 650</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1Constraint.html">Constraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a89c4590eaf404f0ef3b80d4ce584fbda">AddNoOverlap</a>(absl::Span&lt;const IntervalVar&gt; vars);</div><div class="line"><a name="l00651"></a><span class="lineno"> 651</span>&#160;</div><div class="line"><a name="l00652"></a><span class="lineno"> 652</span>&#160; <span class="comment">// The no_overlap_2d constraint prevents a set of boxes from overlapping.</span></div><div class="line"><a name="l00653"></a><span class="lineno"> 653</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1NoOverlap2DConstraint.html">NoOverlap2DConstraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a10d61bc6bc9584cadfc0b87537ada9eb">AddNoOverlap2D</a>();</div><div class="line"><a name="l00654"></a><span class="lineno"> 654</span>&#160;</div><div class="line"><a name="l00655"></a><span class="lineno"> 655</span>&#160; <span class="comment">// The cumulative constraint ensures that for any integer point, the sum of</span></div><div class="line"><a name="l00656"></a><span class="lineno"> 656</span>&#160; <span class="comment">// the demands of the intervals containing that point does not exceed the</span></div><div class="line"><a name="l00657"></a><span class="lineno"> 657</span>&#160; <span class="comment">// capacity.</span></div><div class="line"><a name="l00658"></a><span class="lineno"> 658</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1CumulativeConstraint.html">CumulativeConstraint</a> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a6620906cabb980393d9433df9a7f7b70">AddCumulative</a>(<a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> capacity);</div><div class="line"><a name="l00659"></a><span class="lineno"> 659</span>&#160;</div><div class="line"><a name="l00660"></a><span class="lineno"> 660</span>&#160; <span class="comment">// Adds a linear minimization objective.</span></div><div class="line"><a name="l00661"></a><span class="lineno"> 661</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a0faf578c69fe9ae80ee0ea9f671dc5e7">Minimize</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; expr);</div><div class="line"><a name="l00662"></a><span class="lineno"> 662</span>&#160;</div><div class="line"><a name="l00663"></a><span class="lineno"> 663</span>&#160; <span class="comment">// Adds a linear maximization objective.</span></div><div class="line"><a name="l00664"></a><span class="lineno"> 664</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a3559ac1f9f840b2d5637f1d26cd18f0b">Maximize</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; expr);</div><div class="line"><a name="l00665"></a><span class="lineno"> 665</span>&#160;</div><div class="line"><a name="l00666"></a><span class="lineno"> 666</span>&#160; <span class="comment">// Sets scaling of the objective. (must be called after Minimize() of</span></div><div class="line"><a name="l00667"></a><span class="lineno"> 667</span>&#160; <span class="comment">// Maximize()). &#39;scaling&#39; must be &gt; 0.0.</span></div><div class="line"><a name="l00668"></a><span class="lineno"> 668</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#ac93a7c7467278afb9eac2bb4a8dec6d3">ScaleObjectiveBy</a>(<span class="keywordtype">double</span> scaling);</div><div class="line"><a name="l00669"></a><span class="lineno"> 669</span>&#160;</div><div class="line"><a name="l00670"></a><span class="lineno"> 670</span>&#160; <span class="comment">// Adds a decision strategy on a list of integer variables.</span></div><div class="line"><a name="l00671"></a><span class="lineno"> 671</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a4d0cfb231f4bed2420d0aff928f3a980">AddDecisionStrategy</a>(</div><div class="line"><a name="l00672"></a><span class="lineno"> 672</span>&#160; absl::Span&lt;const IntVar&gt; variables,</div><div class="line"><a name="l00673"></a><span class="lineno"> 673</span>&#160; <a class="code" href="namespaceoperations__research_1_1sat.html#ac0ca8810a97bcc1b3d45269a33fd4f0c">DecisionStrategyProto::VariableSelectionStrategy</a> var_strategy,</div><div class="line"><a name="l00674"></a><span class="lineno"> 674</span>&#160; <a class="code" href="namespaceoperations__research_1_1sat.html#a20ead57ac0739497ea66f0c21b23b529">DecisionStrategyProto::DomainReductionStrategy</a> domain_strategy);</div><div class="line"><a name="l00675"></a><span class="lineno"> 675</span>&#160;</div><div class="line"><a name="l00676"></a><span class="lineno"> 676</span>&#160; <span class="comment">// Adds a decision strategy on a list of boolean variables.</span></div><div class="line"><a name="l00677"></a><span class="lineno"> 677</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a4d0cfb231f4bed2420d0aff928f3a980">AddDecisionStrategy</a>(</div><div class="line"><a name="l00678"></a><span class="lineno"> 678</span>&#160; absl::Span&lt;const BoolVar&gt; variables,</div><div class="line"><a name="l00679"></a><span class="lineno"> 679</span>&#160; <a class="code" href="namespaceoperations__research_1_1sat.html#ac0ca8810a97bcc1b3d45269a33fd4f0c">DecisionStrategyProto::VariableSelectionStrategy</a> var_strategy,</div><div class="line"><a name="l00680"></a><span class="lineno"> 680</span>&#160; <a class="code" href="namespaceoperations__research_1_1sat.html#a20ead57ac0739497ea66f0c21b23b529">DecisionStrategyProto::DomainReductionStrategy</a> domain_strategy);</div><div class="line"><a name="l00681"></a><span class="lineno"> 681</span>&#160;</div><div class="line"><a name="l00682"></a><span class="lineno"> 682</span>&#160; <span class="comment">// TODO(user) : add MapDomain?</span></div><div class="line"><a name="l00683"></a><span class="lineno"> 683</span>&#160;</div><div class="line"><a name="l00684"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a8e1b64644f124be491431bbae9d5d843"> 684</a></span>&#160; <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html">CpModelProto</a>&amp; <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a8e1b64644f124be491431bbae9d5d843">Build</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a791f54d4afefc05d6462fa9a9f1f304d">Proto</a>(); }</div><div class="line"><a name="l00685"></a><span class="lineno"> 685</span>&#160;</div><div class="line"><a name="l00686"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a791f54d4afefc05d6462fa9a9f1f304d"> 686</a></span>&#160; <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html">CpModelProto</a>&amp; <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a791f54d4afefc05d6462fa9a9f1f304d">Proto</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> cp_model_; }</div><div class="line"><a name="l00687"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a4b3320604b4344b5bea17c5fae1ed7ce"> 687</a></span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html">CpModelProto</a>* <a class="code" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a4b3320604b4344b5bea17c5fae1ed7ce">MutableProto</a>() { <span class="keywordflow">return</span> &amp;cp_model_; }</div><div class="line"><a name="l00688"></a><span class="lineno"> 688</span>&#160;</div><div class="line"><a name="l00689"></a><span class="lineno"> 689</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00690"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a9d31ad87d4edee55fc3cb5e239077720"> 690</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1CumulativeConstraint.html">CumulativeConstraint</a>;</div><div class="line"><a name="l00691"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1CpModelBuilder.html#ae0ff478f6506cb705bbc1737598276f4"> 691</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1ReservoirConstraint.html">ReservoirConstraint</a>;</div><div class="line"><a name="l00692"></a><span class="lineno"> 692</span>&#160;</div><div class="line"><a name="l00693"></a><span class="lineno"> 693</span>&#160; <span class="comment">// Returns a (cached) integer variable index with a constant value.</span></div><div class="line"><a name="l00694"></a><span class="lineno"> 694</span>&#160; <span class="keywordtype">int</span> IndexFromConstant(int64 value);</div><div class="line"><a name="l00695"></a><span class="lineno"> 695</span>&#160;</div><div class="line"><a name="l00696"></a><span class="lineno"> 696</span>&#160; <span class="comment">// Returns a valid integer index from a BoolVar index.</span></div><div class="line"><a name="l00697"></a><span class="lineno"> 697</span>&#160; <span class="comment">// If the input index is a positive, it returns this index.</span></div><div class="line"><a name="l00698"></a><span class="lineno"> 698</span>&#160; <span class="comment">// If the input index is negative, it creates a cached IntVar equal to</span></div><div class="line"><a name="l00699"></a><span class="lineno"> 699</span>&#160; <span class="comment">// 1 - BoolVar(PositiveRef(index)), and returns the index of this new</span></div><div class="line"><a name="l00700"></a><span class="lineno"> 700</span>&#160; <span class="comment">// variable.</span></div><div class="line"><a name="l00701"></a><span class="lineno"> 701</span>&#160; <span class="keywordtype">int</span> GetOrCreateIntegerIndex(<span class="keywordtype">int</span> index);</div><div class="line"><a name="l00702"></a><span class="lineno"> 702</span>&#160;</div><div class="line"><a name="l00703"></a><span class="lineno"> 703</span>&#160; <span class="keywordtype">void</span> FillLinearTerms(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; left, <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; right,</div><div class="line"><a name="l00704"></a><span class="lineno"> 704</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1LinearConstraintProto.html">LinearConstraintProto</a>* proto);</div><div class="line"><a name="l00705"></a><span class="lineno"> 705</span>&#160;</div><div class="line"><a name="l00706"></a><span class="lineno"> 706</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1CpModelProto.html">CpModelProto</a> cp_model_;</div><div class="line"><a name="l00707"></a><span class="lineno"> 707</span>&#160; absl::flat_hash_map&lt;int64, int&gt; constant_to_index_map_;</div><div class="line"><a name="l00708"></a><span class="lineno"> 708</span>&#160; absl::flat_hash_map&lt;int, int&gt; bool_to_integer_index_map_;</div><div class="line"><a name="l00709"></a><span class="lineno"> 709</span>&#160;};</div><div class="line"><a name="l00710"></a><span class="lineno"> 710</span>&#160;</div><div class="line"><a name="l00711"></a><span class="lineno"> 711</span>&#160;<span class="comment">// Evaluates the value of an linear expression in a solver response.</span></div><div class="line"><a name="l00712"></a><span class="lineno"> 712</span>&#160;int64 <a class="code" href="namespaceoperations__research_1_1sat.html#aeaed9bdf2a27bb778ba397666cb874d7">SolutionIntegerValue</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1CpSolverResponse.html">CpSolverResponse</a>&amp; r, <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1LinearExpr.html">LinearExpr</a>&amp; expr);</div><div class="line"><a name="l00713"></a><span class="lineno"> 713</span>&#160;</div><div class="line"><a name="l00714"></a><span class="lineno"> 714</span>&#160;<span class="comment">// Returns the min of an integer variable in a solution.</span></div><div class="line"><a name="l00715"></a><span class="lineno"> 715</span>&#160;int64 <a class="code" href="namespaceoperations__research_1_1sat.html#a671200a31003492dbef21f2b4ee3dcbd">SolutionIntegerMin</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1CpSolverResponse.html">CpSolverResponse</a>&amp; r, <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> x);</div><div class="line"><a name="l00716"></a><span class="lineno"> 716</span>&#160;</div><div class="line"><a name="l00717"></a><span class="lineno"> 717</span>&#160;<span class="comment">// Returns the max of an integer variable in a solution.</span></div><div class="line"><a name="l00718"></a><span class="lineno"> 718</span>&#160;int64 <a class="code" href="namespaceoperations__research_1_1sat.html#a8ec893fa736de5b95135ecb9314ee6d8">SolutionIntegerMax</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1CpSolverResponse.html">CpSolverResponse</a>&amp; r, <a class="code" href="classoperations__research_1_1sat_1_1IntVar.html">IntVar</a> x);</div><div class="line"><a name="l00719"></a><span class="lineno"> 719</span>&#160;</div><div class="line"><a name="l00720"></a><span class="lineno"> 720</span>&#160;<span class="comment">// Returns the value of a Boolean literal (a Boolean variable or its negation)</span></div><div class="line"><a name="l00721"></a><span class="lineno"> 721</span>&#160;<span class="comment">// in a solver response.</span></div><div class="line"><a name="l00722"></a><span class="lineno"> 722</span>&#160;<span class="keywordtype">bool</span> <a class="code" href="namespaceoperations__research_1_1sat.html#afa415e372a9d64eede869ed98666c29c">SolutionBooleanValue</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1CpSolverResponse.html">CpSolverResponse</a>&amp; r, <a class="code" href="classoperations__research_1_1sat_1_1BoolVar.html">BoolVar</a> x);</div><div class="line"><a name="l00723"></a><span class="lineno"> 723</span>&#160;</div><div class="line"><a name="l00724"></a><span class="lineno"> 724</span>&#160;} <span class="comment">// namespace sat</span></div><div class="line"><a name="l00725"></a><span class="lineno"> 725</span>&#160;} <span class="comment">// namespace operations_research</span></div><div class="line"><a name="l00726"></a><span class="lineno"> 726</span>&#160;</div><div class="line"><a name="l00727"></a><span class="lineno"> 727</span>&#160;<span class="preprocessor">#endif // OR_TOOLS_SAT_CP_MODEL_H_</span></div><div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a5d2c35d16d6b9cb25254ca6d3b963ac8"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a5d2c35d16d6b9cb25254ca6d3b963ac8">operations_research::sat::CpModelBuilder::AddReservoirConstraint</a></div><div class="ttdeci">ReservoirConstraint AddReservoirConstraint(int64 min_level, int64 max_level)</div><div class="ttdoc">Adds a reservoir constraint with optional refill/emptying events.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_acf4c5429ec08207e147b65bd1330ba92"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#acf4c5429ec08207e147b65bd1330ba92">operations_research::sat::CpModelBuilder::AddGreaterThan</a></div><div class="ttdeci">Constraint AddGreaterThan(const LinearExpr &amp;left, const LinearExpr &amp;right)</div><div class="ttdoc">Adds left &gt; right.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a0887a2fe4518bde7bbde18f592b6243f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a0887a2fe4518bde7bbde18f592b6243f">operations_research::sat::CpModelBuilder::NewIntVar</a></div><div class="ttdeci">IntVar NewIntVar(const Domain &amp;domain)</div><div class="ttdoc">Creates an integer variable with the given domain.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_ae8bd984917b305dc49abae6c19b69ea3"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#ae8bd984917b305dc49abae6c19b69ea3">operations_research::sat::CpModelBuilder::AddBoolOr</a></div><div class="ttdeci">Constraint AddBoolOr(absl::Span&lt; const BoolVar &gt; literals)</div><div class="ttdoc">Adds the constraint that at least one of the literals must be true.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a3559ac1f9f840b2d5637f1d26cd18f0b"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a3559ac1f9f840b2d5637f1d26cd18f0b">operations_research::sat::CpModelBuilder::Maximize</a></div><div class="ttdeci">void Maximize(const LinearExpr &amp;expr)</div><div class="ttdoc">Adds a linear maximization objective.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1AutomatonConstraint_html_a4fa8634eeba27c91397c58105ff50eb7"><div class="ttname"><a href="classoperations__research_1_1sat_1_1AutomatonConstraint.html#a4fa8634eeba27c91397c58105ff50eb7">operations_research::sat::AutomatonConstraint::AddTransition</a></div><div class="ttdeci">void AddTransition(int tail, int head, int64 transition_label)</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1BoolVar_html_afb7fdd0dab72ba28030fb6d03ce5c32f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1BoolVar.html#afb7fdd0dab72ba28030fb6d03ce5c32f">operations_research::sat::BoolVar::operator==</a></div><div class="ttdeci">bool operator==(const BoolVar &amp;other) const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00071">cp_model.h:71</a></div></div>
<div class="ttc" id="namespaceoperations__research_1_1sat_html_a9c0ae0d048a431656985fc79428bbe67"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a9c0ae0d048a431656985fc79428bbe67">operations_research::sat::operator&lt;&lt;</a></div><div class="ttdeci">std::ostream &amp; operator&lt;&lt;(std::ostream &amp;os, const BoolVar &amp;var)</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1Constraint_html_a9401ab195650160402df5b61f8ac9bda"><div class="ttname"><a href="classoperations__research_1_1sat_1_1Constraint.html#a9401ab195650160402df5b61f8ac9bda">operations_research::sat::Constraint::WithName</a></div><div class="ttdeci">Constraint WithName(const std::string &amp;name)</div><div class="ttdoc">Sets the name of the constraint.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1LinearExpr_html_af5805ba35a6efa9460c5d8eab8301172"><div class="ttname"><a href="classoperations__research_1_1sat_1_1LinearExpr.html#af5805ba35a6efa9460c5d8eab8301172">operations_research::sat::LinearExpr::variables</a></div><div class="ttdeci">const std::vector&lt; IntVar &gt; &amp; variables() const</div><div class="ttdoc">Useful for testing.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00246">cp_model.h:246</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1Constraint_html_aa0b277df64333f670b66c8d5295b8250"><div class="ttname"><a href="classoperations__research_1_1sat_1_1Constraint.html#aa0b277df64333f670b66c8d5295b8250">operations_research::sat::Constraint::Proto</a></div><div class="ttdeci">const ConstraintProto &amp; Proto() const</div><div class="ttdoc">Useful for testing.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00367">cp_model.h:367</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntegerVariableProto_html_a5ae2400b8a1bbf76d789a2dfd6dcfcee"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntegerVariableProto.html#a5ae2400b8a1bbf76d789a2dfd6dcfcee">operations_research::sat::IntegerVariableProto::name</a></div><div class="ttdeci">const std::string &amp; name() const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8pb_8h_source.html#l04475">cp_model.pb.h:4475</a></div></div>
<div class="ttc" id="cp__model__solver_8h_html"><div class="ttname"><a href="cp__model__solver_8h.html">cp_model_solver.h</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CumulativeConstraint_html_aded0689c7c92b1a7739758150131b531"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CumulativeConstraint.html#aded0689c7c92b1a7739758150131b531">operations_research::sat::CumulativeConstraint::AddDemand</a></div><div class="ttdeci">void AddDemand(IntervalVar interval, IntVar demand)</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1ReservoirConstraint_html_aad9028f0c33c7d4799891b9f742148b6"><div class="ttname"><a href="classoperations__research_1_1sat_1_1ReservoirConstraint.html#aad9028f0c33c7d4799891b9f742148b6">operations_research::sat::ReservoirConstraint::AddOptionalEvent</a></div><div class="ttdeci">void AddOptionalEvent(IntVar time, int64 demand, BoolVar is_active)</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a43ca3f9c073ea5078c1abd3bb0c563d4"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a43ca3f9c073ea5078c1abd3bb0c563d4">operations_research::sat::CpModelBuilder::AddImplication</a></div><div class="ttdeci">Constraint AddImplication(BoolVar a, BoolVar b)</div><div class="ttdoc">Adds a =&gt; b.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00507">cp_model.h:507</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1Constraint_html_acaa17b2fbfd62f6845329ae944835654"><div class="ttname"><a href="classoperations__research_1_1sat_1_1Constraint.html#acaa17b2fbfd62f6845329ae944835654">operations_research::sat::Constraint::MutableProto</a></div><div class="ttdeci">ConstraintProto * MutableProto() const</div><div class="ttdoc">Useful for model edition.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00370">cp_model.h:370</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1NoOverlap2DConstraint_html_a7e76dae6971e2f38651b7eb8411ebe63"><div class="ttname"><a href="classoperations__research_1_1sat_1_1NoOverlap2DConstraint.html#a7e76dae6971e2f38651b7eb8411ebe63">operations_research::sat::NoOverlap2DConstraint::AddRectangle</a></div><div class="ttdeci">void AddRectangle(IntervalVar x_coordinate, IntervalVar y_coordinate)</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a562a899753d60f28ae87ecb93e96b797"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a562a899753d60f28ae87ecb93e96b797">operations_research::sat::CpModelBuilder::AddLinearConstraint</a></div><div class="ttdeci">Constraint AddLinearConstraint(const LinearExpr &amp;expr, const Domain &amp;domain)</div><div class="ttdoc">Adds expr in domain.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalVar_html_a106c293c6b0cac8589bc6b5b4ff0446c"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalVar.html#a106c293c6b0cac8589bc6b5b4ff0446c">operations_research::sat::IntervalVar::IntervalVar</a></div><div class="ttdeci">IntervalVar()</div><div class="ttdoc">Default ctor.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1Constraint_html_a9a6b9b664d4d0d56e8c0d14c8ad3bad9"><div class="ttname"><a href="classoperations__research_1_1sat_1_1Constraint.html#a9a6b9b664d4d0d56e8c0d14c8ad3bad9">operations_research::sat::Constraint::Constraint</a></div><div class="ttdeci">Constraint(ConstraintProto *proto)</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntegerVariableProto_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntegerVariableProto.html">operations_research::sat::IntegerVariableProto</a></div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8pb_8h_source.html#l00249">cp_model.pb.h:249</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a967f11af5e1cfb143514e09925628be5"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a967f11af5e1cfb143514e09925628be5">operations_research::sat::CpModelBuilder::AddMinEquality</a></div><div class="ttdeci">Constraint AddMinEquality(IntVar target, absl::Span&lt; const IntVar &gt; vars)</div><div class="ttdoc">Adds target == min(vars).</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalVar_html_a6228ce653636516ab2b2f760aa61a57e"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalVar.html#a6228ce653636516ab2b2f760aa61a57e">operations_research::sat::IntervalVar::StartVar</a></div><div class="ttdeci">IntVar StartVar() const</div><div class="ttdoc">Returns the start variable.</div></div>
<div class="ttc" id="namespaceoperations__research_1_1sat_html_a671200a31003492dbef21f2b4ee3dcbd"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a671200a31003492dbef21f2b4ee3dcbd">operations_research::sat::SolutionIntegerMin</a></div><div class="ttdeci">int64 SolutionIntegerMin(const CpSolverResponse &amp;r, IntVar x)</div><div class="ttdoc">Returns the min of an integer variable in a solution.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_abd73201c6fbc455ca4783ff99ca2eed1"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#abd73201c6fbc455ca4783ff99ca2eed1">operations_research::sat::CpModelBuilder::AddModuloEquality</a></div><div class="ttdeci">Constraint AddModuloEquality(IntVar target, IntVar var, IntVar mod)</div><div class="ttdoc">Adds target = var % mod.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html">operations_research::sat::CpModelBuilder</a></div><div class="ttdoc">Wrapper class around the cp_model proto.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00473">cp_model.h:473</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalVar_html_ac86513192443e57e505b8e8c9ffb77f2"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalVar.html#ac86513192443e57e505b8e8c9ffb77f2">operations_research::sat::IntervalVar::EndVar</a></div><div class="ttdeci">IntVar EndVar() const</div><div class="ttdoc">Returns the end variable.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalVar_html_a4d10907c6da83ee20c29312f1064361f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalVar.html#a4d10907c6da83ee20c29312f1064361f">operations_research::sat::IntervalVar::MutableProto</a></div><div class="ttdeci">IntervalConstraintProto * MutableProto() const</div><div class="ttdoc">Useful for model edition.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00314">cp_model.h:314</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a0c391768bc423a43875a7867ee247a4b"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a0c391768bc423a43875a7867ee247a4b">operations_research::sat::CpModelBuilder::AddInverseConstraint</a></div><div class="ttdeci">Constraint AddInverseConstraint(absl::Span&lt; const IntVar &gt; variables, absl::Span&lt; const IntVar &gt; inverse_variables)</div><div class="ttdoc">An inverse constraint enforces that if 'variables[i]' is assigned a value 'j', then inverse_variables...</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1ReservoirConstraint_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1ReservoirConstraint.html">operations_research::sat::ReservoirConstraint</a></div><div class="ttdoc">Specialized reservoir constraint.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00411">cp_model.h:411</a></div></div>
<div class="ttc" id="model_8h_html"><div class="ttname"><a href="model_8h.html">model.h</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1ConstraintProto_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1ConstraintProto.html">operations_research::sat::ConstraintProto</a></div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8pb_8h_source.html#l02862">cp_model.pb.h:2862</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntVar_html_a47cdd55b99ca5d29b194f54b14889819"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntVar.html#a47cdd55b99ca5d29b194f54b14889819">operations_research::sat::IntVar::IntVar</a></div><div class="ttdeci">IntVar()</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a791f54d4afefc05d6462fa9a9f1f304d"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a791f54d4afefc05d6462fa9a9f1f304d">operations_research::sat::CpModelBuilder::Proto</a></div><div class="ttdeci">const CpModelProto &amp; Proto() const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00686">cp_model.h:686</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1LinearExpr_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1LinearExpr.html">operations_research::sat::LinearExpr</a></div><div class="ttdoc">A dedicated container for linear expressions.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00208">cp_model.h:208</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1LinearExpr_html_a050775df6d69660af8f78d577fd327cc"><div class="ttname"><a href="classoperations__research_1_1sat_1_1LinearExpr.html#a050775df6d69660af8f78d577fd327cc">operations_research::sat::LinearExpr::constant</a></div><div class="ttdeci">int64 constant() const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00248">cp_model.h:248</a></div></div>
<div class="ttc" id="namespaceoperations__research_1_1sat_html_a8ec893fa736de5b95135ecb9314ee6d8"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a8ec893fa736de5b95135ecb9314ee6d8">operations_research::sat::SolutionIntegerMax</a></div><div class="ttdeci">int64 SolutionIntegerMax(const CpSolverResponse &amp;r, IntVar x)</div><div class="ttdoc">Returns the max of an integer variable in a solution.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a4d0cfb231f4bed2420d0aff928f3a980"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a4d0cfb231f4bed2420d0aff928f3a980">operations_research::sat::CpModelBuilder::AddDecisionStrategy</a></div><div class="ttdeci">void AddDecisionStrategy(absl::Span&lt; const IntVar &gt; variables, DecisionStrategyProto::VariableSelectionStrategy var_strategy, DecisionStrategyProto::DomainReductionStrategy domain_strategy)</div><div class="ttdoc">Adds a decision strategy on a list of integer variables.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1LinearExpr_html_a74026647307b38916135e8c3dad3421f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1LinearExpr.html#a74026647307b38916135e8c3dad3421f">operations_research::sat::LinearExpr::Sum</a></div><div class="ttdeci">static LinearExpr Sum(absl::Span&lt; const IntVar &gt; vars)</div><div class="ttdoc">Constructs the sum of a list of variables.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_ad5ec615a9107ebcb8a7516bb3ccfbcd2"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#ad5ec615a9107ebcb8a7516bb3ccfbcd2">operations_research::sat::CpModelBuilder::AddCircuitConstraint</a></div><div class="ttdeci">CircuitConstraint AddCircuitConstraint()</div><div class="ttdoc">Adds a circuit constraint.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a3088d984ab4874140f7c367dc457ac0f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a3088d984ab4874140f7c367dc457ac0f">operations_research::sat::CpModelBuilder::AddBoolAnd</a></div><div class="ttdeci">Constraint AddBoolAnd(absl::Span&lt; const BoolVar &gt; literals)</div><div class="ttdoc">Adds the constraint that all literals must be true.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a8fc4a0c717f985687d63a586dba04641"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a8fc4a0c717f985687d63a586dba04641">operations_research::sat::CpModelBuilder::NewBoolVar</a></div><div class="ttdeci">BoolVar NewBoolVar()</div><div class="ttdoc">Creates a Boolean variable.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a9a53531099bebddbf54dd15418817326"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a9a53531099bebddbf54dd15418817326">operations_research::sat::CpModelBuilder::FalseVar</a></div><div class="ttdeci">BoolVar FalseVar()</div><div class="ttdoc">Creates an always false Boolean variable.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1BoolVar_html_a8391a20c25890ccbf3f5e3982afed236"><div class="ttname"><a href="classoperations__research_1_1sat_1_1BoolVar.html#a8391a20c25890ccbf3f5e3982afed236">operations_research::sat::BoolVar::SolutionBooleanValue</a></div><div class="ttdeci">friend bool SolutionBooleanValue(const CpSolverResponse &amp;r, BoolVar x)</div><div class="ttdoc">Returns the value of a Boolean literal (a Boolean variable or its negation) in a solver response.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a902eb5d208511f7da9cdd9cde9a79c45"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a902eb5d208511f7da9cdd9cde9a79c45">operations_research::sat::CpModelBuilder::AddMaxEquality</a></div><div class="ttdeci">Constraint AddMaxEquality(IntVar target, absl::Span&lt; const IntVar &gt; vars)</div><div class="ttdoc">Adds target == max(vars).</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a6620906cabb980393d9433df9a7f7b70"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a6620906cabb980393d9433df9a7f7b70">operations_research::sat::CpModelBuilder::AddCumulative</a></div><div class="ttdeci">CumulativeConstraint AddCumulative(IntVar capacity)</div><div class="ttdoc">The cumulative constraint ensures that for any integer point, the sum of the demands of the intervals...</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_adffb8e57735762a6f321279f2e60ae65"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#adffb8e57735762a6f321279f2e60ae65">operations_research::sat::CpModelBuilder::AddDivisionEquality</a></div><div class="ttdeci">Constraint AddDivisionEquality(IntVar target, IntVar numerator, IntVar denominator)</div><div class="ttdoc">Adds target = num / denom (integer division rounded towards 0).</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalVar_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalVar.html">operations_research::sat::IntervalVar</a></div><div class="ttdoc">Represents a Interval variable.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00275">cp_model.h:275</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalVar_html_a34c3fc0d93697326a7e398cd45b1374d"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalVar.html#a34c3fc0d93697326a7e398cd45b1374d">operations_research::sat::IntervalVar::Proto</a></div><div class="ttdeci">const IntervalConstraintProto &amp; Proto() const</div><div class="ttdoc">Useful for testing.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00309">cp_model.h:309</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntVar_html_a5f1761c6d2c5f7908f5f92bb16b91de9"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntVar.html#a5f1761c6d2c5f7908f5f92bb16b91de9">operations_research::sat::IntVar::WithName</a></div><div class="ttdeci">IntVar WithName(const std::string &amp;name)</div><div class="ttdoc">Sets the name of the variable.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1BoolVar_html_a1963637fcd9bfe8f9bd85a0971c0270d"><div class="ttname"><a href="classoperations__research_1_1sat_1_1BoolVar.html#a1963637fcd9bfe8f9bd85a0971c0270d">operations_research::sat::BoolVar::WithName</a></div><div class="ttdeci">BoolVar WithName(const std::string &amp;name)</div><div class="ttdoc">Sets the name of the variable.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1ReservoirConstraint_html_aff0e9a5c156c176def60cf2985919bd6"><div class="ttname"><a href="classoperations__research_1_1sat_1_1ReservoirConstraint.html#aff0e9a5c156c176def60cf2985919bd6">operations_research::sat::ReservoirConstraint::AddEvent</a></div><div class="ttdeci">void AddEvent(IntVar time, int64 demand)</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a7a718730caef4f258e1cbbb2e3e3b452"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a7a718730caef4f258e1cbbb2e3e3b452">operations_research::sat::CpModelBuilder::AddGreaterOrEqual</a></div><div class="ttdeci">Constraint AddGreaterOrEqual(const LinearExpr &amp;left, const LinearExpr &amp;right)</div><div class="ttdoc">Adds left &gt;= right.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalVar_html_aa5cc77b54d51bda6a6c8e30907b9a917"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalVar.html#aa5cc77b54d51bda6a6c8e30907b9a917">operations_research::sat::IntervalVar::PresenceBoolVar</a></div><div class="ttdeci">BoolVar PresenceBoolVar() const</div><div class="ttdoc">Returns a BoolVar indicating the presence of this interval.</div></div>
<div class="ttc" id="namespaceoperations__research_1_1sat_html_a20ead57ac0739497ea66f0c21b23b529"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a20ead57ac0739497ea66f0c21b23b529">operations_research::sat::DecisionStrategyProto_DomainReductionStrategy</a></div><div class="ttdeci">DecisionStrategyProto_DomainReductionStrategy</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8pb_8h_source.html#l00191">cp_model.pb.h:191</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a4e1c85e161ee8e50f2f2162cd7294d03"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a4e1c85e161ee8e50f2f2162cd7294d03">operations_research::sat::CpModelBuilder::NewIntervalVar</a></div><div class="ttdeci">IntervalVar NewIntervalVar(IntVar start, IntVar size, IntVar end)</div><div class="ttdoc">Creates an interval variable.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1Constraint_html_a9d74c3d77f601020ab87700745f830ad"><div class="ttname"><a href="classoperations__research_1_1sat_1_1Constraint.html#a9d74c3d77f601020ab87700745f830ad">operations_research::sat::Constraint::proto_</a></div><div class="ttdeci">ConstraintProto * proto_</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00377">cp_model.h:377</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a99c82eca478306942b3aed3372b38384"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a99c82eca478306942b3aed3372b38384">operations_research::sat::CpModelBuilder::NewOptionalIntervalVar</a></div><div class="ttdeci">IntervalVar NewOptionalIntervalVar(IntVar start, IntVar size, IntVar end, BoolVar presence)</div><div class="ttdoc">Creates an optional interval variable.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalVar_html_ac591e644d995d2520e859ee639695754"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalVar.html#ac591e644d995d2520e859ee639695754">operations_research::sat::IntervalVar::index</a></div><div class="ttdeci">int index() const</div><div class="ttdoc">Returns the index of the interval constraint in the model.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00319">cp_model.h:319</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CumulativeConstraint_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CumulativeConstraint.html">operations_research::sat::CumulativeConstraint</a></div><div class="ttdoc">Specialized cumulative constraint.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00456">cp_model.h:456</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1LinearConstraintProto_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1LinearConstraintProto.html">operations_research::sat::LinearConstraintProto</a></div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8pb_8h_source.html#l00805">cp_model.pb.h:805</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1LinearExpr_html_ae62c3c0da3b623e5e43530c08f7bf379"><div class="ttname"><a href="classoperations__research_1_1sat_1_1LinearExpr.html#ae62c3c0da3b623e5e43530c08f7bf379">operations_research::sat::LinearExpr::BooleanScalProd</a></div><div class="ttdeci">static LinearExpr BooleanScalProd(absl::Span&lt; const BoolVar &gt; vars, absl::Span&lt; const int64 &gt; coeffs)</div><div class="ttdoc">Constructs the scalar product of Booleans and coefficients.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_ada1b4fad9b4f017f9009ce3761123a8b"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#ada1b4fad9b4f017f9009ce3761123a8b">operations_research::sat::CpModelBuilder::AddElement</a></div><div class="ttdeci">Constraint AddElement(IntVar index, absl::Span&lt; const int64 &gt; values, IntVar target)</div><div class="ttdoc">Adds the element constraint: values[index] == target.</div></div>
<div class="ttc" id="namespaceoperations__research_1_1sat_html_ac0ca8810a97bcc1b3d45269a33fd4f0c"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#ac0ca8810a97bcc1b3d45269a33fd4f0c">operations_research::sat::DecisionStrategyProto_VariableSelectionStrategy</a></div><div class="ttdeci">DecisionStrategyProto_VariableSelectionStrategy</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8pb_8h_source.html#l00163">cp_model.pb.h:163</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelProto_html_aef37b42d42f179a384a7cf514c58ba5f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelProto.html#aef37b42d42f179a384a7cf514c58ba5f">operations_research::sat::CpModelProto::constraints</a></div><div class="ttdeci">const ::operations_research::sat::ConstraintProto &amp; constraints(int index) const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8pb_8h_source.html#l07258">cp_model.pb.h:7258</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_aa1eae45130c127fe6cac9805736216ef"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#aa1eae45130c127fe6cac9805736216ef">operations_research::sat::CpModelBuilder::AddAbsEquality</a></div><div class="ttdeci">Constraint AddAbsEquality(IntVar target, IntVar var)</div><div class="ttdoc">Adds target == abs(var).</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a605cc0b904f4d9b2de5fffbf6fa40c68"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a605cc0b904f4d9b2de5fffbf6fa40c68">operations_research::sat::CpModelBuilder::AddAllDifferent</a></div><div class="ttdeci">Constraint AddAllDifferent(absl::Span&lt; const IntVar &gt; vars)</div><div class="ttdoc">this constraint forces all variables to have different values.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1BoolVar_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1BoolVar.html">operations_research::sat::BoolVar</a></div><div class="ttdoc">A Boolean variable.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00059">cp_model.h:59</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a05b1310e7cfde91fbdc10798a84a2345"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a05b1310e7cfde91fbdc10798a84a2345">operations_research::sat::CpModelBuilder::AddForbiddenAssignments</a></div><div class="ttdeci">TableConstraint AddForbiddenAssignments(absl::Span&lt; const IntVar &gt; vars)</div><div class="ttdoc">Adds an forbidden assignments constraint.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalConstraintProto_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalConstraintProto.html">operations_research::sat::IntervalConstraintProto</a></div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8pb_8h_source.html#l01115">cp_model.pb.h:1115</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1TableConstraint_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1TableConstraint.html">operations_research::sat::TableConstraint</a></div><div class="ttdoc">Specialized assignment constraint.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00397">cp_model.h:397</a></div></div>
<div class="ttc" id="namespaceoperations__research_1_1sat_html_a5e3de118c1f8dd5a7ec21704e05684b9"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a5e3de118c1f8dd5a7ec21704e05684b9">operations_research::sat::Not</a></div><div class="ttdeci">BoolVar Not(BoolVar x)</div><div class="ttdoc">A convenient wrapper so we can write Not(x) instead of x.Not() which is sometimes clearer.</div></div>
<div class="ttc" id="sorted__interval__list_8h_html"><div class="ttname"><a href="sorted__interval__list_8h.html">sorted_interval_list.h</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1BoolVar_html_a8467b4b5dffef99ffb96ef6b9b4a4097"><div class="ttname"><a href="classoperations__research_1_1sat_1_1BoolVar.html#a8467b4b5dffef99ffb96ef6b9b4a4097">operations_research::sat::BoolVar::BoolVar</a></div><div class="ttdeci">BoolVar()</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1BoolVar_html_a6e9d4868f30b80fa5c37ac8991726110"><div class="ttname"><a href="classoperations__research_1_1sat_1_1BoolVar.html#a6e9d4868f30b80fa5c37ac8991726110">operations_research::sat::BoolVar::operator!=</a></div><div class="ttdeci">bool operator!=(const BoolVar &amp;other) const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00075">cp_model.h:75</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalVar_html_a6816a7260a80aa691b7cc1e748323d21"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalVar.html#a6816a7260a80aa691b7cc1e748323d21">operations_research::sat::IntervalVar::operator!=</a></div><div class="ttdeci">bool operator!=(const IntervalVar &amp;other) const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00302">cp_model.h:302</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_ac93a7c7467278afb9eac2bb4a8dec6d3"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#ac93a7c7467278afb9eac2bb4a8dec6d3">operations_research::sat::CpModelBuilder::ScaleObjectiveBy</a></div><div class="ttdeci">void ScaleObjectiveBy(double scaling)</div><div class="ttdoc">Sets scaling of the objective.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a8e1b64644f124be491431bbae9d5d843"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a8e1b64644f124be491431bbae9d5d843">operations_research::sat::CpModelBuilder::Build</a></div><div class="ttdeci">const CpModelProto &amp; Build() const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00684">cp_model.h:684</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntVar_html_a79061f94ca7a97d0616f8b270358c771"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntVar.html#a79061f94ca7a97d0616f8b270358c771">operations_research::sat::IntVar::SolutionIntegerMax</a></div><div class="ttdeci">friend int64 SolutionIntegerMax(const CpSolverResponse &amp;r, IntVar x)</div><div class="ttdoc">Returns the max of an integer variable in a solution.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a7cf9ff9df25ff433286b4f5bda41f990"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a7cf9ff9df25ff433286b4f5bda41f990">operations_research::sat::CpModelBuilder::AddLessThan</a></div><div class="ttdeci">Constraint AddLessThan(const LinearExpr &amp;left, const LinearExpr &amp;right)</div><div class="ttdoc">Adds left &lt; right.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalVar_html_af90bf96ccc72778be5ebd9668e10d842"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalVar.html#af90bf96ccc72778be5ebd9668e10d842">operations_research::sat::IntervalVar::DebugString</a></div><div class="ttdeci">std::string DebugString() const</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1Constraint_html_aeaf30f4ee7d141e68905f1ac2432b937"><div class="ttname"><a href="classoperations__research_1_1sat_1_1Constraint.html#aeaf30f4ee7d141e68905f1ac2432b937">operations_research::sat::Constraint::Name</a></div><div class="ttdeci">const std::string &amp; Name() const</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelProto_html_a16b8cc58fa3e670712e9cfe342e61be9"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelProto.html#a16b8cc58fa3e670712e9cfe342e61be9">operations_research::sat::CpModelProto::mutable_variables</a></div><div class="ttdeci">::operations_research::sat::IntegerVariableProto * mutable_variables(int index)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8pb_8h_source.html#l07219">cp_model.pb.h:7219</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntVar_html_a824aadc0688ab57929ae744b1f1a7a26"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntVar.html#a824aadc0688ab57929ae744b1f1a7a26">operations_research::sat::IntVar::operator!=</a></div><div class="ttdeci">bool operator!=(const IntVar &amp;other) const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00140">cp_model.h:140</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1NoOverlap2DConstraint_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1NoOverlap2DConstraint.html">operations_research::sat::NoOverlap2DConstraint</a></div><div class="ttdoc">Specialized no_overlap2D constraint.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00442">cp_model.h:442</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalVar_html_a34a66e31983270cb695c271d0b869ab3"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalVar.html#a34a66e31983270cb695c271d0b869ab3">operations_research::sat::IntervalVar::operator==</a></div><div class="ttdeci">bool operator==(const IntervalVar &amp;other) const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00298">cp_model.h:298</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntVar_html_aa8460c813c17ec5b7a137739c448bb98"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntVar.html#aa8460c813c17ec5b7a137739c448bb98">operations_research::sat::IntVar::Name</a></div><div class="ttdeci">const std::string &amp; Name() const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00134">cp_model.h:134</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1Constraint_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1Constraint.html">operations_research::sat::Constraint</a></div><div class="ttdoc">A constraint.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00340">cp_model.h:340</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_adac551c8b80fc7bdd7b30779fd20a4ea"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#adac551c8b80fc7bdd7b30779fd20a4ea">operations_research::sat::CpModelBuilder::NewConstant</a></div><div class="ttdeci">IntVar NewConstant(int64 value)</div><div class="ttdoc">Creates a constant variable.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntVar_html_a8ec929aea42c9e50e2f1daf56525e379"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntVar.html#a8ec929aea42c9e50e2f1daf56525e379">operations_research::sat::IntVar::SolutionIntegerMin</a></div><div class="ttdeci">friend int64 SolutionIntegerMin(const CpSolverResponse &amp;r, IntVar x)</div><div class="ttdoc">Returns the min of an integer variable in a solution.</div></div>
<div class="ttc" id="namespaceoperations__research_1_1sat_html_afa415e372a9d64eede869ed98666c29c"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#afa415e372a9d64eede869ed98666c29c">operations_research::sat::SolutionBooleanValue</a></div><div class="ttdeci">bool SolutionBooleanValue(const CpSolverResponse &amp;r, BoolVar x)</div><div class="ttdoc">Returns the value of a Boolean literal (a Boolean variable or its negation) in a solver response.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a18d2ca2be01dd3e67893f4e1dbe4af43"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a18d2ca2be01dd3e67893f4e1dbe4af43">operations_research::sat::CpModelBuilder::AddBoolXor</a></div><div class="ttdeci">Constraint AddBoolXor(absl::Span&lt; const BoolVar &gt; literals)</div><div class="ttdoc">Adds the constraint that a odd number of literal is true.</div></div>
<div class="ttc" id="sat__parameters_8pb_8h_html"><div class="ttname"><a href="sat__parameters_8pb_8h.html">sat_parameters.pb.h</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntVar_html_a64bd6fadf44a9840c837cc701b2b9043"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntVar.html#a64bd6fadf44a9840c837cc701b2b9043">operations_research::sat::IntVar::SolutionIntegerValue</a></div><div class="ttdeci">friend int64 SolutionIntegerValue(const CpSolverResponse &amp;r, const LinearExpr &amp;expr)</div><div class="ttdoc">Evaluates the value of an linear expression in a solver response.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1BoolVar_html_abcebeff89abbdb6b0b812616f1517f25"><div class="ttname"><a href="classoperations__research_1_1sat_1_1BoolVar.html#abcebeff89abbdb6b0b812616f1517f25">operations_research::sat::BoolVar::Name</a></div><div class="ttdeci">const std::string &amp; Name() const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00066">cp_model.h:66</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1BoolVar_html_afb03d8ed70e426b0f7b83c76fce3c68f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1BoolVar.html#afb03d8ed70e426b0f7b83c76fce3c68f">operations_research::sat::BoolVar::DebugString</a></div><div class="ttdeci">std::string DebugString() const</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a991b6a2a16def3962ccc5727004638db"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a991b6a2a16def3962ccc5727004638db">operations_research::sat::CpModelBuilder::AddProductEquality</a></div><div class="ttdeci">Constraint AddProductEquality(IntVar target, absl::Span&lt; const IntVar &gt; vars)</div><div class="ttdoc">Adds target == prod(vars).</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a7d05d91ffdd70f16ad170e25fd47e200"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a7d05d91ffdd70f16ad170e25fd47e200">operations_research::sat::CpModelBuilder::AddAllowedAssignments</a></div><div class="ttdeci">TableConstraint AddAllowedAssignments(absl::Span&lt; const IntVar &gt; vars)</div><div class="ttdoc">Adds an allowed assignments constraint.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1LinearExpr_html_a3b49fe9924ad61a609f65f4a7bc4c861"><div class="ttname"><a href="classoperations__research_1_1sat_1_1LinearExpr.html#a3b49fe9924ad61a609f65f4a7bc4c861">operations_research::sat::LinearExpr::ScalProd</a></div><div class="ttdeci">static LinearExpr ScalProd(absl::Span&lt; const IntVar &gt; vars, absl::Span&lt; const int64 &gt; coeffs)</div><div class="ttdoc">Constructs the scalar product of variables and coefficients.</div></div>
<div class="ttc" id="namespaceoperations__research_1_1sat_html_aeaed9bdf2a27bb778ba397666cb874d7"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#aeaed9bdf2a27bb778ba397666cb874d7">operations_research::sat::SolutionIntegerValue</a></div><div class="ttdeci">int64 SolutionIntegerValue(const CpSolverResponse &amp;r, const LinearExpr &amp;expr)</div><div class="ttdoc">Evaluates the value of an linear expression in a solver response.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1BoolVar_html_a379713d334c199eeb834c338385293ba"><div class="ttname"><a href="classoperations__research_1_1sat_1_1BoolVar.html#a379713d334c199eeb834c338385293ba">operations_research::sat::BoolVar::Proto</a></div><div class="ttdeci">const IntegerVariableProto &amp; Proto() const</div><div class="ttdoc">Useful for testing.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00082">cp_model.h:82</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a0faf578c69fe9ae80ee0ea9f671dc5e7"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a0faf578c69fe9ae80ee0ea9f671dc5e7">operations_research::sat::CpModelBuilder::Minimize</a></div><div class="ttdeci">void Minimize(const LinearExpr &amp;expr)</div><div class="ttdoc">Adds a linear minimization objective.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1LinearExpr_html_aa8bfd52517f0e1ca2a9adef474f1ff0c"><div class="ttname"><a href="classoperations__research_1_1sat_1_1LinearExpr.html#aa8bfd52517f0e1ca2a9adef474f1ff0c">operations_research::sat::LinearExpr::AddTerm</a></div><div class="ttdeci">void AddTerm(IntVar var, int64 coeff)</div><div class="ttdoc">Adds a term (var * coeff) to the linear expression.</div></div>
<div class="ttc" id="classoperations__research_1_1Domain_html"><div class="ttname"><a href="classoperations__research_1_1Domain.html">operations_research::Domain</a></div><div class="ttdoc">We call &quot;domain&quot; any subset of Int64 = [kint64min, kint64max].</div><div class="ttdef"><b>Definition:</b> <a href="sorted__interval__list_8h_source.html#l00070">sorted_interval_list.h:70</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalVar_html_ad73e372cd9d1def69624f85777393123"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalVar.html#ad73e372cd9d1def69624f85777393123">operations_research::sat::IntervalVar::operator&lt;&lt;</a></div><div class="ttdeci">friend std::ostream &amp; operator&lt;&lt;(std::ostream &amp;os, const IntervalVar &amp;var)</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalVar_html_a48f98ff3c12aecf540170647a72ce860"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalVar.html#a48f98ff3c12aecf540170647a72ce860">operations_research::sat::IntervalVar::Name</a></div><div class="ttdeci">std::string Name() const</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelProto_html_ad81813da437a67ae5f1a28b8fe290614"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelProto.html#ad81813da437a67ae5f1a28b8fe290614">operations_research::sat::CpModelProto::mutable_constraints</a></div><div class="ttdeci">::operations_research::sat::ConstraintProto * mutable_constraints(int index)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8pb_8h_source.html#l07249">cp_model.pb.h:7249</a></div></div>
<div class="ttc" id="cp__model_8pb_8h_html"><div class="ttname"><a href="cp__model_8pb_8h.html">cp_model.pb.h</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalVar_html_a9decc39f3f2079f78cdebd974972bc0f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalVar.html#a9decc39f3f2079f78cdebd974972bc0f">operations_research::sat::IntervalVar::SizeVar</a></div><div class="ttdeci">IntVar SizeVar() const</div><div class="ttdoc">Returns the size variable.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a4b3320604b4344b5bea17c5fae1ed7ce"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a4b3320604b4344b5bea17c5fae1ed7ce">operations_research::sat::CpModelBuilder::MutableProto</a></div><div class="ttdeci">CpModelProto * MutableProto()</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00687">cp_model.h:687</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1LinearExpr_html_abed3c016b025d92058b1c29ddeef9341"><div class="ttname"><a href="classoperations__research_1_1sat_1_1LinearExpr.html#abed3c016b025d92058b1c29ddeef9341">operations_research::sat::LinearExpr::AddConstant</a></div><div class="ttdeci">LinearExpr &amp; AddConstant(int64 value)</div><div class="ttdoc">Adds a constant value to the linear expression.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1TableConstraint_html_a90017a38e8ac8eaf4644bdce5e5e1420"><div class="ttname"><a href="classoperations__research_1_1sat_1_1TableConstraint.html#a90017a38e8ac8eaf4644bdce5e5e1420">operations_research::sat::TableConstraint::AddTuple</a></div><div class="ttdeci">void AddTuple(absl::Span&lt; const int64 &gt; tuple)</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1BoolVar_html_ae7e96dfb8ae534a787632d78711f9a44"><div class="ttname"><a href="classoperations__research_1_1sat_1_1BoolVar.html#ae7e96dfb8ae534a787632d78711f9a44">operations_research::sat::BoolVar::MutableProto</a></div><div class="ttdeci">IntegerVariableProto * MutableProto() const</div><div class="ttdoc">Useful for model edition.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00087">cp_model.h:87</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpSolverResponse_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpSolverResponse.html">operations_research::sat::CpSolverResponse</a></div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8pb_8h_source.html#l04189">cp_model.pb.h:4189</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a5738c98c07c2e0ec747877eb3813a134"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a5738c98c07c2e0ec747877eb3813a134">operations_research::sat::CpModelBuilder::AddAutomaton</a></div><div class="ttdeci">AutomatonConstraint AddAutomaton(absl::Span&lt; const IntVar &gt; transition_variables, int starting_state, absl::Span&lt; const int &gt; final_states)</div><div class="ttdoc">An automaton constraint takes a list of variables (of size n), an initial state, a set of final state...</div></div>
<div class="ttc" id="namespaceoperations__research_html"><div class="ttname"><a href="namespaceoperations__research.html">operations_research</a></div><div class="ttdoc">Licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in c...</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00048">cp_model.h:48</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a10d61bc6bc9584cadfc0b87537ada9eb"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a10d61bc6bc9584cadfc0b87537ada9eb">operations_research::sat::CpModelBuilder::AddNoOverlap2D</a></div><div class="ttdeci">NoOverlap2DConstraint AddNoOverlap2D()</div><div class="ttdoc">The no_overlap_2d constraint prevents a set of boxes from overlapping.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CircuitConstraint_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CircuitConstraint.html">operations_research::sat::CircuitConstraint</a></div><div class="ttdoc">Specialized circuit constraint.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00383">cp_model.h:383</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntVar_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntVar.html">operations_research::sat::IntVar</a></div><div class="ttdoc">An integer variable.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00124">cp_model.h:124</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntervalVar_html_a1b7333dffeb56f1cffe35973cab19dd1"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntervalVar.html#a1b7333dffeb56f1cffe35973cab19dd1">operations_research::sat::IntervalVar::WithName</a></div><div class="ttdeci">IntervalVar WithName(const std::string &amp;name)</div><div class="ttdoc">Sets the name of the variable.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1ConstraintProto_html_a86f1152bd1888743f98a99b789d3295b"><div class="ttname"><a href="classoperations__research_1_1sat_1_1ConstraintProto.html#a86f1152bd1888743f98a99b789d3295b">operations_research::sat::ConstraintProto::mutable_interval</a></div><div class="ttdeci">::operations_research::sat::IntervalConstraintProto * mutable_interval()</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8pb_8h_source.html#l06685">cp_model.pb.h:6685</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1BoolVar_html_a27d52277902e0d08306697a43863b5e8"><div class="ttname"><a href="classoperations__research_1_1sat_1_1BoolVar.html#a27d52277902e0d08306697a43863b5e8">operations_research::sat::BoolVar::index</a></div><div class="ttdeci">int index() const</div><div class="ttdoc">Returns the index of the variable in the model.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00093">cp_model.h:93</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntVar_html_aac78f1c00b73fbad7bd6577181f537fb"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntVar.html#aac78f1c00b73fbad7bd6577181f537fb">operations_research::sat::IntVar::DebugString</a></div><div class="ttdeci">std::string DebugString() const</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntVar_html_a426492195e6cdd88354def292ffa112f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntVar.html#a426492195e6cdd88354def292ffa112f">operations_research::sat::IntVar::Proto</a></div><div class="ttdeci">const IntegerVariableProto &amp; Proto() const</div><div class="ttdoc">Useful for testing.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00147">cp_model.h:147</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelProto_html_ab0dda4e799f065179f785ede9a0a2540"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelProto.html#ab0dda4e799f065179f785ede9a0a2540">operations_research::sat::CpModelProto::variables</a></div><div class="ttdeci">const ::operations_research::sat::IntegerVariableProto &amp; variables(int index) const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8pb_8h_source.html#l07228">cp_model.pb.h:7228</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a89c4590eaf404f0ef3b80d4ce584fbda"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a89c4590eaf404f0ef3b80d4ce584fbda">operations_research::sat::CpModelBuilder::AddNoOverlap</a></div><div class="ttdeci">Constraint AddNoOverlap(absl::Span&lt; const IntervalVar &gt; vars)</div><div class="ttdoc">Adds a constraint than ensures that all present intervals do not overlap in time.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntVar_html_a68349a30f6936d8f5a3d00d342ec5f3a"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntVar.html#a68349a30f6936d8f5a3d00d342ec5f3a">operations_research::sat::IntVar::MutableProto</a></div><div class="ttdeci">IntegerVariableProto * MutableProto() const</div><div class="ttdoc">Useful for model edition.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00152">cp_model.h:152</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a001974a3f1f5e9d791ae10cd435f07cf"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a001974a3f1f5e9d791ae10cd435f07cf">operations_research::sat::CpModelBuilder::AddVariableElement</a></div><div class="ttdeci">Constraint AddVariableElement(IntVar index, absl::Span&lt; const IntVar &gt; variables, IntVar target)</div><div class="ttdoc">Adds the element constraint: variables[index] == target.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_ad941d4f0156fc746c4ed12790bce7af7"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#ad941d4f0156fc746c4ed12790bce7af7">operations_research::sat::CpModelBuilder::AddEquality</a></div><div class="ttdeci">Constraint AddEquality(const LinearExpr &amp;left, const LinearExpr &amp;right)</div><div class="ttdoc">Adds left == right.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a4f1c8c11f9f840728e5c037249192b8f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a4f1c8c11f9f840728e5c037249192b8f">operations_research::sat::CpModelBuilder::AddLessOrEqual</a></div><div class="ttdeci">Constraint AddLessOrEqual(const LinearExpr &amp;left, const LinearExpr &amp;right)</div><div class="ttdoc">Adds left &lt;= right.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntVar_html_a23d836e740ab297549905c5fa8539ba5"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntVar.html#a23d836e740ab297549905c5fa8539ba5">operations_research::sat::IntVar::operator==</a></div><div class="ttdeci">bool operator==(const IntVar &amp;other) const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00136">cp_model.h:136</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1LinearExpr_html_ab33a810593c0a9f585133edcb22deb55"><div class="ttname"><a href="classoperations__research_1_1sat_1_1LinearExpr.html#ab33a810593c0a9f585133edcb22deb55">operations_research::sat::LinearExpr::LinearExpr</a></div><div class="ttdeci">LinearExpr()</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1LinearExpr_html_a0a6ff6ac94b7e556ff06df6f8211182f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1LinearExpr.html#a0a6ff6ac94b7e556ff06df6f8211182f">operations_research::sat::LinearExpr::BooleanSum</a></div><div class="ttdeci">static LinearExpr BooleanSum(absl::Span&lt; const BoolVar &gt; vars)</div><div class="ttdoc">Constructs the sum of a list of Booleans.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelProto_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelProto.html">operations_research::sat::CpModelProto</a></div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8pb_8h_source.html#l03997">cp_model.pb.h:3997</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CircuitConstraint_html_a9ee6aa474b9e4c2bcf8fab717079704d"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CircuitConstraint.html#a9ee6aa474b9e4c2bcf8fab717079704d">operations_research::sat::CircuitConstraint::AddArc</a></div><div class="ttdeci">void AddArc(int tail, int head, BoolVar literal)</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1AutomatonConstraint_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1AutomatonConstraint.html">operations_research::sat::AutomatonConstraint</a></div><div class="ttdoc">Specialized automaton constraint.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00428">cp_model.h:428</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_aa64c33dd1487bf4f0d575edf33ef2dc9"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#aa64c33dd1487bf4f0d575edf33ef2dc9">operations_research::sat::CpModelBuilder::AddNotEqual</a></div><div class="ttdeci">Constraint AddNotEqual(const LinearExpr &amp;left, const LinearExpr &amp;right)</div><div class="ttdoc">Adds left != right.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1LinearExpr_html_afb9c31fb1176a9ba22d4b82fa285a5c7"><div class="ttname"><a href="classoperations__research_1_1sat_1_1LinearExpr.html#afb9c31fb1176a9ba22d4b82fa285a5c7">operations_research::sat::LinearExpr::AddVar</a></div><div class="ttdeci">void AddVar(IntVar var)</div><div class="ttdoc">Adds a single integer variable to the linear expression.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1LinearExpr_html_a6f0e8040bcb0ee633efd0862c660cbf4"><div class="ttname"><a href="classoperations__research_1_1sat_1_1LinearExpr.html#a6f0e8040bcb0ee633efd0862c660cbf4">operations_research::sat::LinearExpr::coefficients</a></div><div class="ttdeci">const std::vector&lt; int64 &gt; &amp; coefficients() const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00247">cp_model.h:247</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1ConstraintProto_html_ade0baf9bbe5b09d470ab30ae8b730cc4"><div class="ttname"><a href="classoperations__research_1_1sat_1_1ConstraintProto.html#ade0baf9bbe5b09d470ab30ae8b730cc4">operations_research::sat::ConstraintProto::interval</a></div><div class="ttdeci">const ::operations_research::sat::IntervalConstraintProto &amp; interval() const</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8pb_8h_source.html#l06679">cp_model.pb.h:6679</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1CpModelBuilder_html_a6dc655a67c5213fcefb82a213dac5e2c"><div class="ttname"><a href="classoperations__research_1_1sat_1_1CpModelBuilder.html#a6dc655a67c5213fcefb82a213dac5e2c">operations_research::sat::CpModelBuilder::TrueVar</a></div><div class="ttdeci">BoolVar TrueVar()</div><div class="ttdoc">Creates an always true Boolean variable.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1Constraint_html_a9052e9e1dd8248433909b5542f314add"><div class="ttname"><a href="classoperations__research_1_1sat_1_1Constraint.html#a9052e9e1dd8248433909b5542f314add">operations_research::sat::Constraint::OnlyEnforceIf</a></div><div class="ttdeci">Constraint OnlyEnforceIf(absl::Span&lt; const BoolVar &gt; literals)</div><div class="ttdoc">The constraint will be enforced iff all literals listed here are true.</div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1IntVar_html_ade91cda36a02fffbd115f1ec65746af1"><div class="ttname"><a href="classoperations__research_1_1sat_1_1IntVar.html#ade91cda36a02fffbd115f1ec65746af1">operations_research::sat::IntVar::index</a></div><div class="ttdeci">int index() const</div><div class="ttdoc">Returns the index of the variable in the model.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00157">cp_model.h:157</a></div></div>
<div class="ttc" id="classoperations__research_1_1sat_1_1BoolVar_html_ac5a3346c2302559c71bd9cd1e989edf9"><div class="ttname"><a href="classoperations__research_1_1sat_1_1BoolVar.html#ac5a3346c2302559c71bd9cd1e989edf9">operations_research::sat::BoolVar::Not</a></div><div class="ttdeci">BoolVar Not() const</div><div class="ttdoc">Returns the logical negation of the current Boolean variable.</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8h_source.html#l00069">cp_model.h:69</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
</div>
<div id="footer-container">
<div id="footer">
</div>
</div>
</body>
</html>