Files
ortools-clone/docs/cpp/nurses_cp_8cc-example.html

110 lines
24 KiB
HTML
Raw Normal View History

2020-09-02 09:42:51 +02:00
<!-- HTML header for doxygen 1.8.18-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
2021-09-20 15:57:27 +02:00
<meta name="generator" content="Doxygen 1.8.15"/>
2020-09-02 09:42:51 +02:00
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OR-Tools: nurses_cp.cc</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
2021-09-20 15:57:27 +02:00
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
2020-09-02 09:42:51 +02:00
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="styleSheet.tmp.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="orLogo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">OR-Tools
2021-09-20 15:57:27 +02:00
&#160;<span id="projectnumber">9.1</span>
2020-09-02 09:42:51 +02:00
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
2021-09-20 15:57:27 +02:00
<!-- Generated by Doxygen 1.8.15 -->
2020-09-02 09:42:51 +02:00
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
2021-09-20 15:57:27 +02:00
var searchBox = new SearchBox("searchBox", "search",false,'Search');
2020-09-02 09:42:51 +02:00
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
2021-09-20 15:57:27 +02:00
$(document).ready(function(){initNavTree('nurses_cp_8cc-example.html','');});
2020-09-02 09:42:51 +02:00
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">nurses_cp.cc</div> </div>
</div><!--header-->
<div class="contents">
<p>List of constraint solver samples:</p>
2021-09-20 15:57:27 +02:00
<div class="fragment"><div class="line"><span class="comment">// Copyright 2018 Google LLC</span></div><div class="line"><span class="comment">// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><span class="comment">// you may not use this file except in compliance with the License.</span></div><div class="line"><span class="comment">// You may obtain a copy of the License at</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><span class="comment">//</span></div><div class="line"><span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><span class="comment">// distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><span class="comment">// See the License for the specific language governing permissions and</span></div><div class="line"><span class="comment">// limitations under the License.</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;numeric&gt;</span> <span class="comment">// std::iota</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="base_2logging_8h.html">ortools/base/logging.h</a>&quot;</span></div><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="constraint__solver_8h.html">ortools/constraint_solver/constraint_solver.h</a>&quot;</span></div><div class="line"></div><div class="line"><span class="keyword">namespace </span><a class="code" href="namespaceoperations__research.html">operations_research</a> {</div><div class="line"><span class="keywordtype">void</span> SolveNursesExample() {</div><div class="line"> <span class="comment">// Instantiate the solver.</span></div><div class="line"> Solver solver(<span class="stringliteral">&quot;NursesExample&quot;</span>);</div><div class="line"> std::array&lt;int, 4&gt; nurses;</div><div class="line"> std::iota(std::begin(nurses), std::end(nurses), 0);</div><div class="line"> {</div><div class="line"> std::ostringstream oss;</div><div class="line"> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i : nurses) oss &lt;&lt; <span class="charliteral">&#39; &#39;</span> &lt;&lt; i;</div><div class="line"> <a name="a0"></a><a class="code" href="base_2logging_8h.html#accad43a85d781d53381cd53a9894b6ae">LOG</a>(<a name="a1"></a><a class="code" href="log__severity_8h.html#ab4a2cbab234914b320b7fae11b6e8cb9">INFO</a>) &lt;&lt; <span class="stringliteral">&quot;Nurses:&quot;</span> &lt;&lt; oss.str();</div><div class="line"> }</div><div class="line"></div><div class="line"> <span class="comment">// Nurse assigned to shift 0 means not working that day.</span></div><div class="line"> std::array&lt;int, 4&gt; shifts;</div><div class="line"> std::iota(std::begin(shifts), std::end(shifts), 0);</div><div class="line"> {</div><div class="line"> std::ostringstream oss;</div><div class="line"> <span class="keywordflow">for</span> (<span class="keyword">auto</span> i : shifts) oss &lt;&lt; <span class="charliteral">&#39; &#39;</span> &lt;&lt; i;</div><div class="line"> <a class="code" href="base_2logging_8h.html#accad43a85d781d53381cd53a9894b6ae">LOG</a>(<a class="code" href="log__severity_8h.html#ab4a2cbab234914b320b7fae11b6e8cb9">INFO</a>) &lt;&lt; <span class="stringliteral">&quot;Shifts:&quot;</span> &lt;&lt; oss.str();</div><div class="line"> }</div><div class="line"></div><div class="line"> std::array&lt;int, 7&gt; days;</div><div class="line"> std::iota(std::begin(days), std::end(days), 0);</div><div class="line"> {</div><div class="line"> std::ostringstream oss;</div><div class="line"> <span class="keywordflow">for</span> (<span class="keyword">auto</spa
2021-01-26 11:28:50 +01:00
</div><!-- doc-content -->
2020-09-02 09:42:51 +02:00
<!-- HTML footer for doxygen 1.8.18-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
2021-09-20 15:57:27 +02:00
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
2020-09-02 09:42:51 +02:00
</ul>
</div>
</body>
</html>