mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-07-17 12:02:22 +08:00
Documentation for 8b1eab204b
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<!-- HTML header for doxygen 1.12.0-->
|
||||
<!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" lang="en-US">
|
||||
<head>
|
||||
@@ -5,10 +6,15 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: cpu_scheduling_algorithms/fcfs_scheduling.cpp File Reference</title>
|
||||
<title>TheAlgorithms/C++: cpu_scheduling_algorithms/fcfs_scheduling.cpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
<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>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
|
||||
<script type="text/javascript">
|
||||
DoxygenAwesomeDarkModeToggle.init()
|
||||
</script>
|
||||
<script type="text/javascript" src="../../clipboard.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
@@ -18,14 +24,24 @@
|
||||
<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>
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
|
||||
jax: ["input/TeX","output/HTML-CSS"],
|
||||
});
|
||||
<script type="text/javascript">
|
||||
window.MathJax = {
|
||||
options: {
|
||||
ignoreHtmlClass: 'tex2jax_ignore',
|
||||
processHtmlClass: 'tex2jax_process'
|
||||
},
|
||||
loader: {
|
||||
load: ['[tex]/ams']
|
||||
},
|
||||
tex: {
|
||||
macros: {},
|
||||
packages: ['base','configmacros','ams']
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
|
||||
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
@@ -33,10 +49,11 @@ MathJax.Hub.Config({
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
<div id="projectname">TheAlgorithms/C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
<div id="projectbrief">All the algorithms implemented in C++</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -128,7 +145,9 @@ Include dependency graph for fcfs_scheduling.cpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><div class="zoom"><iframe scrolling="no" frameborder="0" src="../../d4/d2f/fcfs__scheduling_8cpp__incl.svg" width="100%" height="394"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div></div>
|
||||
</div>
|
||||
</div><table class="memberdecls">
|
||||
</div>
|
||||
<p><a href="../../df/d47/fcfs__scheduling_8cpp_source.html">Go to the source code of this file.</a></p>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
|
||||
Classes</h2></td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../de/d4a/class_compare.html">Compare< S, T, E ></a></td></tr>
|
||||
@@ -141,11 +160,11 @@ Classes</h2></td></tr>
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
||||
Functions</h2></td></tr>
|
||||
<tr class="memitem:a18920aa331faf4476b251c8cdb2c2bec" id="r_a18920aa331faf4476b251c8cdb2c2bec"><td class="memTemplParams" colspan="2">template<typename S , typename T , typename E > </td></tr>
|
||||
<tr class="memitem:a18920aa331faf4476b251c8cdb2c2bec"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a18920aa331faf4476b251c8cdb2c2bec">sortcol</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple</a>< S, T, E > &t1, <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple</a>< S, T, E > &t2)</td></tr>
|
||||
<tr class="memitem:a18920aa331faf4476b251c8cdb2c2bec"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a18920aa331faf4476b251c8cdb2c2bec">sortcol</a> (tuple< S, T, E > &t1, tuple< S, T, E > &t2)</td></tr>
|
||||
<tr class="memdesc:a18920aa331faf4476b251c8cdb2c2bec"><td class="mdescLeft"> </td><td class="mdescRight">Comparator function for sorting a vector. <br /></td></tr>
|
||||
<tr class="separator:a18920aa331faf4476b251c8cdb2c2bec"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a8f2b90cb64d63a7080965e66a05ccf86" id="r_a8f2b90cb64d63a7080965e66a05ccf86"><td class="memTemplParams" colspan="2">template<typename S , typename T , typename E > </td></tr>
|
||||
<tr class="memitem:a8f2b90cb64d63a7080965e66a05ccf86"><td class="memTemplItemLeft" align="right" valign="top"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple</a>< S, T, E, double, double, double > > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status</a> (<a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple</a>< uint32_t, uint32_t, uint32_t > > input)</td></tr>
|
||||
<tr class="memitem:a8f2b90cb64d63a7080965e66a05ccf86"><td class="memTemplItemLeft" align="right" valign="top">vector< tuple< S, T, E, double, double, double > > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status</a> (vector< tuple< uint32_t, uint32_t, uint32_t > > input)</td></tr>
|
||||
<tr class="memdesc:a8f2b90cb64d63a7080965e66a05ccf86"><td class="mdescLeft"> </td><td class="mdescRight">Function to be used for testing purposes. This function guarantees the correct solution for <a class="el" href="../../dd/dca/class_f_c_f_s.html" title="Class which implements the FCFS scheduling algorithm.">FCFS</a> scheduling algorithm. <br /></td></tr>
|
||||
<tr class="separator:a8f2b90cb64d63a7080965e66a05ccf86"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:aa8dca7b867074164d5f45b0f3851269d" id="r_aa8dca7b867074164d5f45b0f3851269d"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="#aa8dca7b867074164d5f45b0f3851269d">test</a> ()</td></tr>
|
||||
@@ -158,6 +177,8 @@ Functions</h2></td></tr>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>Implementation of <a class="el" href="../../dd/dca/class_f_c_f_s.html" title="Class which implements the FCFS scheduling algorithm.">FCFS</a> CPU scheduling algorithm. </p>
|
||||
<p><a class="el" href="../../dd/dca/class_f_c_f_s.html" title="Class which implements the FCFS scheduling algorithm.">FCFS</a> is a non-preemptive CPU scheduling algorithm in which whichever process arrives first, gets executed first. If two or more processes arrive simultaneously, the process with smaller process ID gets executed first. <a class="el" href="">https://bit.ly/3ABNXOC</a>Pratyush Vatsa </p>
|
||||
|
||||
<p class="definition">Definition in file <a class="el" href="../../df/d47/fcfs__scheduling_8cpp_source.html">fcfs_scheduling.cpp</a>.</p>
|
||||
</div><h2 class="groupheader">Function Documentation</h2>
|
||||
<a id="a8f2b90cb64d63a7080965e66a05ccf86" name="a8f2b90cb64d63a7080965e66a05ccf86"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a8f2b90cb64d63a7080965e66a05ccf86">◆ </a></span>get_final_status()</h2>
|
||||
@@ -168,9 +189,9 @@ Functions</h2></td></tr>
|
||||
template<typename S , typename T , typename E > </div>
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple</a>< S, T, E, double, double, double > > get_final_status </td>
|
||||
<td class="memname">vector< tuple< S, T, E, double, double, double > > get_final_status </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector</a>< <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple</a>< uint32_t, uint32_t, uint32_t > ></td> <td class="paramname"><span class="paramname"><em>input</em></span></td><td>)</td>
|
||||
<td class="paramtype">vector< tuple< uint32_t, uint32_t, uint32_t > ></td> <td class="paramname"><span class="paramname"><em>input</em></span></td><td>)</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -184,11 +205,13 @@ template<typename S , typename T , typename E > </div>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>Sorts the input vector according to arrival time. Processes whose arrival times are same get sorted according to process ID For each process, completion time, turnaround time and completion time are calculated, inserted in a tuple, which is added to the vector result. </p><dl class="section return"><dt>Returns</dt><dd>A vector of tuples consisting of process ID, arrival time, burst time, completion time, turnaround time and waiting time for each process. </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00226">226</a> of file <a class="el" href="../../df/d47/fcfs__scheduling_8cpp_source.html">fcfs_scheduling.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 227</span> {</div>
|
||||
<div class="line"><span class="lineno"> 228</span> <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/algorithm/sort.html">sort</a>(input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/begin.html">begin</a>(), input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/end.html">end</a>(), <a class="code hl_function" href="#a18920aa331faf4476b251c8cdb2c2bec">sortcol<S, T, E></a>);</div>
|
||||
<div class="line"><span class="lineno"> 229</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<tuple<S, T, E, double, double, double></a>> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>(input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>());</div>
|
||||
<div class="line"><span class="lineno"> 228</span> sort(input.begin(), input.end(), <a class="code hl_function" href="#a18920aa331faf4476b251c8cdb2c2bec">sortcol<S, T, E></a>);</div>
|
||||
<div class="line"><span class="lineno"> 229</span> vector<tuple<S, T, E, double, double, double>> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>(input.size());</div>
|
||||
<div class="line"><span class="lineno"> 230</span> <span class="keywordtype">double</span> timeElapsed = 0;</div>
|
||||
<div class="line"><span class="lineno"> 231</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i{}; i < input.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector/size.html">size</a>(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 231</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i{}; i < input.size(); i++) {</div>
|
||||
<div class="line"><span class="lineno"> 232</span> T arrival = get<1>(input[i]);</div>
|
||||
<div class="line"><span class="lineno"> 233</span> E burst = get<2>(input[i]);</div>
|
||||
<div class="line"><span class="lineno"> 234</span> </div>
|
||||
@@ -209,19 +232,9 @@ template<typename S , typename T , typename E > </div>
|
||||
<div class="line"><span class="lineno"> 249</span> }</div>
|
||||
<div class="line"><span class="lineno"> 250</span> <span class="keywordflow">return</span> <a class="code hl_function" href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">result</a>;</div>
|
||||
<div class="line"><span class="lineno"> 251</span>}</div>
|
||||
<div class="ttc" id="abegin_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/begin.html">std::vector::begin</a></div><div class="ttdeci">T begin(T... args)</div></div>
|
||||
<div class="ttc" id="aend_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/end.html">std::vector::end</a></div><div class="ttdeci">T end(T... args)</div></div>
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_a18920aa331faf4476b251c8cdb2c2bec"><div class="ttname"><a href="#a18920aa331faf4476b251c8cdb2c2bec">sortcol</a></div><div class="ttdeci">bool sortcol(tuple< S, T, E > &t1, tuple< S, T, E > &t2)</div><div class="ttdoc">Comparator function for sorting a vector.</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:46</div></div>
|
||||
<div class="ttc" id="afibonacci__sum_8cpp_html_aadb40ac4c74a7efc0680b83eeee138aa"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">math::fibonacci_sum::result</a></div><div class="ttdeci">uint64_t result(uint64_t n)</div><div class="ttdef"><b>Definition</b> fibonacci_sum.cpp:77</div></div>
|
||||
<div class="ttc" id="asize_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector/size.html">std::vector::size</a></div><div class="ttdeci">T size(T... args)</div></div>
|
||||
<div class="ttc" id="asort_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/algorithm/sort.html">std::sort</a></div><div class="ttdeci">T sort(T... args)</div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d47/fcfs__scheduling_8cpp_a8f2b90cb64d63a7080965e66a05ccf86_cgraph.svg" width="232" height="36"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_a18920aa331faf4476b251c8cdb2c2bec"><div class="ttname"><a href="#a18920aa331faf4476b251c8cdb2c2bec">sortcol</a></div><div class="ttdeci">bool sortcol(tuple< S, T, E > &t1, tuple< S, T, E > &t2)</div><div class="ttdoc">Comparator function for sorting a vector.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00046">fcfs_scheduling.cpp:46</a></div></div>
|
||||
<div class="ttc" id="afibonacci__sum_8cpp_html_aadb40ac4c74a7efc0680b83eeee138aa"><div class="ttname"><a href="../../de/dc3/fibonacci__sum_8cpp.html#aadb40ac4c74a7efc0680b83eeee138aa">math::fibonacci_sum::result</a></div><div class="ttdeci">uint64_t result(uint64_t n)</div><div class="ttdef"><b>Definition</b> <a href="../../de/dc3/fibonacci__sum_8cpp_source.html#l00077">fibonacci_sum.cpp:77</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4" name="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
|
||||
@@ -241,17 +254,14 @@ Here is the call graph for this function:</div>
|
||||
|
||||
<p>Entry point of the program. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 on exit </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00288">288</a> of file <a class="el" href="../../df/d47/fcfs__scheduling_8cpp_source.html">fcfs_scheduling.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 288</span> {</div>
|
||||
<div class="line"><span class="lineno"> 289</span> <a class="code hl_function" href="#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><span class="lineno"> 290</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><span class="lineno"> 291</span>}</div>
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:257</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d47/fcfs__scheduling_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg" width="567" height="247"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00257">fcfs_scheduling.cpp:257</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
<a id="a18920aa331faf4476b251c8cdb2c2bec" name="a18920aa331faf4476b251c8cdb2c2bec"></a>
|
||||
@@ -265,12 +275,12 @@ template<typename S , typename T , typename E > </div>
|
||||
<tr>
|
||||
<td class="memname">bool sortcol </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple</a>< S, T, E > &</td> <td class="paramname"><span class="paramname"><em>t1</em></span>, </td>
|
||||
<td class="paramtype">tuple< S, T, E > &</td> <td class="paramname"><span class="paramname"><em>t1</em></span>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype"><a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/utility/tuple.html">tuple</a>< S, T, E > &</td> <td class="paramname"><span class="paramname"><em>t2</em></span> )</td>
|
||||
<td class="paramtype">tuple< S, T, E > &</td> <td class="paramname"><span class="paramname"><em>t2</em></span> )</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
@@ -294,6 +304,8 @@ template<typename S , typename T , typename E > </div>
|
||||
<dl class="section return"><dt>Returns</dt><dd>true if t1 and t2 are in the CORRECT order </dd>
|
||||
<dd>
|
||||
false if t1 and t2 are in the INCORRECT order </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00046">46</a> of file <a class="el" href="../../df/d47/fcfs__scheduling_8cpp_source.html">fcfs_scheduling.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 46</span> {</div>
|
||||
<div class="line"><span class="lineno"> 47</span> <span class="keywordflow">if</span> (get<1>(t1) < get<1>(t2)) {</div>
|
||||
<div class="line"><span class="lineno"> 48</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
@@ -330,18 +342,20 @@ false if t1 and t2 are in the INCORRECT order </dd></dl>
|
||||
|
||||
<p>Self-test implementations. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>void </dd></dl>
|
||||
|
||||
<p class="definition">Definition at line <a class="el" href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00257">257</a> of file <a class="el" href="../../df/d47/fcfs__scheduling_8cpp_source.html">fcfs_scheduling.cpp</a>.</p>
|
||||
<div class="fragment"><div class="line"><span class="lineno"> 257</span> {</div>
|
||||
<div class="line"><span class="lineno"> 258</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i{}; i < 1000; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 259</span> srand(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 259</span> srand(time(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 260</span> uint32_t n = 1 + rand() % 1000;</div>
|
||||
<div class="line"><span class="lineno"> 261</span> <a class="code hl_class" href="../../dd/dca/class_f_c_f_s.html">FCFS<uint32_t, uint32_t, uint32_t></a> readyQueue;</div>
|
||||
<div class="line"><span class="lineno"> 262</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<tuple<uint32_t, uint32_t, uint32_t></a>> input(n);</div>
|
||||
<div class="line"><span class="lineno"> 262</span> vector<tuple<uint32_t, uint32_t, uint32_t>> input(n);</div>
|
||||
<div class="line"><span class="lineno"> 263</span> </div>
|
||||
<div class="line"><span class="lineno"> 264</span> <span class="keywordflow">for</span> (uint32_t i{}; i < n; i++) {</div>
|
||||
<div class="line"><span class="lineno"> 265</span> get<0>(input[i]) = i;</div>
|
||||
<div class="line"><span class="lineno"> 266</span> srand(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 266</span> srand(time(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 267</span> get<1>(input[i]) = 1 + rand() % 10000;</div>
|
||||
<div class="line"><span class="lineno"> 268</span> srand(<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/chrono/c/time.html">time</a>(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 268</span> srand(time(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><span class="lineno"> 269</span> get<2>(input[i]) = 1 + rand() % 10000;</div>
|
||||
<div class="line"><span class="lineno"> 270</span> }</div>
|
||||
<div class="line"><span class="lineno"> 271</span> </div>
|
||||
@@ -349,26 +363,19 @@ false if t1 and t2 are in the INCORRECT order </dd></dl>
|
||||
<div class="line"><span class="lineno"> 273</span> readyQueue.<a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">addProcess</a>(get<0>(input[i]), get<1>(input[i]),</div>
|
||||
<div class="line"><span class="lineno"> 274</span> get<2>(input[i]));</div>
|
||||
<div class="line"><span class="lineno"> 275</span> }</div>
|
||||
<div class="line"><span class="lineno"> 276</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">vector<tuple<uint32_t, uint32_t, uint32_t, double, double, double></a>></div>
|
||||
<div class="line"><span class="lineno"> 276</span> vector<tuple<uint32_t, uint32_t, uint32_t, double, double, double>></div>
|
||||
<div class="line"><span class="lineno"> 277</span> res = <a class="code hl_function" href="#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status<uint32_t, uint32_t, uint32_t></a>(input);</div>
|
||||
<div class="line"><span class="lineno"> 278</span> assert(res == readyQueue.<a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">scheduleForFcfs</a>());</div>
|
||||
<div class="line"><span class="lineno"> 279</span> <span class="comment">// readyQueue.printResult();</span></div>
|
||||
<div class="line"><span class="lineno"> 280</span> }</div>
|
||||
<div class="line"><span class="lineno"> 281</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">cout</a> << <span class="stringliteral">"All the tests have successfully passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 281</span> cout << <span class="stringliteral">"All the tests have successfully passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><span class="lineno"> 282</span>}</div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html">FCFS</a></div><div class="ttdoc">Class which implements the FCFS scheduling algorithm.</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:98</div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html_a8fbfe4d85f7576b4a7aade07d29fbd69"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">FCFS::addProcess</a></div><div class="ttdeci">void addProcess(S id, T arrival, E burst)</div><div class="ttdoc">Adds the process to the ready queue if it isn't already there.</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:130</div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html_aa25dbe30ba9930b5a7c1a6d11758bd91"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">FCFS::scheduleForFcfs</a></div><div class="ttdeci">vector< tuple< S, T, E, double, double, double > > scheduleForFcfs()</div><div class="ttdoc">Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor...</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:155</div></div>
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_a8f2b90cb64d63a7080965e66a05ccf86"><div class="ttname"><a href="#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status</a></div><div class="ttdeci">vector< tuple< S, T, E, double, double, double > > get_final_status(vector< tuple< uint32_t, uint32_t, uint32_t > > input)</div><div class="ttdoc">Function to be used for testing purposes. This function guarantees the correct solution for FCFS sche...</div><div class="ttdef"><b>Definition</b> fcfs_scheduling.cpp:226</div></div>
|
||||
<div class="ttc" id="amatrix__exponentiation_8cpp_html_a600eaf353befc174637855795f12d258"><div class="ttname"><a href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a></div><div class="ttdeci">#define endl</div><div class="ttdef"><b>Definition</b> matrix_exponentiation.cpp:36</div></div>
|
||||
<div class="ttc" id="atime_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/chrono/c/time.html">std::time</a></div><div class="ttdeci">T time(T... args)</div></div>
|
||||
</div><!-- fragment --><div class="dynheader">
|
||||
Here is the call graph for this function:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/d47/fcfs__scheduling_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg" width="470" height="247"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
|
||||
<div class="ttc" id="aclass_f_c_f_s_html"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html">FCFS</a></div><div class="ttdoc">Class which implements the FCFS scheduling algorithm.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00098">fcfs_scheduling.cpp:98</a></div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html_a8fbfe4d85f7576b4a7aade07d29fbd69"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">FCFS::addProcess</a></div><div class="ttdeci">void addProcess(S id, T arrival, E burst)</div><div class="ttdoc">Adds the process to the ready queue if it isn't already there.</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00130">fcfs_scheduling.cpp:130</a></div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html_aa25dbe30ba9930b5a7c1a6d11758bd91"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">FCFS::scheduleForFcfs</a></div><div class="ttdeci">vector< tuple< S, T, E, double, double, double > > scheduleForFcfs()</div><div class="ttdoc">Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor...</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00155">fcfs_scheduling.cpp:155</a></div></div>
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_a8f2b90cb64d63a7080965e66a05ccf86"><div class="ttname"><a href="#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status</a></div><div class="ttdeci">vector< tuple< S, T, E, double, double, double > > get_final_status(vector< tuple< uint32_t, uint32_t, uint32_t > > input)</div><div class="ttdoc">Function to be used for testing purposes. This function guarantees the correct solution for FCFS sche...</div><div class="ttdef"><b>Definition</b> <a href="../../df/d47/fcfs__scheduling_8cpp_source.html#l00226">fcfs_scheduling.cpp:226</a></div></div>
|
||||
<div class="ttc" id="amatrix__exponentiation_8cpp_html_a600eaf353befc174637855795f12d258"><div class="ttname"><a href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a></div><div class="ttdeci">#define endl</div><div class="ttdef"><b>Definition</b> <a href="../../d7/d35/matrix__exponentiation_8cpp_source.html#l00036">matrix_exponentiation.cpp:36</a></div></div>
|
||||
</div><!-- fragment -->
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- contents -->
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
<map id="get_final_status" name="get_final_status">
|
||||
<area shape="rect" id="Node000001" title="Function to be used for testing purposes. This function guarantees the correct solution for FCFS sche..." alt="" coords="5,5,119,31"/>
|
||||
<area shape="rect" id="Node000002" href="$df/d47/fcfs__scheduling_8cpp.html#a18920aa331faf4476b251c8cdb2c2bec" title="Comparator function for sorting a vector." alt="" coords="167,5,227,31"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="119,16,151,16,151,21,119,21"/>
|
||||
</map>
|
||||
@@ -1 +0,0 @@
|
||||
07278229db85ad944de7b00a4fa4ed42
|
||||
@@ -1,65 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: get_final_status Pages: 1 -->
|
||||
<svg width="174pt" height="27pt"
|
||||
viewBox="0.00 0.00 174.25 27.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
.node, .edge {opacity: 0.7;}
|
||||
.node.selected, .edge.selected {opacity: 1;}
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 23.25)">
|
||||
<title>get_final_status</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Function to be used for testing purposes. This function guarantees the correct solution for FCFS sche...">
|
||||
<polygon fill="#999999" stroke="#666666" points="85,-19.25 0,-19.25 0,0 85,0 85,-19.25"/>
|
||||
<text text-anchor="middle" x="42.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_final_status</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../df/d47/fcfs__scheduling_8cpp.html#a18920aa331faf4476b251c8cdb2c2bec" target="_top" xlink:title="Comparator function for sorting a vector.">
|
||||
<polygon fill="white" stroke="#666666" points="166.25,-19.25 121,-19.25 121,0 166.25,0 166.25,-19.25"/>
|
||||
<text text-anchor="middle" x="143.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">sortcol</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M85.25,-9.62C93.24,-9.62 101.5,-9.62 109.18,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="109.14,-13.13 119.14,-9.63 109.14,-6.13 109.14,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
<style type='text/css'>
|
||||
<![CDATA[
|
||||
[data-mouse-over-selected='false'] { opacity: 0.7; }
|
||||
[data-mouse-over-selected='true'] { opacity: 1.0; }
|
||||
]]>
|
||||
</style>
|
||||
<script type="application/ecmascript"><![CDATA[
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
highlightEdges();
|
||||
highlightAdjacentNodes();
|
||||
});
|
||||
]]></script>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 2.6 KiB |
@@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: get_final_status Pages: 1 -->
|
||||
<svg width="174pt" height="27pt"
|
||||
viewBox="0.00 0.00 174.25 27.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 23.25)">
|
||||
<title>get_final_status</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Function to be used for testing purposes. This function guarantees the correct solution for FCFS sche...">
|
||||
<polygon fill="#999999" stroke="#666666" points="85,-19.25 0,-19.25 0,0 85,0 85,-19.25"/>
|
||||
<text text-anchor="middle" x="42.5" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_final_status</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../df/d47/fcfs__scheduling_8cpp.html#a18920aa331faf4476b251c8cdb2c2bec" target="_top" xlink:title="Comparator function for sorting a vector.">
|
||||
<polygon fill="white" stroke="#666666" points="166.25,-19.25 121,-19.25 121,0 166.25,0 166.25,-19.25"/>
|
||||
<text text-anchor="middle" x="143.62" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">sortcol</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M85.25,-9.62C93.24,-9.62 101.5,-9.62 109.18,-9.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="109.14,-13.13 119.14,-9.63 109.14,-6.13 109.14,-13.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -1,17 +0,0 @@
|
||||
<map id="test" name="test">
|
||||
<area shape="rect" id="Node000001" title="Self-test implementations." alt="" coords="5,167,49,192"/>
|
||||
<area shape="rect" id="Node000002" href="$dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69" title="Adds the process to the ready queue if it isn't already there." alt="" coords="111,81,244,107"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="48,165,138,113,141,117,50,170"/>
|
||||
<area shape="rect" id="Node000006" href="$df/d47/fcfs__scheduling_8cpp.html#a8f2b90cb64d63a7080965e66a05ccf86" title="Function to be used for testing purposes. This function guarantees the correct solution for FCFS sche..." alt="" coords="121,167,234,192"/>
|
||||
<area shape="poly" id="edge5_Node000001_Node000006" title=" " alt="" coords="49,177,105,177,105,182,49,182"/>
|
||||
<area shape="rect" id="Node000008" href="$dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91" title="Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor..." alt="" coords="97,216,258,242"/>
|
||||
<area shape="poly" id="edge7_Node000001_Node000008" title=" " alt="" coords="50,185,98,202,116,208,114,213,96,207,48,190"/>
|
||||
<area shape="rect" id="Node000003" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_set/end.html#" title=" " alt="" coords="306,5,464,31"/>
|
||||
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="210,78,305,41,326,34,328,39,307,46,212,83"/>
|
||||
<area shape="rect" id="Node000004" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_set/find.html#" title=" " alt="" coords="320,55,450,96"/>
|
||||
<area shape="poly" id="edge3_Node000002_Node000004" title=" " alt="" coords="244,86,305,80,305,85,244,91"/>
|
||||
<area shape="rect" id="Node000005" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_set/insert.html#" title=" " alt="" coords="320,120,450,161"/>
|
||||
<area shape="poly" id="edge4_Node000002_Node000005" title=" " alt="" coords="239,105,306,120,305,126,237,110"/>
|
||||
<area shape="rect" id="Node000007" href="$df/d47/fcfs__scheduling_8cpp.html#a18920aa331faf4476b251c8cdb2c2bec" title="Comparator function for sorting a vector." alt="" coords="355,185,415,211"/>
|
||||
<area shape="poly" id="edge6_Node000006_Node000007" title=" " alt="" coords="234,182,340,191,339,197,234,187"/>
|
||||
</map>
|
||||
@@ -1 +0,0 @@
|
||||
f5516df712d2062d62bc91fd5718e722
|
||||
@@ -1,175 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: test Pages: 1 -->
|
||||
<svg width="352pt" height="185pt"
|
||||
viewBox="0.00 0.00 352.25 185.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
.node, .edge {opacity: 0.7;}
|
||||
.node.selected, .edge.selected {opacity: 1;}
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 181.25)">
|
||||
<title>test</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Self-test implementations.">
|
||||
<polygon fill="#999999" stroke="#666666" points="32.5,-56.25 0,-56.25 0,-37 32.5,-37 32.5,-56.25"/>
|
||||
<text text-anchor="middle" x="16.25" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69" target="_top" xlink:title="Adds the process to the ready queue if it isn't already there.">
|
||||
<polygon fill="white" stroke="#666666" points="179,-120.25 79,-120.25 79,-101 179,-101 179,-120.25"/>
|
||||
<text text-anchor="middle" x="129" y="-106.75" font-family="Helvetica,sans-Serif" font-size="10.00">FCFS::addProcess</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M32.65,-55.52C50.22,-65.68 79.29,-82.48 100.72,-94.86"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="98.82,-97.81 109.23,-99.78 102.33,-91.75 98.82,-97.81"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:href="../../df/d47/fcfs__scheduling_8cpp.html#a8f2b90cb64d63a7080965e66a05ccf86" target="_top" xlink:title="Function to be used for testing purposes. This function guarantees the correct solution for FCFS sche...">
|
||||
<polygon fill="white" stroke="#666666" points="171.5,-56.25 86.5,-56.25 86.5,-37 171.5,-37 171.5,-56.25"/>
|
||||
<text text-anchor="middle" x="129" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_final_status</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node6 -->
|
||||
<g id="edge5_Node000001_Node000006" class="edge">
|
||||
<title>Node1->Node6</title>
|
||||
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M32.65,-46.62C43.75,-46.62 59.43,-46.62 74.87,-46.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="74.5,-50.13 84.5,-46.63 74.5,-43.13 74.5,-50.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node8 -->
|
||||
<g id="Node000008" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_Node000008"><a xlink:href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91" target="_top" xlink:title="Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor...">
|
||||
<polygon fill="white" stroke="#666666" points="189.5,-19.25 68.5,-19.25 68.5,0 189.5,0 189.5,-19.25"/>
|
||||
<text text-anchor="middle" x="129" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">FCFS::scheduleForFcfs</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node8 -->
|
||||
<g id="edge7_Node000001_Node000008" class="edge">
|
||||
<title>Node1->Node8</title>
|
||||
<g id="a_edge7_Node000001_Node000008"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M32.86,-40.55C42.97,-36.69 56.45,-31.68 68.5,-27.62 72.99,-26.12 77.69,-24.6 82.39,-23.11"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="83.31,-26.49 91.83,-20.19 81.24,-19.8 83.31,-26.49"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_set/end.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="344.25,-177.25 225.5,-177.25 225.5,-158 344.25,-158 344.25,-177.25"/>
|
||||
<text text-anchor="middle" x="284.88" y="-163.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_set::end</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2_Node000002_Node000003" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M154.17,-120.74C173.38,-128.66 201,-139.77 225.5,-148.62 230.5,-150.43 235.77,-152.25 241.01,-154.02"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="239.6,-157.24 250.2,-157.06 241.8,-150.6 239.6,-157.24"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_set/find.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="333.38,-139.88 236.38,-139.88 236.38,-109.38 333.38,-109.38 333.38,-139.88"/>
|
||||
<text text-anchor="start" x="244.38" y="-126.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_set</text>
|
||||
<text text-anchor="middle" x="284.88" y="-115.12" font-family="Helvetica,sans-Serif" font-size="10.00">::find</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node4 -->
|
||||
<g id="edge3_Node000002_Node000004" class="edge">
|
||||
<title>Node2->Node4</title>
|
||||
<g id="a_edge3_Node000002_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M179.11,-115.09C193.62,-116.41 209.65,-117.87 224.72,-119.24"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="224.24,-122.71 234.51,-120.13 224.87,-115.74 224.24,-122.71"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_set/insert.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="333.38,-90.88 236.38,-90.88 236.38,-60.38 333.38,-60.38 333.38,-90.88"/>
|
||||
<text text-anchor="start" x="244.38" y="-77.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_set</text>
|
||||
<text text-anchor="middle" x="284.88" y="-66.12" font-family="Helvetica,sans-Serif" font-size="10.00">::insert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node5 -->
|
||||
<g id="edge4_Node000002_Node000005" class="edge">
|
||||
<title>Node2->Node5</title>
|
||||
<g id="a_edge4_Node000002_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M174.51,-100.5C190.31,-96.91 208.34,-92.81 225.14,-88.98"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="225.52,-92.49 234.5,-86.86 223.97,-85.66 225.52,-92.49"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:href="../../df/d47/fcfs__scheduling_8cpp.html#a18920aa331faf4476b251c8cdb2c2bec" target="_top" xlink:title="Comparator function for sorting a vector.">
|
||||
<polygon fill="white" stroke="#666666" points="307.5,-42.25 262.25,-42.25 262.25,-23 307.5,-23 307.5,-42.25"/>
|
||||
<text text-anchor="middle" x="284.88" y="-28.75" font-family="Helvetica,sans-Serif" font-size="10.00">sortcol</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6->Node7 -->
|
||||
<g id="edge6_Node000006_Node000007" class="edge">
|
||||
<title>Node6->Node7</title>
|
||||
<g id="a_edge6_Node000006_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M171.64,-42.84C196.5,-40.57 227.64,-37.74 250.81,-35.63"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="250.97,-39.13 260.61,-34.74 250.34,-32.16 250.97,-39.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
<style type='text/css'>
|
||||
<![CDATA[
|
||||
[data-mouse-over-selected='false'] { opacity: 0.7; }
|
||||
[data-mouse-over-selected='true'] { opacity: 1.0; }
|
||||
]]>
|
||||
</style>
|
||||
<script type="application/ecmascript"><![CDATA[
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
highlightEdges();
|
||||
highlightAdjacentNodes();
|
||||
});
|
||||
]]></script>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 8.0 KiB |
@@ -1,149 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: test Pages: 1 -->
|
||||
<svg width="352pt" height="185pt"
|
||||
viewBox="0.00 0.00 352.25 185.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 181.25)">
|
||||
<title>test</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Self-test implementations.">
|
||||
<polygon fill="#999999" stroke="#666666" points="32.5,-56.25 0,-56.25 0,-37 32.5,-37 32.5,-56.25"/>
|
||||
<text text-anchor="middle" x="16.25" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69" target="_top" xlink:title="Adds the process to the ready queue if it isn't already there.">
|
||||
<polygon fill="white" stroke="#666666" points="179,-120.25 79,-120.25 79,-101 179,-101 179,-120.25"/>
|
||||
<text text-anchor="middle" x="129" y="-106.75" font-family="Helvetica,sans-Serif" font-size="10.00">FCFS::addProcess</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M32.65,-55.52C50.22,-65.68 79.29,-82.48 100.72,-94.86"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="98.82,-97.81 109.23,-99.78 102.33,-91.75 98.82,-97.81"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a xlink:href="../../df/d47/fcfs__scheduling_8cpp.html#a8f2b90cb64d63a7080965e66a05ccf86" target="_top" xlink:title="Function to be used for testing purposes. This function guarantees the correct solution for FCFS sche...">
|
||||
<polygon fill="white" stroke="#666666" points="171.5,-56.25 86.5,-56.25 86.5,-37 171.5,-37 171.5,-56.25"/>
|
||||
<text text-anchor="middle" x="129" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_final_status</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node6 -->
|
||||
<g id="edge5_Node000001_Node000006" class="edge">
|
||||
<title>Node1->Node6</title>
|
||||
<g id="a_edge5_Node000001_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M32.65,-46.62C43.75,-46.62 59.43,-46.62 74.87,-46.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="74.5,-50.13 84.5,-46.63 74.5,-43.13 74.5,-50.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node8 -->
|
||||
<g id="Node000008" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_Node000008"><a xlink:href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91" target="_top" xlink:title="Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor...">
|
||||
<polygon fill="white" stroke="#666666" points="189.5,-19.25 68.5,-19.25 68.5,0 189.5,0 189.5,-19.25"/>
|
||||
<text text-anchor="middle" x="129" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">FCFS::scheduleForFcfs</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node8 -->
|
||||
<g id="edge7_Node000001_Node000008" class="edge">
|
||||
<title>Node1->Node8</title>
|
||||
<g id="a_edge7_Node000001_Node000008"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M32.86,-40.55C42.97,-36.69 56.45,-31.68 68.5,-27.62 72.99,-26.12 77.69,-24.6 82.39,-23.11"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="83.31,-26.49 91.83,-20.19 81.24,-19.8 83.31,-26.49"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_set/end.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="344.25,-177.25 225.5,-177.25 225.5,-158 344.25,-158 344.25,-177.25"/>
|
||||
<text text-anchor="middle" x="284.88" y="-163.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_set::end</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2_Node000002_Node000003" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M154.17,-120.74C173.38,-128.66 201,-139.77 225.5,-148.62 230.5,-150.43 235.77,-152.25 241.01,-154.02"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="239.6,-157.24 250.2,-157.06 241.8,-150.6 239.6,-157.24"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_set/find.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="333.38,-139.88 236.38,-139.88 236.38,-109.38 333.38,-109.38 333.38,-139.88"/>
|
||||
<text text-anchor="start" x="244.38" y="-126.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_set</text>
|
||||
<text text-anchor="middle" x="284.88" y="-115.12" font-family="Helvetica,sans-Serif" font-size="10.00">::find</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node4 -->
|
||||
<g id="edge3_Node000002_Node000004" class="edge">
|
||||
<title>Node2->Node4</title>
|
||||
<g id="a_edge3_Node000002_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M179.11,-115.09C193.62,-116.41 209.65,-117.87 224.72,-119.24"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="224.24,-122.71 234.51,-120.13 224.87,-115.74 224.24,-122.71"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_set/insert.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="333.38,-90.88 236.38,-90.88 236.38,-60.38 333.38,-60.38 333.38,-90.88"/>
|
||||
<text text-anchor="start" x="244.38" y="-77.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_set</text>
|
||||
<text text-anchor="middle" x="284.88" y="-66.12" font-family="Helvetica,sans-Serif" font-size="10.00">::insert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node5 -->
|
||||
<g id="edge4_Node000002_Node000005" class="edge">
|
||||
<title>Node2->Node5</title>
|
||||
<g id="a_edge4_Node000002_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M174.51,-100.5C190.31,-96.91 208.34,-92.81 225.14,-88.98"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="225.52,-92.49 234.5,-86.86 223.97,-85.66 225.52,-92.49"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:href="../../df/d47/fcfs__scheduling_8cpp.html#a18920aa331faf4476b251c8cdb2c2bec" target="_top" xlink:title="Comparator function for sorting a vector.">
|
||||
<polygon fill="white" stroke="#666666" points="307.5,-42.25 262.25,-42.25 262.25,-23 307.5,-23 307.5,-42.25"/>
|
||||
<text text-anchor="middle" x="284.88" y="-28.75" font-family="Helvetica,sans-Serif" font-size="10.00">sortcol</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6->Node7 -->
|
||||
<g id="edge6_Node000006_Node000007" class="edge">
|
||||
<title>Node6->Node7</title>
|
||||
<g id="a_edge6_Node000006_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M171.64,-42.84C196.5,-40.57 227.64,-37.74 250.81,-35.63"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="250.97,-39.13 260.61,-34.74 250.34,-32.16 250.97,-39.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 7.3 KiB |
@@ -1,19 +0,0 @@
|
||||
<map id="main" name="main">
|
||||
<area shape="rect" id="Node000001" title="Entry point of the program." alt="" coords="5,167,55,192"/>
|
||||
<area shape="rect" id="Node000002" href="$df/d47/fcfs__scheduling_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" title="Self-test implementations." alt="" coords="103,167,146,192"/>
|
||||
<area shape="poly" id="edge1_Node000001_Node000002" title=" " alt="" coords="55,177,87,177,87,182,55,182"/>
|
||||
<area shape="rect" id="Node000003" href="$dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69" title="Adds the process to the ready queue if it isn't already there." alt="" coords="208,81,341,107"/>
|
||||
<area shape="poly" id="edge2_Node000002_Node000003" title=" " alt="" coords="145,165,236,113,238,117,148,170"/>
|
||||
<area shape="rect" id="Node000007" href="$df/d47/fcfs__scheduling_8cpp.html#a8f2b90cb64d63a7080965e66a05ccf86" title="Function to be used for testing purposes. This function guarantees the correct solution for FCFS sche..." alt="" coords="218,167,331,192"/>
|
||||
<area shape="poly" id="edge6_Node000002_Node000007" title=" " alt="" coords="146,177,202,177,202,182,146,182"/>
|
||||
<area shape="rect" id="Node000009" href="$dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91" title="Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor..." alt="" coords="194,216,355,242"/>
|
||||
<area shape="poly" id="edge8_Node000002_Node000009" title=" " alt="" coords="147,185,195,202,213,208,212,213,193,207,146,190"/>
|
||||
<area shape="rect" id="Node000004" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_set/end.html#" title=" " alt="" coords="403,5,562,31"/>
|
||||
<area shape="poly" id="edge3_Node000003_Node000004" title=" " alt="" coords="307,78,402,41,423,34,425,39,404,46,309,83"/>
|
||||
<area shape="rect" id="Node000005" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_set/find.html#" title=" " alt="" coords="418,55,547,96"/>
|
||||
<area shape="poly" id="edge4_Node000003_Node000005" title=" " alt="" coords="341,86,402,80,403,85,342,91"/>
|
||||
<area shape="rect" id="Node000006" href="/Users/runner/work/C-Plus-Plus/C-Plus-Plus/doc/cppreference-doxygen-web.tag.xml$cpp/container/unordered_set/insert.html#" title=" " alt="" coords="418,120,547,161"/>
|
||||
<area shape="poly" id="edge5_Node000003_Node000006" title=" " alt="" coords="336,105,403,120,402,126,335,110"/>
|
||||
<area shape="rect" id="Node000008" href="$df/d47/fcfs__scheduling_8cpp.html#a18920aa331faf4476b251c8cdb2c2bec" title="Comparator function for sorting a vector." alt="" coords="452,185,513,211"/>
|
||||
<area shape="poly" id="edge7_Node000007_Node000008" title=" " alt="" coords="332,182,437,191,437,197,331,187"/>
|
||||
</map>
|
||||
@@ -1 +0,0 @@
|
||||
06a59461d7d4976cb5e2234e5948888a
|
||||
@@ -1,193 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="425pt" height="185pt"
|
||||
viewBox="0.00 0.00 425.25 185.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
|
||||
<svg id="main" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve">
|
||||
|
||||
<style type="text/css"><![CDATA[
|
||||
.node, .edge {opacity: 0.7;}
|
||||
.node.selected, .edge.selected {opacity: 1;}
|
||||
.edge:hover path { stroke: red; }
|
||||
.edge:hover polygon { stroke: red; fill: red; }
|
||||
]]></style>
|
||||
<script type="application/ecmascript" xlink:href="../../svg.min.js"/>
|
||||
<svg id="graph" class="graph">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 181.25)">
|
||||
<title>main</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Entry point of the program.">
|
||||
<polygon fill="#999999" stroke="#666666" points="37,-56.25 0,-56.25 0,-37 37,-37 37,-56.25"/>
|
||||
<text text-anchor="middle" x="18.5" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../df/d47/fcfs__scheduling_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" target="_top" xlink:title="Self-test implementations.">
|
||||
<polygon fill="white" stroke="#666666" points="105.5,-56.25 73,-56.25 73,-37 105.5,-37 105.5,-56.25"/>
|
||||
<text text-anchor="middle" x="89.25" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.2,-46.62C44.58,-46.62 53.31,-46.62 61.45,-46.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.2,-50.13 71.2,-46.63 61.2,-43.13 61.2,-50.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69" target="_top" xlink:title="Adds the process to the ready queue if it isn't already there.">
|
||||
<polygon fill="white" stroke="#666666" points="252,-120.25 152,-120.25 152,-101 252,-101 252,-120.25"/>
|
||||
<text text-anchor="middle" x="202" y="-106.75" font-family="Helvetica,sans-Serif" font-size="10.00">FCFS::addProcess</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2_Node000002_Node000003" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M105.65,-55.52C123.22,-65.68 152.29,-82.48 173.72,-94.86"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="171.82,-97.81 182.23,-99.78 175.33,-91.75 171.82,-97.81"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:href="../../df/d47/fcfs__scheduling_8cpp.html#a8f2b90cb64d63a7080965e66a05ccf86" target="_top" xlink:title="Function to be used for testing purposes. This function guarantees the correct solution for FCFS sche...">
|
||||
<polygon fill="white" stroke="#666666" points="244.5,-56.25 159.5,-56.25 159.5,-37 244.5,-37 244.5,-56.25"/>
|
||||
<text text-anchor="middle" x="202" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_final_status</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node7 -->
|
||||
<g id="edge6_Node000002_Node000007" class="edge">
|
||||
<title>Node2->Node7</title>
|
||||
<g id="a_edge6_Node000002_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M105.65,-46.62C116.75,-46.62 132.43,-46.62 147.87,-46.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="147.5,-50.13 157.5,-46.63 147.5,-43.13 147.5,-50.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node9 -->
|
||||
<g id="Node000009" class="node">
|
||||
<title>Node9</title>
|
||||
<g id="a_Node000009"><a xlink:href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91" target="_top" xlink:title="Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor...">
|
||||
<polygon fill="white" stroke="#666666" points="262.5,-19.25 141.5,-19.25 141.5,0 262.5,0 262.5,-19.25"/>
|
||||
<text text-anchor="middle" x="202" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">FCFS::scheduleForFcfs</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node9 -->
|
||||
<g id="edge8_Node000002_Node000009" class="edge">
|
||||
<title>Node2->Node9</title>
|
||||
<g id="a_edge8_Node000002_Node000009"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M105.86,-40.55C115.97,-36.69 129.45,-31.68 141.5,-27.62 145.99,-26.12 150.69,-24.6 155.39,-23.11"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="156.31,-26.49 164.83,-20.19 154.24,-19.8 156.31,-26.49"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_set/end.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="417.25,-177.25 298.5,-177.25 298.5,-158 417.25,-158 417.25,-177.25"/>
|
||||
<text text-anchor="middle" x="357.88" y="-163.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_set::end</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node4 -->
|
||||
<g id="edge3_Node000003_Node000004" class="edge">
|
||||
<title>Node3->Node4</title>
|
||||
<g id="a_edge3_Node000003_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M227.17,-120.74C246.38,-128.66 274,-139.77 298.5,-148.62 303.5,-150.43 308.77,-152.25 314.01,-154.02"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="312.6,-157.24 323.2,-157.06 314.8,-150.6 312.6,-157.24"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_set/find.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="406.38,-139.88 309.38,-139.88 309.38,-109.38 406.38,-109.38 406.38,-139.88"/>
|
||||
<text text-anchor="start" x="317.38" y="-126.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_set</text>
|
||||
<text text-anchor="middle" x="357.88" y="-115.12" font-family="Helvetica,sans-Serif" font-size="10.00">::find</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node5 -->
|
||||
<g id="edge4_Node000003_Node000005" class="edge">
|
||||
<title>Node3->Node5</title>
|
||||
<g id="a_edge4_Node000003_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M252.11,-115.09C266.62,-116.41 282.65,-117.87 297.72,-119.24"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="297.24,-122.71 307.51,-120.13 297.87,-115.74 297.24,-122.71"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_set/insert.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="406.38,-90.88 309.38,-90.88 309.38,-60.38 406.38,-60.38 406.38,-90.88"/>
|
||||
<text text-anchor="start" x="317.38" y="-77.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_set</text>
|
||||
<text text-anchor="middle" x="357.88" y="-66.12" font-family="Helvetica,sans-Serif" font-size="10.00">::insert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node6 -->
|
||||
<g id="edge5_Node000003_Node000006" class="edge">
|
||||
<title>Node3->Node6</title>
|
||||
<g id="a_edge5_Node000003_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M247.51,-100.5C263.31,-96.91 281.34,-92.81 298.14,-88.98"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="298.52,-92.49 307.5,-86.86 296.97,-85.66 298.52,-92.49"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node8 -->
|
||||
<g id="Node000008" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_Node000008"><a xlink:href="../../df/d47/fcfs__scheduling_8cpp.html#a18920aa331faf4476b251c8cdb2c2bec" target="_top" xlink:title="Comparator function for sorting a vector.">
|
||||
<polygon fill="white" stroke="#666666" points="380.5,-42.25 335.25,-42.25 335.25,-23 380.5,-23 380.5,-42.25"/>
|
||||
<text text-anchor="middle" x="357.88" y="-28.75" font-family="Helvetica,sans-Serif" font-size="10.00">sortcol</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7->Node8 -->
|
||||
<g id="edge7_Node000007_Node000008" class="edge">
|
||||
<title>Node7->Node8</title>
|
||||
<g id="a_edge7_Node000007_Node000008"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M244.64,-42.84C269.5,-40.57 300.64,-37.74 323.81,-35.63"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="323.97,-39.13 333.61,-34.74 323.34,-32.16 323.97,-39.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
||||
|
||||
<style type='text/css'>
|
||||
<![CDATA[
|
||||
[data-mouse-over-selected='false'] { opacity: 0.7; }
|
||||
[data-mouse-over-selected='true'] { opacity: 1.0; }
|
||||
]]>
|
||||
</style>
|
||||
<script type="application/ecmascript"><![CDATA[
|
||||
document.addEventListener('DOMContentLoaded', (event) => {
|
||||
highlightEdges();
|
||||
highlightAdjacentNodes();
|
||||
});
|
||||
]]></script>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 8.9 KiB |
@@ -1,167 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
|
||||
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<!-- Generated by graphviz version 12.1.2 (20240928.0832)
|
||||
-->
|
||||
<!-- Title: main Pages: 1 -->
|
||||
<svg width="425pt" height="185pt"
|
||||
viewBox="0.00 0.00 425.25 185.25" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 181.25)">
|
||||
<title>main</title>
|
||||
<!-- Node1 -->
|
||||
<g id="Node000001" class="node">
|
||||
<title>Node1</title>
|
||||
<g id="a_Node000001"><a xlink:title="Entry point of the program.">
|
||||
<polygon fill="#999999" stroke="#666666" points="37,-56.25 0,-56.25 0,-37 37,-37 37,-56.25"/>
|
||||
<text text-anchor="middle" x="18.5" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">main</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2 -->
|
||||
<g id="Node000002" class="node">
|
||||
<title>Node2</title>
|
||||
<g id="a_Node000002"><a xlink:href="../../df/d47/fcfs__scheduling_8cpp.html#aa8dca7b867074164d5f45b0f3851269d" target="_top" xlink:title="Self-test implementations.">
|
||||
<polygon fill="white" stroke="#666666" points="105.5,-56.25 73,-56.25 73,-37 105.5,-37 105.5,-56.25"/>
|
||||
<text text-anchor="middle" x="89.25" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">test</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node1->Node2 -->
|
||||
<g id="edge1_Node000001_Node000002" class="edge">
|
||||
<title>Node1->Node2</title>
|
||||
<g id="a_edge1_Node000001_Node000002"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M37.2,-46.62C44.58,-46.62 53.31,-46.62 61.45,-46.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="61.2,-50.13 71.2,-46.63 61.2,-43.13 61.2,-50.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3 -->
|
||||
<g id="Node000003" class="node">
|
||||
<title>Node3</title>
|
||||
<g id="a_Node000003"><a xlink:href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69" target="_top" xlink:title="Adds the process to the ready queue if it isn't already there.">
|
||||
<polygon fill="white" stroke="#666666" points="252,-120.25 152,-120.25 152,-101 252,-101 252,-120.25"/>
|
||||
<text text-anchor="middle" x="202" y="-106.75" font-family="Helvetica,sans-Serif" font-size="10.00">FCFS::addProcess</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node3 -->
|
||||
<g id="edge2_Node000002_Node000003" class="edge">
|
||||
<title>Node2->Node3</title>
|
||||
<g id="a_edge2_Node000002_Node000003"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M105.65,-55.52C123.22,-65.68 152.29,-82.48 173.72,-94.86"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="171.82,-97.81 182.23,-99.78 175.33,-91.75 171.82,-97.81"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7 -->
|
||||
<g id="Node000007" class="node">
|
||||
<title>Node7</title>
|
||||
<g id="a_Node000007"><a xlink:href="../../df/d47/fcfs__scheduling_8cpp.html#a8f2b90cb64d63a7080965e66a05ccf86" target="_top" xlink:title="Function to be used for testing purposes. This function guarantees the correct solution for FCFS sche...">
|
||||
<polygon fill="white" stroke="#666666" points="244.5,-56.25 159.5,-56.25 159.5,-37 244.5,-37 244.5,-56.25"/>
|
||||
<text text-anchor="middle" x="202" y="-42.75" font-family="Helvetica,sans-Serif" font-size="10.00">get_final_status</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node7 -->
|
||||
<g id="edge6_Node000002_Node000007" class="edge">
|
||||
<title>Node2->Node7</title>
|
||||
<g id="a_edge6_Node000002_Node000007"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M105.65,-46.62C116.75,-46.62 132.43,-46.62 147.87,-46.62"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="147.5,-50.13 157.5,-46.63 147.5,-43.13 147.5,-50.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node9 -->
|
||||
<g id="Node000009" class="node">
|
||||
<title>Node9</title>
|
||||
<g id="a_Node000009"><a xlink:href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91" target="_top" xlink:title="Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor...">
|
||||
<polygon fill="white" stroke="#666666" points="262.5,-19.25 141.5,-19.25 141.5,0 262.5,0 262.5,-19.25"/>
|
||||
<text text-anchor="middle" x="202" y="-5.75" font-family="Helvetica,sans-Serif" font-size="10.00">FCFS::scheduleForFcfs</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node2->Node9 -->
|
||||
<g id="edge8_Node000002_Node000009" class="edge">
|
||||
<title>Node2->Node9</title>
|
||||
<g id="a_edge8_Node000002_Node000009"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M105.86,-40.55C115.97,-36.69 129.45,-31.68 141.5,-27.62 145.99,-26.12 150.69,-24.6 155.39,-23.11"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="156.31,-26.49 164.83,-20.19 154.24,-19.8 156.31,-26.49"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node4 -->
|
||||
<g id="Node000004" class="node">
|
||||
<title>Node4</title>
|
||||
<g id="a_Node000004"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_set/end.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="417.25,-177.25 298.5,-177.25 298.5,-158 417.25,-158 417.25,-177.25"/>
|
||||
<text text-anchor="middle" x="357.88" y="-163.75" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_set::end</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node4 -->
|
||||
<g id="edge3_Node000003_Node000004" class="edge">
|
||||
<title>Node3->Node4</title>
|
||||
<g id="a_edge3_Node000003_Node000004"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M227.17,-120.74C246.38,-128.66 274,-139.77 298.5,-148.62 303.5,-150.43 308.77,-152.25 314.01,-154.02"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="312.6,-157.24 323.2,-157.06 314.8,-150.6 312.6,-157.24"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node5 -->
|
||||
<g id="Node000005" class="node">
|
||||
<title>Node5</title>
|
||||
<g id="a_Node000005"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_set/find.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="406.38,-139.88 309.38,-139.88 309.38,-109.38 406.38,-109.38 406.38,-139.88"/>
|
||||
<text text-anchor="start" x="317.38" y="-126.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_set</text>
|
||||
<text text-anchor="middle" x="357.88" y="-115.12" font-family="Helvetica,sans-Serif" font-size="10.00">::find</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node5 -->
|
||||
<g id="edge4_Node000003_Node000005" class="edge">
|
||||
<title>Node3->Node5</title>
|
||||
<g id="a_edge4_Node000003_Node000005"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M252.11,-115.09C266.62,-116.41 282.65,-117.87 297.72,-119.24"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="297.24,-122.71 307.51,-120.13 297.87,-115.74 297.24,-122.71"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node6 -->
|
||||
<g id="Node000006" class="node">
|
||||
<title>Node6</title>
|
||||
<g id="a_Node000006"><a target="_blank" xlink:href="http://en.cppreference.com/w/cpp/container/unordered_set/insert.html#" xlink:title=" ">
|
||||
<polygon fill="white" stroke="#666666" points="406.38,-90.88 309.38,-90.88 309.38,-60.38 406.38,-60.38 406.38,-90.88"/>
|
||||
<text text-anchor="start" x="317.38" y="-77.38" font-family="Helvetica,sans-Serif" font-size="10.00">std::unordered_set</text>
|
||||
<text text-anchor="middle" x="357.88" y="-66.12" font-family="Helvetica,sans-Serif" font-size="10.00">::insert</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node3->Node6 -->
|
||||
<g id="edge5_Node000003_Node000006" class="edge">
|
||||
<title>Node3->Node6</title>
|
||||
<g id="a_edge5_Node000003_Node000006"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M247.51,-100.5C263.31,-96.91 281.34,-92.81 298.14,-88.98"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="298.52,-92.49 307.5,-86.86 296.97,-85.66 298.52,-92.49"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node8 -->
|
||||
<g id="Node000008" class="node">
|
||||
<title>Node8</title>
|
||||
<g id="a_Node000008"><a xlink:href="../../df/d47/fcfs__scheduling_8cpp.html#a18920aa331faf4476b251c8cdb2c2bec" target="_top" xlink:title="Comparator function for sorting a vector.">
|
||||
<polygon fill="white" stroke="#666666" points="380.5,-42.25 335.25,-42.25 335.25,-23 380.5,-23 380.5,-42.25"/>
|
||||
<text text-anchor="middle" x="357.88" y="-28.75" font-family="Helvetica,sans-Serif" font-size="10.00">sortcol</text>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
<!-- Node7->Node8 -->
|
||||
<g id="edge7_Node000007_Node000008" class="edge">
|
||||
<title>Node7->Node8</title>
|
||||
<g id="a_edge7_Node000007_Node000008"><a xlink:title=" ">
|
||||
<path fill="none" stroke="#63b8ff" d="M244.64,-42.84C269.5,-40.57 300.64,-37.74 323.81,-35.63"/>
|
||||
<polygon fill="#63b8ff" stroke="#63b8ff" points="323.97,-39.13 333.61,-34.74 323.34,-32.16 323.97,-39.13"/>
|
||||
</a>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 8.1 KiB |
358
df/d47/fcfs__scheduling_8cpp_source.html
Normal file
358
df/d47/fcfs__scheduling_8cpp_source.html
Normal file
@@ -0,0 +1,358 @@
|
||||
<!-- HTML header for doxygen 1.12.0-->
|
||||
<!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" lang="en-US">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>TheAlgorithms/C++: cpu_scheduling_algorithms/fcfs_scheduling.cpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
<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>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
|
||||
<script type="text/javascript">
|
||||
DoxygenAwesomeDarkModeToggle.init()
|
||||
</script>
|
||||
<script type="text/javascript" src="../../clipboard.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
<script type="text/javascript" src="../../navtree.js"></script>
|
||||
<script type="text/javascript" src="../../resize.js"></script>
|
||||
<script type="text/javascript" src="../../cookie.js"></script>
|
||||
<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>
|
||||
<script type="text/javascript">
|
||||
window.MathJax = {
|
||||
options: {
|
||||
ignoreHtmlClass: 'tex2jax_ignore',
|
||||
processHtmlClass: 'tex2jax_process'
|
||||
},
|
||||
loader: {
|
||||
load: ['[tex]/ams']
|
||||
},
|
||||
tex: {
|
||||
macros: {},
|
||||
packages: ['base','configmacros','ams']
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../../doxygen-awesome.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 id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">TheAlgorithms/C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">All the algorithms implemented in C++</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.12.0 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "../../search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(1); });
|
||||
/* @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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('../../',true,false,'search.php','Search',true);
|
||||
$(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:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function(){initNavTree('df/d47/fcfs__scheduling_8cpp_source.html','../../'); initResizable(true); });
|
||||
/* @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">
|
||||
<div id="MSearchResults">
|
||||
<div class="SRPage">
|
||||
<div id="SRIndex">
|
||||
<div id="SRResults"></div>
|
||||
<div class="SRStatus" id="Loading">Loading...</div>
|
||||
<div class="SRStatus" id="Searching">Searching...</div>
|
||||
<div class="SRStatus" id="NoMatches">No Matches</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">fcfs_scheduling.cpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../df/d47/fcfs__scheduling_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include <algorithm></span> </div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#include <cassert></span> </div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include <cstdint></span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#include <cstdlib></span> </div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include <ctime></span> </div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include <iomanip></span> </div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#include <iostream></span> </div>
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#include <queue></span> </div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#include <unordered_set></span> </div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include <vector></span> </div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="keyword">using </span>std::cin;</div>
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="keyword">using </span>std::cout;</div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="keyword">using </span>std::endl;</div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="keyword">using </span>std::get;</div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="keyword">using </span>std::left;</div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="keyword">using </span>std::make_tuple;</div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="keyword">using </span>std::priority_queue;</div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="keyword">using </span>std::rand;</div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="keyword">using </span>std::srand;</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="keyword">using </span>std::tuple;</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="keyword">using </span>std::unordered_set;</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="keyword">using </span>std::vector;</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="keyword">template</span> <<span class="keyword">typename</span> S, <span class="keyword">typename</span> T, <span class="keyword">typename</span> E></div>
|
||||
<div class="foldopen" id="foldopen00046" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="../../df/d47/fcfs__scheduling_8cpp.html#a18920aa331faf4476b251c8cdb2c2bec"> 46</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="../../df/d47/fcfs__scheduling_8cpp.html#a18920aa331faf4476b251c8cdb2c2bec">sortcol</a>(tuple<S, T, E>& t1, tuple<S, T, E>& t2) {</div>
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="keywordflow">if</span> (get<1>(t1) < get<1>(t2)) {</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (get<1>(t1) == get<1>(t2) && get<0>(t1) < get<0>(t2)) {</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> }</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span><span class="keyword">template</span> <<span class="keyword">typename</span> S, <span class="keyword">typename</span> T, <span class="keyword">typename</span> E></div>
|
||||
<div class="foldopen" id="foldopen00063" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"><a class="line" href="../../de/d4a/class_compare.html"> 63</a></span><span class="keyword">class </span><a class="code hl_class" href="../../de/d4a/class_compare.html">Compare</a> {</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keyword">public</span>:</div>
|
||||
<div class="foldopen" id="foldopen00076" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"><a class="line" href="../../de/d4a/class_compare.html#afbdf9a44adb49728dc704155d7d1570c"> 76</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../de/d4a/class_compare.html#afbdf9a44adb49728dc704155d7d1570c">operator()</a>(tuple<S, T, E, double, double, double>& t1,</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> tuple<S, T, E, double, double, double>& t2) {</div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="comment">// Compare arrival times</span></div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordflow">if</span> (get<1>(t2) < get<1>(t1)) {</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> }</div>
|
||||
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="comment">// If arrival times are same, then compare Process IDs</span></div>
|
||||
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keywordflow">else</span> <span class="keywordflow">if</span> (get<1>(t2) == get<1>(t1)) {</div>
|
||||
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordflow">return</span> get<0>(t2) < get<0>(t1);</div>
|
||||
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> }</div>
|
||||
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
||||
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> </div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span><span class="keyword">template</span> <<span class="keyword">typename</span> S, <span class="keyword">typename</span> T, <span class="keyword">typename</span> E></div>
|
||||
<div class="foldopen" id="foldopen00098" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"><a class="line" href="../../dd/dca/class_f_c_f_s.html"> 98</a></span><span class="keyword">class </span><a class="code hl_class" href="../../dd/dca/class_f_c_f_s.html">FCFS</a> {</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> priority_queue<tuple<S, T, E, double, double, double>,</div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> vector<tuple<S, T, E, double, double, double>>,</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <a class="code hl_class" href="../../de/d4a/class_compare.html">Compare<S, T, E></a>></div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"><a class="line" href="../../dd/dca/class_f_c_f_s.html#af2594e22a867b308e027623940193d46"> 112</a></span> <a class="code hl_variable" href="../../dd/dca/class_f_c_f_s.html#af2594e22a867b308e027623940193d46">schedule</a>;</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> </div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="comment">// Stores final status of all the processes after completing the execution.</span></div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> vector<tuple<S, T, E, double, double, double>> result;</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> </div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="comment">// Stores process IDs. Used for confirming absence of a process while adding</span></div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="comment">// it.</span></div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> unordered_set<S> idList;</div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> </div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keyword">public</span>:</div>
|
||||
<div class="foldopen" id="foldopen00130" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"><a class="line" href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69"> 130</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">addProcess</a>(S <span class="keywordtype">id</span>, T arrival, E burst) {</div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="comment">// Add if a process with process ID as id is not found in idList.</span></div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keywordflow">if</span> (idList.find(<span class="keywordtype">id</span>) == idList.end()) {</div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> tuple<S, T, E, double, double, double> t =</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> make_tuple(<span class="keywordtype">id</span>, arrival, burst, 0, 0, 0);</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <a class="code hl_variable" href="../../dd/dca/class_f_c_f_s.html#af2594e22a867b308e027623940193d46">schedule</a>.push(t);</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> idList.insert(<span class="keywordtype">id</span>);</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> }</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> </div>
|
||||
<div class="foldopen" id="foldopen00155" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"><a class="line" href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91"> 155</a></span> vector<tuple<S, T, E, double, double, double>> <a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">scheduleForFcfs</a>() {</div>
|
||||
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="comment">// Variable to keep track of time elapsed so far</span></div>
|
||||
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <span class="keywordtype">double</span> timeElapsed = 0;</div>
|
||||
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> </div>
|
||||
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="keywordflow">while</span> (!<a class="code hl_variable" href="../../dd/dca/class_f_c_f_s.html#af2594e22a867b308e027623940193d46">schedule</a>.empty()) {</div>
|
||||
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> tuple<S, T, E, double, double, double> cur = <a class="code hl_variable" href="../../dd/dca/class_f_c_f_s.html#af2594e22a867b308e027623940193d46">schedule</a>.top();</div>
|
||||
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> </div>
|
||||
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="comment">// If the current process arrived at time t2, the last process</span></div>
|
||||
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="comment">// completed its execution at time t1, and t2 > t1.</span></div>
|
||||
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="keywordflow">if</span> (get<1>(cur) > timeElapsed) {</div>
|
||||
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> timeElapsed += get<1>(cur) - timeElapsed;</div>
|
||||
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> }</div>
|
||||
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> </div>
|
||||
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <span class="comment">// Add Burst time to time elapsed</span></div>
|
||||
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> timeElapsed += get<2>(cur);</div>
|
||||
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> </div>
|
||||
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="comment">// Completion time of the current process will be same as time</span></div>
|
||||
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="comment">// elapsed so far</span></div>
|
||||
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> get<3>(cur) = timeElapsed;</div>
|
||||
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> </div>
|
||||
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> <span class="comment">// Turnaround time = Completion time - Arrival time</span></div>
|
||||
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> get<4>(cur) = get<3>(cur) - get<1>(cur);</div>
|
||||
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> </div>
|
||||
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> <span class="comment">// Waiting time = Turnaround time - Burst time</span></div>
|
||||
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> get<5>(cur) = get<4>(cur) - get<2>(cur);</div>
|
||||
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> </div>
|
||||
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> result.push_back(cur);</div>
|
||||
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <a class="code hl_variable" href="../../dd/dca/class_f_c_f_s.html#af2594e22a867b308e027623940193d46">schedule</a>.pop();</div>
|
||||
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> }</div>
|
||||
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="keywordflow">return</span> result;</div>
|
||||
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> </div>
|
||||
<div class="foldopen" id="foldopen00192" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"><a class="line" href="../../dd/dca/class_f_c_f_s.html#abb361a612b18bb189aa6d3c49288b793"> 192</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#abb361a612b18bb189aa6d3c49288b793">printResult</a>() {</div>
|
||||
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> cout << <span class="stringliteral">"Status of all the proceses post completion is as follows:"</span></div>
|
||||
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> </div>
|
||||
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> cout << std::setw(17) << left << <span class="stringliteral">"Process ID"</span> << std::setw(17) << left</div>
|
||||
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> << <span class="stringliteral">"Arrival Time"</span> << std::setw(17) << left << <span class="stringliteral">"Burst Time"</span></div>
|
||||
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> << std::setw(17) << left << <span class="stringliteral">"Completion Time"</span> << std::setw(17)</div>
|
||||
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> << left << <span class="stringliteral">"Turnaround Time"</span> << std::setw(17) << left</div>
|
||||
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> << <span class="stringliteral">"Waiting Time"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> </div>
|
||||
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i{}; i < result.size(); i++) {</div>
|
||||
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> cout << std::setprecision(2) << std::fixed << std::setw(17) << left</div>
|
||||
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> << get<0>(result[i]) << std::setw(17) << left</div>
|
||||
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> << get<1>(result[i]) << std::setw(17) << left</div>
|
||||
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> << get<2>(result[i]) << std::setw(17) << left</div>
|
||||
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> << get<3>(result[i]) << std::setw(17) << left</div>
|
||||
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> << get<4>(result[i]) << std::setw(17) << left</div>
|
||||
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> << get<5>(result[i]) << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> }</div>
|
||||
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> </div>
|
||||
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span><span class="keyword">template</span> <<span class="keyword">typename</span> S, <span class="keyword">typename</span> T, <span class="keyword">typename</span> E></div>
|
||||
<div class="foldopen" id="foldopen00226" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"><a class="line" href="../../df/d47/fcfs__scheduling_8cpp.html#a8f2b90cb64d63a7080965e66a05ccf86"> 226</a></span>vector<tuple<S, T, E, double, double, double>> <a class="code hl_function" href="../../df/d47/fcfs__scheduling_8cpp.html#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status</a>(</div>
|
||||
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> vector<tuple<uint32_t, uint32_t, uint32_t>> input) {</div>
|
||||
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> sort(input.begin(), input.end(), <a class="code hl_function" href="../../df/d47/fcfs__scheduling_8cpp.html#a18920aa331faf4476b251c8cdb2c2bec">sortcol<S, T, E></a>);</div>
|
||||
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> vector<tuple<S, T, E, double, double, double>> result(input.size());</div>
|
||||
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> <span class="keywordtype">double</span> timeElapsed = 0;</div>
|
||||
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i{}; i < input.size(); i++) {</div>
|
||||
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> T arrival = get<1>(input[i]);</div>
|
||||
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> E burst = get<2>(input[i]);</div>
|
||||
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> </div>
|
||||
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> <span class="keywordflow">if</span> (arrival > timeElapsed) {</div>
|
||||
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> timeElapsed += arrival - timeElapsed;</div>
|
||||
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> }</div>
|
||||
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> timeElapsed += burst;</div>
|
||||
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> <span class="keywordtype">double</span> completion = timeElapsed;</div>
|
||||
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> <span class="keywordtype">double</span> turnaround = completion - arrival;</div>
|
||||
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> <span class="keywordtype">double</span> waiting = turnaround - burst;</div>
|
||||
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> </div>
|
||||
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> get<0>(result[i]) = get<0>(input[i]);</div>
|
||||
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> get<1>(result[i]) = arrival;</div>
|
||||
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> get<2>(result[i]) = burst;</div>
|
||||
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> get<3>(result[i]) = completion;</div>
|
||||
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> get<4>(result[i]) = turnaround;</div>
|
||||
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> get<5>(result[i]) = waiting;</div>
|
||||
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> }</div>
|
||||
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> <span class="keywordflow">return</span> result;</div>
|
||||
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> </div>
|
||||
<div class="foldopen" id="foldopen00257" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"><a class="line" href="../../df/d47/fcfs__scheduling_8cpp.html#aa8dca7b867074164d5f45b0f3851269d"> 257</a></span><span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../df/d47/fcfs__scheduling_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>() {</div>
|
||||
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i{}; i < 1000; i++) {</div>
|
||||
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> srand(time(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> uint32_t n = 1 + rand() % 1000;</div>
|
||||
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> <a class="code hl_class" href="../../dd/dca/class_f_c_f_s.html">FCFS<uint32_t, uint32_t, uint32_t></a> readyQueue;</div>
|
||||
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> vector<tuple<uint32_t, uint32_t, uint32_t>> input(n);</div>
|
||||
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> </div>
|
||||
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> <span class="keywordflow">for</span> (uint32_t i{}; i < n; i++) {</div>
|
||||
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span> get<0>(input[i]) = i;</div>
|
||||
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> srand(time(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> get<1>(input[i]) = 1 + rand() % 10000;</div>
|
||||
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> srand(time(<span class="keyword">nullptr</span>));</div>
|
||||
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> get<2>(input[i]) = 1 + rand() % 10000;</div>
|
||||
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> }</div>
|
||||
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> </div>
|
||||
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> <span class="keywordflow">for</span> (uint32_t i{}; i < n; i++) {</div>
|
||||
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> readyQueue.<a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">addProcess</a>(get<0>(input[i]), get<1>(input[i]),</div>
|
||||
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> get<2>(input[i]));</div>
|
||||
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> }</div>
|
||||
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span> vector<tuple<uint32_t, uint32_t, uint32_t, double, double, double>></div>
|
||||
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> res = <a class="code hl_function" href="../../df/d47/fcfs__scheduling_8cpp.html#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status<uint32_t, uint32_t, uint32_t></a>(input);</div>
|
||||
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span> assert(res == readyQueue.<a class="code hl_function" href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">scheduleForFcfs</a>());</div>
|
||||
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> <span class="comment">// readyQueue.printResult();</span></div>
|
||||
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno"> 280</span> }</div>
|
||||
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno"> 281</span> cout << <span class="stringliteral">"All the tests have successfully passed!"</span> << <a class="code hl_define" href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a>;</div>
|
||||
<div class="line"><a id="l00282" name="l00282"></a><span class="lineno"> 282</span>}</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00283" name="l00283"></a><span class="lineno"> 283</span> </div>
|
||||
<div class="foldopen" id="foldopen00288" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"><a class="line" href="../../df/d47/fcfs__scheduling_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4"> 288</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="../../df/d47/fcfs__scheduling_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a>() {</div>
|
||||
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span> <a class="code hl_function" href="../../df/d47/fcfs__scheduling_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a>(); <span class="comment">// run self-test implementations</span></div>
|
||||
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> <span class="keywordflow">return</span> 0;</div>
|
||||
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno"> 291</span>}</div>
|
||||
</div>
|
||||
<div class="ttc" id="aclass_compare_html"><div class="ttname"><a href="../../de/d4a/class_compare.html">Compare</a></div><div class="ttdoc">Comparator class for priority queue.</div><div class="ttdef"><b>Definition</b> <a href="#l00063">fcfs_scheduling.cpp:63</a></div></div>
|
||||
<div class="ttc" id="aclass_compare_html_afbdf9a44adb49728dc704155d7d1570c"><div class="ttname"><a href="../../de/d4a/class_compare.html#afbdf9a44adb49728dc704155d7d1570c">Compare::operator()</a></div><div class="ttdeci">bool operator()(tuple< S, T, E, double, double, double > &t1, tuple< S, T, E, double, double, double > &t2)</div><div class="ttdoc">A comparator function that checks whether to swap the two tuples or not. to https://www....</div><div class="ttdef"><b>Definition</b> <a href="#l00076">fcfs_scheduling.cpp:76</a></div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html">FCFS</a></div><div class="ttdoc">Class which implements the FCFS scheduling algorithm.</div><div class="ttdef"><b>Definition</b> <a href="#l00098">fcfs_scheduling.cpp:98</a></div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html_a8fbfe4d85f7576b4a7aade07d29fbd69"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#a8fbfe4d85f7576b4a7aade07d29fbd69">FCFS::addProcess</a></div><div class="ttdeci">void addProcess(S id, T arrival, E burst)</div><div class="ttdoc">Adds the process to the ready queue if it isn't already there.</div><div class="ttdef"><b>Definition</b> <a href="#l00130">fcfs_scheduling.cpp:130</a></div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html_aa25dbe30ba9930b5a7c1a6d11758bd91"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#aa25dbe30ba9930b5a7c1a6d11758bd91">FCFS::scheduleForFcfs</a></div><div class="ttdeci">vector< tuple< S, T, E, double, double, double > > scheduleForFcfs()</div><div class="ttdoc">Algorithm for scheduling CPU processes according to the First Come First Serve(FCFS) scheduling algor...</div><div class="ttdef"><b>Definition</b> <a href="#l00155">fcfs_scheduling.cpp:155</a></div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html_abb361a612b18bb189aa6d3c49288b793"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#abb361a612b18bb189aa6d3c49288b793">FCFS::printResult</a></div><div class="ttdeci">void printResult()</div><div class="ttdoc">Utility function for printing the status of each process after execution.</div><div class="ttdef"><b>Definition</b> <a href="#l00192">fcfs_scheduling.cpp:192</a></div></div>
|
||||
<div class="ttc" id="aclass_f_c_f_s_html_af2594e22a867b308e027623940193d46"><div class="ttname"><a href="../../dd/dca/class_f_c_f_s.html#af2594e22a867b308e027623940193d46">FCFS::schedule</a></div><div class="ttdeci">priority_queue< tuple< S, T, E, double, double, double >, vector< tuple< S, T, E, double, double, double > >, Compare< S, T, E > > schedule</div><div class="ttdef"><b>Definition</b> <a href="#l00112">fcfs_scheduling.cpp:112</a></div></div>
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_a18920aa331faf4476b251c8cdb2c2bec"><div class="ttname"><a href="../../df/d47/fcfs__scheduling_8cpp.html#a18920aa331faf4476b251c8cdb2c2bec">sortcol</a></div><div class="ttdeci">bool sortcol(tuple< S, T, E > &t1, tuple< S, T, E > &t2)</div><div class="ttdoc">Comparator function for sorting a vector.</div><div class="ttdef"><b>Definition</b> <a href="#l00046">fcfs_scheduling.cpp:46</a></div></div>
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_a8f2b90cb64d63a7080965e66a05ccf86"><div class="ttname"><a href="../../df/d47/fcfs__scheduling_8cpp.html#a8f2b90cb64d63a7080965e66a05ccf86">get_final_status</a></div><div class="ttdeci">vector< tuple< S, T, E, double, double, double > > get_final_status(vector< tuple< uint32_t, uint32_t, uint32_t > > input)</div><div class="ttdoc">Function to be used for testing purposes. This function guarantees the correct solution for FCFS sche...</div><div class="ttdef"><b>Definition</b> <a href="#l00226">fcfs_scheduling.cpp:226</a></div></div>
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_aa8dca7b867074164d5f45b0f3851269d"><div class="ttname"><a href="../../df/d47/fcfs__scheduling_8cpp.html#aa8dca7b867074164d5f45b0f3851269d">test</a></div><div class="ttdeci">static void test()</div><div class="ttdoc">Self-test implementations.</div><div class="ttdef"><b>Definition</b> <a href="#l00257">fcfs_scheduling.cpp:257</a></div></div>
|
||||
<div class="ttc" id="afcfs__scheduling_8cpp_html_ae66f6b31b5ad750f1fe042a706a4e3d4"><div class="ttname"><a href="../../df/d47/fcfs__scheduling_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a></div><div class="ttdeci">int main()</div><div class="ttdoc">Entry point of the program.</div><div class="ttdef"><b>Definition</b> <a href="#l00288">fcfs_scheduling.cpp:288</a></div></div>
|
||||
<div class="ttc" id="amatrix__exponentiation_8cpp_html_a600eaf353befc174637855795f12d258"><div class="ttname"><a href="../../d7/d35/matrix__exponentiation_8cpp.html#a600eaf353befc174637855795f12d258">endl</a></div><div class="ttdeci">#define endl</div><div class="ttdef"><b>Definition</b> <a href="../../d7/d35/matrix__exponentiation_8cpp_source.html#l00036">matrix_exponentiation.cpp:36</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="../../dir_cc8e79ed9d2b7756c78e8d0c87c6c0c7.html">cpu_scheduling_algorithms</a></li><li class="navelem"><a class="el" href="../../df/d47/fcfs__scheduling_8cpp.html">fcfs_scheduling.cpp</a></li>
|
||||
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="../../doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0 </li>
|
||||
</ul>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,3 +1,4 @@
|
||||
<!-- HTML header for doxygen 1.12.0-->
|
||||
<!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" lang="en-US">
|
||||
<head>
|
||||
@@ -5,10 +6,15 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: data_structures/stack.hpp File Reference</title>
|
||||
<title>TheAlgorithms/C++: data_structures/stack.hpp File Reference</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
<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>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
|
||||
<script type="text/javascript">
|
||||
DoxygenAwesomeDarkModeToggle.init()
|
||||
</script>
|
||||
<script type="text/javascript" src="../../clipboard.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
@@ -18,14 +24,24 @@
|
||||
<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>
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
|
||||
jax: ["input/TeX","output/HTML-CSS"],
|
||||
});
|
||||
<script type="text/javascript">
|
||||
window.MathJax = {
|
||||
options: {
|
||||
ignoreHtmlClass: 'tex2jax_ignore',
|
||||
processHtmlClass: 'tex2jax_process'
|
||||
},
|
||||
loader: {
|
||||
load: ['[tex]/ams']
|
||||
},
|
||||
tex: {
|
||||
macros: {},
|
||||
packages: ['base','configmacros','ams']
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
|
||||
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
@@ -33,10 +49,11 @@ MathJax.Hub.Config({
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
<div id="projectname">TheAlgorithms/C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
<div id="projectbrief">All the algorithms implemented in C++</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -119,13 +136,18 @@ Include dependency graph for stack.hpp:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../df/deb/stack_8hpp__incl.svg" width="266" height="184"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
</div><div class="textblock"><div class="dynheader">
|
||||
This graph shows which files directly or indirectly include this file:</div>
|
||||
<div class="dyncontent">
|
||||
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d8/df9/stack_8hpp__dep__incl.svg" width="315" height="126"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe></div>
|
||||
</div>
|
||||
</div>
|
||||
<p><a href="../../df/d47/stack_8hpp_source.html">Go to the source code of this file.</a></p>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
|
||||
Classes</h2></td></tr>
|
||||
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d1/dc2/classstack.html">stack< ValueType ></a></td></tr>
|
||||
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">for <a class="elRef" target="_blank" href="http://en.cppreference.com/w/cpp/error/invalid_argument.html">std::invalid_argument</a> <a href="../../d1/dc2/classstack.html#details">More...</a><br /></td></tr>
|
||||
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">for std::invalid_argument <a href="../../d1/dc2/classstack.html#details">More...</a><br /></td></tr>
|
||||
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
@@ -133,6 +155,8 @@ Classes</h2></td></tr>
|
||||
<dl class="section author"><dt>Author</dt><dd>danghai </dd>
|
||||
<dd>
|
||||
<a href="https://github.com/vil02" target="_blank">Piotr Idzik</a> </dd></dl>
|
||||
|
||||
<p class="definition">Definition in file <a class="el" href="../../df/d47/stack_8hpp_source.html">stack.hpp</a>.</p>
|
||||
</div></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<!-- HTML header for doxygen 1.12.0-->
|
||||
<!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" lang="en-US">
|
||||
<head>
|
||||
@@ -5,10 +6,15 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.12.0"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Algorithms_in_C++: data_structures/stack.hpp Source File</title>
|
||||
<title>TheAlgorithms/C++: data_structures/stack.hpp Source File</title>
|
||||
<link rel="icon" href="../../favicon.svg" type="image/x-icon" />
|
||||
<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>
|
||||
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@xpack-3rd-party/doxygen-awesome-css@2.2.0-1/doxygen-awesome-darkmode-toggle.js"></script>
|
||||
<script type="text/javascript">
|
||||
DoxygenAwesomeDarkModeToggle.init()
|
||||
</script>
|
||||
<script type="text/javascript" src="../../clipboard.js"></script>
|
||||
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="../../navtreedata.js"></script>
|
||||
@@ -18,14 +24,24 @@
|
||||
<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>
|
||||
<script type="text/x-mathjax-config">
|
||||
MathJax.Hub.Config({
|
||||
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
|
||||
jax: ["input/TeX","output/HTML-CSS"],
|
||||
});
|
||||
<script type="text/javascript">
|
||||
window.MathJax = {
|
||||
options: {
|
||||
ignoreHtmlClass: 'tex2jax_ignore',
|
||||
processHtmlClass: 'tex2jax_process'
|
||||
},
|
||||
loader: {
|
||||
load: ['[tex]/ams']
|
||||
},
|
||||
tex: {
|
||||
macros: {},
|
||||
packages: ['base','configmacros','ams']
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script type="text/javascript" async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML/MathJax.js"></script>
|
||||
<script type="text/javascript" id="MathJax-script" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"></script>
|
||||
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../../doxygen-awesome.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
@@ -33,10 +49,11 @@ MathJax.Hub.Config({
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectlogo"><img alt="Logo" src="../../project_logo.png"/></td>
|
||||
<td id="projectalign">
|
||||
<div id="projectname">Algorithms_in_C++<span id="projectnumber"> 1.0.0</span>
|
||||
<div id="projectname">TheAlgorithms/C++<span id="projectnumber"> 1.0.0</span>
|
||||
</div>
|
||||
<div id="projectbrief">Set of algorithms implemented in C++.</div>
|
||||
<div id="projectbrief">All the algorithms implemented in C++</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -107,74 +124,60 @@ $(function(){initNavTree('df/d47/stack_8hpp_source.html','../../'); initResizabl
|
||||
<div class="headertitle"><div class="title">stack.hpp</div></div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<a href="../../df/d47/stack_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">/**</span></div>
|
||||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment"> * @file</span></div>
|
||||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment"> * @author danghai</span></div>
|
||||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment"> * @author [Piotr Idzik](https://github.com/vil02)</span></div>
|
||||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment"> * @brief This class specifies the basic operation on a stack as a linked list</span></div>
|
||||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment"> **/</span></div>
|
||||
<a href="../../df/d47/stack_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
|
||||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#ifndef DATA_STRUCTURES_STACK_HPP_</span></div>
|
||||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="preprocessor">#define DATA_STRUCTURES_STACK_HPP_</span></div>
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span> </div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <stdexcept></span> <span class="comment">/// for std::invalid_argument</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="preprocessor">#include <stdexcept></span> </div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include "<a class="code" href="../../d3/d09/node_8hpp.html">node.hpp</a>"</span> <span class="comment">/// for Node</span></div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">/** Definition of the stack class</span></div>
|
||||
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment"> * \tparam value_type type of data nodes of the linked list in the stack should</span></div>
|
||||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment"> * contain</span></div>
|
||||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment"> */</span></div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#include "<a class="code" href="../../d3/d09/node_8hpp.html">node.hpp</a>"</span> </div>
|
||||
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
|
||||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="keyword">template</span> <<span class="keyword">class</span> ValueType></div>
|
||||
<div class="foldopen" id="foldopen00019" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html"> 19</a></span><span class="keyword">class </span><a class="code hl_class" href="../../d1/dc2/classstack.html">stack</a> {</div>
|
||||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keyword">public</span>:</div>
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keyword">using </span>value_type = ValueType;</div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="comment"> /** Show stack */</span></div>
|
||||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
|
||||
<div class="foldopen" id="foldopen00024" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html#a8bce109630118a34faae717f72986033"> 24</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/dc2/classstack.html#a8bce109630118a34faae717f72986033">display</a>()<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Top --> "</span>;</div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> display_all(this-><a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/memory/shared_ptr/get.html">get</a>());</div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="charliteral">'\n'</span>;</div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a> << <span class="stringliteral">"Size of stack: "</span> << <a class="code hl_variable" href="../../d1/dc2/classstack.html#a0a6b2b93ec970296940798ee98a5072e">size</a> << <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a>;</div>
|
||||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> std::cout << <span class="stringliteral">"Top --> "</span>;</div>
|
||||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> display_all(this-><a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a>.get());</div>
|
||||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> std::cout << <span class="charliteral">'\n'</span>;</div>
|
||||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> std::cout << <span class="stringliteral">"Size of stack: "</span> << <a class="code hl_variable" href="../../d1/dc2/classstack.html#a0a6b2b93ec970296940798ee98a5072e">size</a> << std::endl;</div>
|
||||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> </div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector<value_type></a> toVector()<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordflow">return</span> push_all_to_vector(this-><a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a>.<a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/memory/shared_ptr/get.html">get</a>(), this->size);</div>
|
||||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> std::vector<value_type> toVector()<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordflow">return</span> push_all_to_vector(this-><a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a>.get(), this->size);</div>
|
||||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> }</div>
|
||||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keyword">private</span>:</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordtype">void</span> ensureNotEmpty()<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="../../d1/dc2/classstack.html#a163eb9a6206c874c9bf98d032fca11c5">isEmptyStack</a>()) {</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keywordflow">throw</span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/error/invalid_argument.html">std::invalid_argument</a>(<span class="stringliteral">"Stack is empty."</span>);</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <span class="keywordflow">throw</span> std::invalid_argument(<span class="stringliteral">"Stack is empty."</span>);</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> }</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> }</div>
|
||||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keyword">public</span>:<span class="comment"></span></div>
|
||||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span><span class="comment"> /** Determine whether the stack is empty */</span></div>
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keyword">public</span>:</div>
|
||||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html#a163eb9a6206c874c9bf98d032fca11c5"> 44</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="../../d1/dc2/classstack.html#a163eb9a6206c874c9bf98d032fca11c5">isEmptyStack</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (<a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a> == <span class="keyword">nullptr</span>); }</div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="comment"> /** Add new item to the stack */</span></div>
|
||||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
|
||||
<div class="foldopen" id="foldopen00047" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d"> 47</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">push</a>(<span class="keyword">const</span> value_type& item) {</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keyword">auto</span> newNode = <a class="code hl_functionRef" target="_blank" href="http://en.cppreference.com/w/cpp/memory/shared_ptr/make_shared.html">std::make_shared<Node<value_type></a>>();</div>
|
||||
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keyword">auto</span> newNode = std::make_shared<Node<value_type>>();</div>
|
||||
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> newNode->data = item;</div>
|
||||
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> newNode->next = <a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a>;</div>
|
||||
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a> = newNode;</div>
|
||||
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <a class="code hl_variable" href="../../d1/dc2/classstack.html#a0a6b2b93ec970296940798ee98a5072e">size</a>++;</div>
|
||||
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span><span class="comment"> /** Return the top element of the stack */</span></div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
|
||||
<div class="foldopen" id="foldopen00056" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709"> 56</a></span> value_type <a class="code hl_function" href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">top</a>()<span class="keyword"> const </span>{</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> ensureNotEmpty();</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordflow">return</span> <a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a>->data;</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span><span class="comment"> /** Remove the top element of the stack */</span></div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
|
||||
<div class="foldopen" id="foldopen00062" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0"> 62</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">pop</a>() {</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> ensureNotEmpty();</div>
|
||||
@@ -182,8 +185,7 @@ $(function(){initNavTree('df/d47/stack_8hpp_source.html','../../'); initResizabl
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <a class="code hl_variable" href="../../d1/dc2/classstack.html#a0a6b2b93ec970296940798ee98a5072e">size</a>--;</div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span><span class="comment"></span> </div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span><span class="comment"> /** Clear stack */</span></div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> </div>
|
||||
<div class="foldopen" id="foldopen00069" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html#a6f13157faa1a762c59e67da8b9516092"> 69</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="../../d1/dc2/classstack.html#a6f13157faa1a762c59e67da8b9516092">clear</a>() {</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a> = <span class="keyword">nullptr</span>;</div>
|
||||
@@ -193,32 +195,24 @@ $(function(){initNavTree('df/d47/stack_8hpp_source.html','../../'); initResizabl
|
||||
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> </div>
|
||||
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keyword">private</span>:</div>
|
||||
<div class="foldopen" id="foldopen00075" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8"> 75</a></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr<Node<value_type></a>> <a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a> =</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> {}; <span class="comment">/**< Pointer to the stack */</span></div>
|
||||
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8"> 75</a></span> std::shared_ptr<Node<value_type>> <a class="code hl_variable" href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stackTop</a> =</div>
|
||||
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> {}; </div>
|
||||
</div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html#a0a6b2b93ec970296940798ee98a5072e"> 77</a></span> <a class="code hl_classRef" target="_blank" href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a> <a class="code hl_variable" href="../../d1/dc2/classstack.html#a0a6b2b93ec970296940798ee98a5072e">size</a> = 0; <span class="comment">///< size of stack</span></div>
|
||||
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"><a class="line" href="../../d1/dc2/classstack.html#a0a6b2b93ec970296940798ee98a5072e"> 77</a></span> std::size_t <a class="code hl_variable" href="../../d1/dc2/classstack.html#a0a6b2b93ec970296940798ee98a5072e">size</a> = 0; </div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> </div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span><span class="preprocessor">#endif </span><span class="comment">// DATA_STRUCTURES_STACK_HPP_</span></div>
|
||||
<div class="ttc" id="abasic_ostream_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/basic_ostream.html">std::cout</a></div></div>
|
||||
<div class="ttc" id="aclassstack_html"><div class="ttname"><a href="../../d1/dc2/classstack.html">stack</a></div><div class="ttdoc">for std::invalid_argument</div><div class="ttdef"><b>Definition</b> stack.hpp:19</div></div>
|
||||
<div class="ttc" id="aclassstack_html_a0a6b2b93ec970296940798ee98a5072e"><div class="ttname"><a href="../../d1/dc2/classstack.html#a0a6b2b93ec970296940798ee98a5072e">stack::size</a></div><div class="ttdeci">std::size_t size</div><div class="ttdoc">size of stack</div><div class="ttdef"><b>Definition</b> stack.hpp:77</div></div>
|
||||
<div class="ttc" id="aclassstack_html_a163eb9a6206c874c9bf98d032fca11c5"><div class="ttname"><a href="../../d1/dc2/classstack.html#a163eb9a6206c874c9bf98d032fca11c5">stack::isEmptyStack</a></div><div class="ttdeci">bool isEmptyStack() const</div><div class="ttdef"><b>Definition</b> stack.hpp:44</div></div>
|
||||
<div class="ttc" id="aclassstack_html_a3647fb4418890f19e0dc414b8092b8b0"><div class="ttname"><a href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">stack::pop</a></div><div class="ttdeci">void pop()</div><div class="ttdef"><b>Definition</b> stack.hpp:62</div></div>
|
||||
<div class="ttc" id="aclassstack_html_a6f13157faa1a762c59e67da8b9516092"><div class="ttname"><a href="../../d1/dc2/classstack.html#a6f13157faa1a762c59e67da8b9516092">stack::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdef"><b>Definition</b> stack.hpp:69</div></div>
|
||||
<div class="ttc" id="aclassstack_html_a8bce109630118a34faae717f72986033"><div class="ttname"><a href="../../d1/dc2/classstack.html#a8bce109630118a34faae717f72986033">stack::display</a></div><div class="ttdeci">void display() const</div><div class="ttdef"><b>Definition</b> stack.hpp:24</div></div>
|
||||
<div class="ttc" id="aclassstack_html_a90df277532c23519aa7ac3c08ed90a1d"><div class="ttname"><a href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">stack::push</a></div><div class="ttdeci">void push(const value_type &item)</div><div class="ttdef"><b>Definition</b> stack.hpp:47</div></div>
|
||||
<div class="ttc" id="aclassstack_html_ae09630c4384903d187801921b2ddc709"><div class="ttname"><a href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">stack::top</a></div><div class="ttdeci">value_type top() const</div><div class="ttdef"><b>Definition</b> stack.hpp:56</div></div>
|
||||
<div class="ttc" id="aclassstack_html_aefb3dac828e32b4ec014ff4b5d43a6b8"><div class="ttname"><a href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stack::stackTop</a></div><div class="ttdeci">std::shared_ptr< Node< value_type > > stackTop</div><div class="ttdef"><b>Definition</b> stack.hpp:75</div></div>
|
||||
<div class="ttc" id="aendl_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/io/manip/endl.html">std::endl</a></div><div class="ttdeci">T endl(T... args)</div></div>
|
||||
<div class="ttc" id="aget_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/memory/shared_ptr/get.html">std::shared_ptr::get</a></div><div class="ttdeci">T get(T... args)</div></div>
|
||||
<div class="ttc" id="ainvalid_argument_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/error/invalid_argument.html">std::invalid_argument</a></div></div>
|
||||
<div class="ttc" id="amake_shared_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/memory/shared_ptr/make_shared.html">std::make_shared</a></div><div class="ttdeci">T make_shared(T... args)</div></div>
|
||||
<div class="ttc" id="aclassstack_html"><div class="ttname"><a href="../../d1/dc2/classstack.html">stack</a></div><div class="ttdoc">for std::invalid_argument</div><div class="ttdef"><b>Definition</b> <a href="#l00019">stack.hpp:19</a></div></div>
|
||||
<div class="ttc" id="aclassstack_html_a0a6b2b93ec970296940798ee98a5072e"><div class="ttname"><a href="../../d1/dc2/classstack.html#a0a6b2b93ec970296940798ee98a5072e">stack::size</a></div><div class="ttdeci">std::size_t size</div><div class="ttdoc">size of stack</div><div class="ttdef"><b>Definition</b> <a href="#l00077">stack.hpp:77</a></div></div>
|
||||
<div class="ttc" id="aclassstack_html_a163eb9a6206c874c9bf98d032fca11c5"><div class="ttname"><a href="../../d1/dc2/classstack.html#a163eb9a6206c874c9bf98d032fca11c5">stack::isEmptyStack</a></div><div class="ttdeci">bool isEmptyStack() const</div><div class="ttdef"><b>Definition</b> <a href="#l00044">stack.hpp:44</a></div></div>
|
||||
<div class="ttc" id="aclassstack_html_a3647fb4418890f19e0dc414b8092b8b0"><div class="ttname"><a href="../../d1/dc2/classstack.html#a3647fb4418890f19e0dc414b8092b8b0">stack::pop</a></div><div class="ttdeci">void pop()</div><div class="ttdef"><b>Definition</b> <a href="#l00062">stack.hpp:62</a></div></div>
|
||||
<div class="ttc" id="aclassstack_html_a6f13157faa1a762c59e67da8b9516092"><div class="ttname"><a href="../../d1/dc2/classstack.html#a6f13157faa1a762c59e67da8b9516092">stack::clear</a></div><div class="ttdeci">void clear()</div><div class="ttdef"><b>Definition</b> <a href="#l00069">stack.hpp:69</a></div></div>
|
||||
<div class="ttc" id="aclassstack_html_a8bce109630118a34faae717f72986033"><div class="ttname"><a href="../../d1/dc2/classstack.html#a8bce109630118a34faae717f72986033">stack::display</a></div><div class="ttdeci">void display() const</div><div class="ttdef"><b>Definition</b> <a href="#l00024">stack.hpp:24</a></div></div>
|
||||
<div class="ttc" id="aclassstack_html_a90df277532c23519aa7ac3c08ed90a1d"><div class="ttname"><a href="../../d1/dc2/classstack.html#a90df277532c23519aa7ac3c08ed90a1d">stack::push</a></div><div class="ttdeci">void push(const value_type &item)</div><div class="ttdef"><b>Definition</b> <a href="#l00047">stack.hpp:47</a></div></div>
|
||||
<div class="ttc" id="aclassstack_html_ae09630c4384903d187801921b2ddc709"><div class="ttname"><a href="../../d1/dc2/classstack.html#ae09630c4384903d187801921b2ddc709">stack::top</a></div><div class="ttdeci">value_type top() const</div><div class="ttdef"><b>Definition</b> <a href="#l00056">stack.hpp:56</a></div></div>
|
||||
<div class="ttc" id="aclassstack_html_aefb3dac828e32b4ec014ff4b5d43a6b8"><div class="ttname"><a href="../../d1/dc2/classstack.html#aefb3dac828e32b4ec014ff4b5d43a6b8">stack::stackTop</a></div><div class="ttdeci">std::shared_ptr< Node< value_type > > stackTop</div><div class="ttdef"><b>Definition</b> <a href="#l00075">stack.hpp:75</a></div></div>
|
||||
<div class="ttc" id="anode_8hpp_html"><div class="ttname"><a href="../../d3/d09/node_8hpp.html">node.hpp</a></div><div class="ttdoc">Provides Node class and related utilities.</div></div>
|
||||
<div class="ttc" id="ashared_ptr_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/memory/shared_ptr.html">std::shared_ptr</a></div></div>
|
||||
<div class="ttc" id="asize_t_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/types/size_t.html">std::size_t</a></div></div>
|
||||
<div class="ttc" id="avector_html"><div class="ttname"><a href="http://en.cppreference.com/w/cpp/container/vector.html">std::vector</a></div></div>
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
</div><!-- doc-content -->
|
||||
<!-- start footer part -->
|
||||
|
||||
Reference in New Issue
Block a user