forked from aaronbloomfield/pdr
-
Notifications
You must be signed in to change notification settings - Fork 228
/
middleearth.h.html
45 lines (38 loc) · 3.71 KB
/
middleearth.h.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="GNU source-highlight
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite">
<title>middleearth.h</title>
</head>
<body style="background-color:white">
<pre><b><span style="color:#000080">#ifndef</span></b> MIDDLEEARTH_H
<b><span style="color:#000080">#define</span></b> MIDDLEEARTH_H
<b><span style="color:#000080">#include</span></b> <span style="color:#FF0000"><iostream></span>
<b><span style="color:#000080">#include</span></b> <span style="color:#FF0000"><vector></span>
<b><span style="color:#000080">#include</span></b> <span style="color:#FF0000"><string></span>
<b><span style="color:#000080">#include</span></b> <span style="color:#FF0000"><unordered_map></span>
<b><span style="color:#000080">#include</span></b> <span style="color:#FF0000"><random></span>
<b><span style="color:#0000FF">using</span></b> <b><span style="color:#0000FF">namespace</span></b> std<span style="color:#990000">;</span>
<i><span style="color:#9A1900">// see the comments in the lab11 write-up, or in middleearth.cpp</span></i>
<b><span style="color:#0000FF">class</span></b> <span style="color:#008080">MiddleEarth</span> <span style="color:#FF0000">{</span>
<b><span style="color:#0000FF">public</span></b><span style="color:#990000">:</span>
<b><span style="color:#000000">MiddleEarth</span></b><span style="color:#990000">(</span><span style="color:#009900">int</span> xsize<span style="color:#990000">,</span> <span style="color:#009900">int</span> ysize<span style="color:#990000">,</span> <span style="color:#009900">int</span> num_cities<span style="color:#990000">,</span> <span style="color:#009900">int</span> seed<span style="color:#990000">);</span>
<span style="color:#009900">void</span> <b><span style="color:#000000">print</span></b><span style="color:#990000">();</span>
<span style="color:#009900">void</span> <b><span style="color:#000000">printTable</span></b><span style="color:#990000">();</span>
<span style="color:#009900">float</span> <b><span style="color:#000000">getDistance</span></b><span style="color:#990000">(</span><b><span style="color:#0000FF">const</span></b> string<span style="color:#990000">&</span> city1<span style="color:#990000">,</span> <b><span style="color:#0000FF">const</span></b> string<span style="color:#990000">&</span> city2<span style="color:#990000">);</span>
<span style="color:#008080">vector<string></span> <b><span style="color:#000000">getItinerary</span></b><span style="color:#990000">(</span><span style="color:#009900">unsigned</span> <span style="color:#009900">int</span> length<span style="color:#990000">);</span>
<b><span style="color:#0000FF">private</span></b><span style="color:#990000">:</span>
<span style="color:#009900">int</span> num_city_names<span style="color:#990000">,</span> xsize<span style="color:#990000">,</span> ysize<span style="color:#990000">;</span>
<span style="color:#008080">unordered_map<string, float></span> xpos<span style="color:#990000">,</span> ypos<span style="color:#990000">;</span>
<span style="color:#008080">vector<string></span> cities<span style="color:#990000">;</span>
<span style="color:#008080">unordered_map<string, unordered_map<string, float>></span> distances<span style="color:#990000">;</span>
<span style="color:#008080">mt19937</span> gen<span style="color:#990000">;</span> <i><span style="color:#9A1900">// Mersenne-Twister random number engine</span></i>
<span style="color:#FF0000">}</span><span style="color:#990000">;</span>
<b><span style="color:#000080">#endif</span></b>
</pre>
</body>
</html>