1 | <!-- This comment will put IE 6, 7 and 8 in quirks mode --> |
---|
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
4 | <head> |
---|
5 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
---|
6 | <title>TSPSG: TSP Solver and Generator: TSPSolver::CTSPSolver Class Reference</title> |
---|
7 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
---|
8 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
---|
9 | <script type="text/javaScript" src="search/search.js"></script> |
---|
10 | <link href="doxygen.css" rel="stylesheet" type="text/css"/> |
---|
11 | </head> |
---|
12 | <body onload='searchBox.OnSelectItem(0);'> |
---|
13 | <!-- Generated by Doxygen 1.6.1 --> |
---|
14 | <script type="text/javascript"><!-- |
---|
15 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
---|
16 | --></script> |
---|
17 | <script type="text/javascript"> |
---|
18 | <!-- |
---|
19 | function changeDisplayState (e){ |
---|
20 | var num=this.id.replace(/[^[0-9]/g,''); |
---|
21 | var button=this.firstChild; |
---|
22 | var sectionDiv=document.getElementById('dynsection'+num); |
---|
23 | if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){ |
---|
24 | sectionDiv.style.display='block'; |
---|
25 | button.src='open.gif'; |
---|
26 | }else{ |
---|
27 | sectionDiv.style.display='none'; |
---|
28 | button.src='closed.gif'; |
---|
29 | } |
---|
30 | } |
---|
31 | function initDynSections(){ |
---|
32 | var divs=document.getElementsByTagName('div'); |
---|
33 | var sectionCounter=1; |
---|
34 | for(var i=0;i<divs.length-1;i++){ |
---|
35 | if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){ |
---|
36 | var header=divs[i]; |
---|
37 | var section=divs[i+1]; |
---|
38 | var button=header.firstChild; |
---|
39 | if (button!='IMG'){ |
---|
40 | divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild); |
---|
41 | button=document.createElement('img'); |
---|
42 | divs[i].insertBefore(button,divs[i].firstChild); |
---|
43 | } |
---|
44 | header.style.cursor='pointer'; |
---|
45 | header.onclick=changeDisplayState; |
---|
46 | header.id='dynheader'+sectionCounter; |
---|
47 | button.src='closed.gif'; |
---|
48 | section.id='dynsection'+sectionCounter; |
---|
49 | section.style.display='none'; |
---|
50 | section.style.marginLeft='14px'; |
---|
51 | sectionCounter++; |
---|
52 | } |
---|
53 | } |
---|
54 | } |
---|
55 | window.onload = initDynSections; |
---|
56 | --> |
---|
57 | </script> |
---|
58 | <div class="navigation" id="top"> |
---|
59 | <div class="tabs"> |
---|
60 | <ul> |
---|
61 | <li><a href="index.html"><span>Main Page</span></a></li> |
---|
62 | <li><a href="pages.html"><span>Related Pages</span></a></li> |
---|
63 | <li><a href="namespaces.html"><span>Namespaces</span></a></li> |
---|
64 | <li class="current"><a href="annotated.html"><span>Classes</span></a></li> |
---|
65 | <li><a href="files.html"><span>Files</span></a></li> |
---|
66 | <li> |
---|
67 | <div id="MSearchBox" class="MSearchBoxInactive"> |
---|
68 | <img id="MSearchSelect" src="search/search.png" |
---|
69 | onmouseover="return searchBox.OnSearchSelectShow()" |
---|
70 | onmouseout="return searchBox.OnSearchSelectHide()" |
---|
71 | alt=""/> |
---|
72 | <input type="text" id="MSearchField" value="Search" accesskey="S" |
---|
73 | onfocus="searchBox.OnSearchFieldFocus(true)" |
---|
74 | onblur="searchBox.OnSearchFieldFocus(false)" |
---|
75 | onkeyup="searchBox.OnSearchFieldChange(event)"/> |
---|
76 | <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> |
---|
77 | </div> |
---|
78 | </li> |
---|
79 | </ul> |
---|
80 | </div> |
---|
81 | <div class="tabs"> |
---|
82 | <ul> |
---|
83 | <li><a href="annotated.html"><span>Class List</span></a></li> |
---|
84 | <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> |
---|
85 | <li><a href="functions.html"><span>Class Members</span></a></li> |
---|
86 | </ul> |
---|
87 | </div> |
---|
88 | <div class="navpath"><a class="el" href="namespace_t_s_p_solver.html">TSPSolver</a>::<a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html">CTSPSolver</a> |
---|
89 | </div> |
---|
90 | </div> |
---|
91 | <div class="contents"> |
---|
92 | <h1>TSPSolver::CTSPSolver Class Reference</h1><!-- doxytag: class="TSPSolver::CTSPSolver" --><!-- doxytag: inherits="QObject" --> |
---|
93 | <p>This class solves Travelling Salesman Problem task. |
---|
94 | <a href="#_details">More...</a></p> |
---|
95 | |
---|
96 | <p><code>#include <<a class="el" href="tspsolver_8h_source.html">tspsolver.h</a>></code></p> |
---|
97 | <div class="dynheader"> |
---|
98 | Inheritance diagram for TSPSolver::CTSPSolver:</div> |
---|
99 | <div class="dynsection"> |
---|
100 | <div class="center"><img src="class_t_s_p_solver_1_1_c_t_s_p_solver__inherit__graph.png" border="0" usemap="#_t_s_p_solver_1_1_c_t_s_p_solver_inherit__map" alt="Inheritance graph"/></div> |
---|
101 | <map name="_t_s_p_solver_1_1_c_t_s_p_solver_inherit__map" id="_t_s_p_solver_1_1_c_t_s_p_solver_inherit__map"> |
---|
102 | <area shape="rect" id="node2" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qobject.html" title="QObject" alt="" coords="49,6,119,34"/> |
---|
103 | </map> |
---|
104 | <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> |
---|
105 | <div class="dynheader"> |
---|
106 | Collaboration diagram for TSPSolver::CTSPSolver:</div> |
---|
107 | <div class="dynsection"> |
---|
108 | <div class="center"><img src="class_t_s_p_solver_1_1_c_t_s_p_solver__coll__graph.png" border="0" usemap="#_t_s_p_solver_1_1_c_t_s_p_solver_coll__map" alt="Collaboration graph"/></div> |
---|
109 | <map name="_t_s_p_solver_1_1_c_t_s_p_solver_coll__map" id="_t_s_p_solver_1_1_c_t_s_p_solver_coll__map"> |
---|
110 | <area shape="rect" id="node2" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qobject.html" title="QObject" alt="" coords="5,109,75,137"/> |
---|
111 | <area shape="rect" id="node4" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qhash.html" title="QHash\< int, int \>" alt="" coords="99,109,219,137"/> |
---|
112 | <area shape="rect" id="node6" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qmutex.html" title="QMutex" alt="" coords="243,109,309,137"/> |
---|
113 | <area shape="rect" id="node8" href="struct_t_s_p_solver_1_1_s_step.html" title="This structure represents one step of solving." alt="" coords="333,109,459,137"/> |
---|
114 | <area shape="rect" id="node10" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html" title="QList\< QList\< double \> \>" alt="" coords="132,6,300,34"/> |
---|
115 | <area shape="rect" id="node12" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html" title="QList\< SCandidate \>" alt="" coords="324,6,468,34"/> |
---|
116 | <area shape="rect" id="node14" href="struct_t_s_p_solver_1_1_s_step_1_1_s_candidate.html" title="A structure that represents a candidate for branching." alt="" coords="492,6,692,34"/> |
---|
117 | </map> |
---|
118 | <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div> |
---|
119 | |
---|
120 | <p><a href="class_t_s_p_solver_1_1_c_t_s_p_solver-members.html">List of all members.</a></p> |
---|
121 | <table border="0" cellpadding="0" cellspacing="0"> |
---|
122 | <tr><td colspan="2"><h2>Public Slots</h2></td></tr> |
---|
123 | <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a46a3da58d4bb9431bea2c915ceaf1eea"></a><!-- doxytag: member="TSPSolver::CTSPSolver::cancel" ref="a46a3da58d4bb9431bea2c915ceaf1eea" args="()" --> |
---|
124 | void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#a46a3da58d4bb9431bea2c915ceaf1eea">cancel</a> ()</td></tr> |
---|
125 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Cancels the solution process. <br/></td></tr> |
---|
126 | <tr><td colspan="2"><h2>Signals</h2></td></tr> |
---|
127 | <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#a5e02867f053089a3e096f6baa70499a2">routePartFound</a> (int n)</td></tr> |
---|
128 | <tr><td class="mdescLeft"> </td><td class="mdescRight">This signal is emitted once every time a part of the route is found. <a href="#a5e02867f053089a3e096f6baa70499a2"></a><br/></td></tr> |
---|
129 | <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> |
---|
130 | <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#a71bebe073ed5149a4558a779410a2e6b">CTSPSolver</a> (<a class="elRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qobject.html">QObject</a> *<a class="elRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qobject.html#parent">parent</a>=NULL)</td></tr> |
---|
131 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs <a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html" title="This class solves Travelling Salesman Problem task.">CTSPSolver</a> object. <a href="#a71bebe073ed5149a4558a779410a2e6b"></a><br/></td></tr> |
---|
132 | <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#a3ef198959f1b4c32b84fbd5222f8b796">cleanup</a> (bool processEvents=false)</td></tr> |
---|
133 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Cleans up the object and frees up memory used by the solution tree. <a href="#a3ef198959f1b4c32b84fbd5222f8b796"></a><br/></td></tr> |
---|
134 | <tr><td class="memItemLeft" align="right" valign="top"><a class="elRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#a8897c0737ef2451ae606c38113477521">getSortedPath</a> (const <a class="elRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> &city, const <a class="elRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> &separator=" -> ") const </td></tr> |
---|
135 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the sorted optimal path, starting from City 1. <a href="#a8897c0737ef2451ae606c38113477521"></a><br/></td></tr> |
---|
136 | <tr><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#a721973cc992b62750aae6fd3ab65773d">getTotalSteps</a> () const </td></tr> |
---|
137 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a total number of steps in the current solution. <a href="#a721973cc992b62750aae6fd3ab65773d"></a><br/></td></tr> |
---|
138 | <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#a2b82ac68b981c47a3261f4e4e9ecd2bd">isOptimal</a> () const </td></tr> |
---|
139 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Indicates whether or not the solution is definitely optimal. <a href="#a2b82ac68b981c47a3261f4e4e9ecd2bd"></a><br/></td></tr> |
---|
140 | <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_t_s_p_solver_1_1_s_step.html">SStep</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#ab8a5a387deebffd898577dba31a95099">solve</a> (int numCities, const <a class="elRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> &task)</td></tr> |
---|
141 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Solves the given task. <a href="#ab8a5a387deebffd898577dba31a95099"></a><br/></td></tr> |
---|
142 | <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#a6cce9079d60735f92037c98d6d361a82">wasCanceled</a> () const </td></tr> |
---|
143 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Indicates whether or not the solution process was canceled. <a href="#a6cce9079d60735f92037c98d6d361a82"></a><br/></td></tr> |
---|
144 | <tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr> |
---|
145 | <tr><td class="memItemLeft" align="right" valign="top">static <a class="elRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#a71d04cbead3508cdff606a5ccc79e59e">getVersionId</a> ()</td></tr> |
---|
146 | <tr><td class="mdescLeft"> </td><td class="mdescRight">Returns CTSPSolver's version ID. <a href="#a71d04cbead3508cdff606a5ccc79e59e"></a><br/></td></tr> |
---|
147 | </table> |
---|
148 | <hr/><a name="_details"></a><h2>Detailed Description</h2> |
---|
149 | <p>This class solves Travelling Salesman Problem task. </p> |
---|
150 | <dl class="author"><dt><b>Author:</b></dt><dd>Copyright © 2007-2010 Lёppa <contacts[at]oleksii[dot]name> </dd></dl> |
---|
151 | <hr/><h2>Constructor & Destructor Documentation</h2> |
---|
152 | <a class="anchor" id="a71bebe073ed5149a4558a779410a2e6b"></a><!-- doxytag: member="TSPSolver::CTSPSolver::CTSPSolver" ref="a71bebe073ed5149a4558a779410a2e6b" args="(QObject *parent=NULL)" --> |
---|
153 | <div class="memitem"> |
---|
154 | <div class="memproto"> |
---|
155 | <table class="memname"> |
---|
156 | <tr> |
---|
157 | <td class="memname">TSPSolver::CTSPSolver::CTSPSolver </td> |
---|
158 | <td>(</td> |
---|
159 | <td class="paramtype"><a class="elRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qobject.html">QObject</a> * </td> |
---|
160 | <td class="paramname"> <em>parent</em> = <code>NULL</code></td> |
---|
161 | <td> ) </td> |
---|
162 | <td></td> |
---|
163 | </tr> |
---|
164 | </table> |
---|
165 | </div> |
---|
166 | <div class="memdoc"> |
---|
167 | |
---|
168 | <p>Constructs <a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html" title="This class solves Travelling Salesman Problem task.">CTSPSolver</a> object. </p> |
---|
169 | <dl><dt><b>Parameters:</b></dt><dd> |
---|
170 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
171 | <tr><td valign="top"></td><td valign="top"><em>parent</em> </td><td>A parent object. </td></tr> |
---|
172 | </table> |
---|
173 | </dd> |
---|
174 | </dl> |
---|
175 | |
---|
176 | </div> |
---|
177 | </div> |
---|
178 | <hr/><h2>Member Function Documentation</h2> |
---|
179 | <a class="anchor" id="a3ef198959f1b4c32b84fbd5222f8b796"></a><!-- doxytag: member="TSPSolver::CTSPSolver::cleanup" ref="a3ef198959f1b4c32b84fbd5222f8b796" args="(bool processEvents=false)" --> |
---|
180 | <div class="memitem"> |
---|
181 | <div class="memproto"> |
---|
182 | <table class="memname"> |
---|
183 | <tr> |
---|
184 | <td class="memname">void TSPSolver::CTSPSolver::cleanup </td> |
---|
185 | <td>(</td> |
---|
186 | <td class="paramtype">bool </td> |
---|
187 | <td class="paramname"> <em>processEvents</em> = <code>false</code></td> |
---|
188 | <td> ) </td> |
---|
189 | <td></td> |
---|
190 | </tr> |
---|
191 | </table> |
---|
192 | </div> |
---|
193 | <div class="memdoc"> |
---|
194 | |
---|
195 | <p>Cleans up the object and frees up memory used by the solution tree. </p> |
---|
196 | <dl><dt><b>Parameters:</b></dt><dd> |
---|
197 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
198 | <tr><td valign="top"></td><td valign="top"><em>processEvents</em> </td><td>If set to <code>true</code> then <a class="elRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qcoreapplication.html#processEvents">QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents)</a> will be called from time to time while cleaning up. </td></tr> |
---|
199 | </table> |
---|
200 | </dd> |
---|
201 | </dl> |
---|
202 | <dl class="warning"><dt><b>Warning:</b></dt><dd>After call to this function a solution tree returned by the <a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#ab8a5a387deebffd898577dba31a95099" title="Solves the given task.">solve()</a> function is no longer valid. </dd></dl> |
---|
203 | <dl class="note"><dt><b>Note:</b></dt><dd>It is not required to call this function manually. This function is always called by <a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#ab8a5a387deebffd898577dba31a95099" title="Solves the given task.">solve()</a> at the beginning of the solution process.</dd></dl> |
---|
204 | <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#ab8a5a387deebffd898577dba31a95099" title="Solves the given task.">solve()</a> </dd></dl> |
---|
205 | |
---|
206 | <p><div class="dynheader"> |
---|
207 | Here is the call graph for this function:</div> |
---|
208 | <div class="dynsection"> |
---|
209 | <div class="center"><img src="class_t_s_p_solver_1_1_c_t_s_p_solver_a3ef198959f1b4c32b84fbd5222f8b796_cgraph.png" border="0" usemap="#class_t_s_p_solver_1_1_c_t_s_p_solver_a3ef198959f1b4c32b84fbd5222f8b796_cgraph_map" alt=""></div> |
---|
210 | <map name="class_t_s_p_solver_1_1_c_t_s_p_solver_a3ef198959f1b4c32b84fbd5222f8b796_cgraph_map" id="class_t_s_p_solver_1_1_c_t_s_p_solver_a3ef198959f1b4c32b84fbd5222f8b796_cgraph"> |
---|
211 | <area shape="rect" id="node3" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qhash.html#clear" title="QHash::clear" alt="" coords="333,5,429,33"/> |
---|
212 | <area shape="rect" id="node5" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qapplication.html#restoreOverrideCursor" title="QApplication::restoreOverrideCursor" alt="" coords="268,55,495,83"/> |
---|
213 | <area shape="rect" id="node7" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qapplication.html#setOverrideCursor" title="QApplication::setOverrideCursor" alt="" coords="279,106,484,134"/> |
---|
214 | </map> |
---|
215 | </div> |
---|
216 | </p> |
---|
217 | |
---|
218 | <p><div class="dynheader"> |
---|
219 | Here is the caller graph for this function:</div> |
---|
220 | <div class="dynsection"> |
---|
221 | <div class="center"><img src="class_t_s_p_solver_1_1_c_t_s_p_solver_a3ef198959f1b4c32b84fbd5222f8b796_icgraph.png" border="0" usemap="#class_t_s_p_solver_1_1_c_t_s_p_solver_a3ef198959f1b4c32b84fbd5222f8b796_icgraph_map" alt=""></div> |
---|
222 | <map name="class_t_s_p_solver_1_1_c_t_s_p_solver_a3ef198959f1b4c32b84fbd5222f8b796_icgraph_map" id="class_t_s_p_solver_1_1_c_t_s_p_solver_a3ef198959f1b4c32b84fbd5222f8b796_icgraph"> |
---|
223 | <area shape="rect" id="node3" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#ab8a5a387deebffd898577dba31a95099" title="Solves the given task." alt="" coords="268,5,463,33"/> |
---|
224 | </map> |
---|
225 | </div> |
---|
226 | </p> |
---|
227 | |
---|
228 | </div> |
---|
229 | </div> |
---|
230 | <a class="anchor" id="a8897c0737ef2451ae606c38113477521"></a><!-- doxytag: member="TSPSolver::CTSPSolver::getSortedPath" ref="a8897c0737ef2451ae606c38113477521" args="(const QString &city, const QString &separator=" -> ") const " --> |
---|
231 | <div class="memitem"> |
---|
232 | <div class="memproto"> |
---|
233 | <table class="memname"> |
---|
234 | <tr> |
---|
235 | <td class="memname"><a class="elRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> TSPSolver::CTSPSolver::getSortedPath </td> |
---|
236 | <td>(</td> |
---|
237 | <td class="paramtype">const <a class="elRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> & </td> |
---|
238 | <td class="paramname"> <em>city</em>, </td> |
---|
239 | </tr> |
---|
240 | <tr> |
---|
241 | <td class="paramkey"></td> |
---|
242 | <td></td> |
---|
243 | <td class="paramtype">const <a class="elRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> & </td> |
---|
244 | <td class="paramname"> <em>separator</em> = <code>" -> "</code></td><td> </td> |
---|
245 | </tr> |
---|
246 | <tr> |
---|
247 | <td></td> |
---|
248 | <td>)</td> |
---|
249 | <td></td><td></td><td> const</td> |
---|
250 | </tr> |
---|
251 | </table> |
---|
252 | </div> |
---|
253 | <div class="memdoc"> |
---|
254 | |
---|
255 | <p>Returns the sorted optimal path, starting from City 1. </p> |
---|
256 | <dl><dt><b>Parameters:</b></dt><dd> |
---|
257 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
258 | <tr><td valign="top"></td><td valign="top"><em>city</em> </td><td>A string that represents city elements in the path. </td></tr> |
---|
259 | <tr><td valign="top"></td><td valign="top"><em>separator</em> </td><td>A string that represents separators between cities in the path. </td></tr> |
---|
260 | </table> |
---|
261 | </dd> |
---|
262 | </dl> |
---|
263 | <dl class="return"><dt><b>Returns:</b></dt><dd>A string, containing sorted optimal path.</dd></dl> |
---|
264 | <p>The resulting path will be in the form <em>city+<em>separator+<em>city+</em>.</em>.</em>.+<em>separator+<em>city</em>.</em> <code>%1</code> in <em>city</em> will be replaced by the city number. </p> |
---|
265 | |
---|
266 | <p><div class="dynheader"> |
---|
267 | Here is the call graph for this function:</div> |
---|
268 | <div class="dynsection"> |
---|
269 | <div class="center"><img src="class_t_s_p_solver_1_1_c_t_s_p_solver_a8897c0737ef2451ae606c38113477521_cgraph.png" border="0" usemap="#class_t_s_p_solver_1_1_c_t_s_p_solver_a8897c0737ef2451ae606c38113477521_cgraph_map" alt=""></div> |
---|
270 | <map name="class_t_s_p_solver_1_1_c_t_s_p_solver_a8897c0737ef2451ae606c38113477521_cgraph_map" id="class_t_s_p_solver_1_1_c_t_s_p_solver_a8897c0737ef2451ae606c38113477521_cgraph"> |
---|
271 | <area shape="rect" id="node3" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html#arg" title="QString::arg" alt="" coords="317,5,408,33"/> |
---|
272 | <area shape="rect" id="node5" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qhash.html#isEmpty" title="QHash::isEmpty" alt="" coords="304,55,421,83"/> |
---|
273 | <area shape="rect" id="node7" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstringlist.html#join" title="QStringList::join" alt="" coords="305,106,420,134"/> |
---|
274 | <area shape="rect" id="node9" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qhash.html#size" title="QHash::size" alt="" coords="316,157,409,185"/> |
---|
275 | </map> |
---|
276 | </div> |
---|
277 | </p> |
---|
278 | |
---|
279 | </div> |
---|
280 | </div> |
---|
281 | <a class="anchor" id="a721973cc992b62750aae6fd3ab65773d"></a><!-- doxytag: member="TSPSolver::CTSPSolver::getTotalSteps" ref="a721973cc992b62750aae6fd3ab65773d" args="() const " --> |
---|
282 | <div class="memitem"> |
---|
283 | <div class="memproto"> |
---|
284 | <table class="memname"> |
---|
285 | <tr> |
---|
286 | <td class="memname">int TSPSolver::CTSPSolver::getTotalSteps </td> |
---|
287 | <td>(</td> |
---|
288 | <td class="paramname"></td> |
---|
289 | <td> ) </td> |
---|
290 | <td> const</td> |
---|
291 | </tr> |
---|
292 | </table> |
---|
293 | </div> |
---|
294 | <div class="memdoc"> |
---|
295 | |
---|
296 | <p>Returns a total number of steps in the current solution. </p> |
---|
297 | <dl class="return"><dt><b>Returns:</b></dt><dd>A total number of steps or <code>0</code> if no solution. </dd></dl> |
---|
298 | <dl class="note"><dt><b>Note:</b></dt><dd>This is not always the same as the number of cities. </dd></dl> |
---|
299 | |
---|
300 | </div> |
---|
301 | </div> |
---|
302 | <a class="anchor" id="a71d04cbead3508cdff606a5ccc79e59e"></a><!-- doxytag: member="TSPSolver::CTSPSolver::getVersionId" ref="a71d04cbead3508cdff606a5ccc79e59e" args="()" --> |
---|
303 | <div class="memitem"> |
---|
304 | <div class="memproto"> |
---|
305 | <table class="memname"> |
---|
306 | <tr> |
---|
307 | <td class="memname"><a class="elRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qstring.html">QString</a> TSPSolver::CTSPSolver::getVersionId </td> |
---|
308 | <td>(</td> |
---|
309 | <td class="paramname"></td> |
---|
310 | <td> ) </td> |
---|
311 | <td><code> [static]</code></td> |
---|
312 | </tr> |
---|
313 | </table> |
---|
314 | </div> |
---|
315 | <div class="memdoc"> |
---|
316 | |
---|
317 | <p>Returns CTSPSolver's version ID. </p> |
---|
318 | <dl class="return"><dt><b>Returns:</b></dt><dd>A string: <b>$Id: tspsolver.cpp 110 2010-04-27 23:38:10Z laleppa $</b>. </dd></dl> |
---|
319 | |
---|
320 | </div> |
---|
321 | </div> |
---|
322 | <a class="anchor" id="a2b82ac68b981c47a3261f4e4e9ecd2bd"></a><!-- doxytag: member="TSPSolver::CTSPSolver::isOptimal" ref="a2b82ac68b981c47a3261f4e4e9ecd2bd" args="() const " --> |
---|
323 | <div class="memitem"> |
---|
324 | <div class="memproto"> |
---|
325 | <table class="memname"> |
---|
326 | <tr> |
---|
327 | <td class="memname">bool TSPSolver::CTSPSolver::isOptimal </td> |
---|
328 | <td>(</td> |
---|
329 | <td class="paramname"></td> |
---|
330 | <td> ) </td> |
---|
331 | <td> const</td> |
---|
332 | </tr> |
---|
333 | </table> |
---|
334 | </div> |
---|
335 | <div class="memdoc"> |
---|
336 | |
---|
337 | <p>Indicates whether or not the solution is definitely optimal. </p> |
---|
338 | <dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> if the solution is definitely optimal, otherwise <code>false</code>.</dd></dl> |
---|
339 | <p>The solution may need some further iterations to determine whether or not it is optimal. In such cases this function returns <code>false</code>. </p> |
---|
340 | |
---|
341 | </div> |
---|
342 | </div> |
---|
343 | <a class="anchor" id="a5e02867f053089a3e096f6baa70499a2"></a><!-- doxytag: member="TSPSolver::CTSPSolver::routePartFound" ref="a5e02867f053089a3e096f6baa70499a2" args="(int n)" --> |
---|
344 | <div class="memitem"> |
---|
345 | <div class="memproto"> |
---|
346 | <table class="memname"> |
---|
347 | <tr> |
---|
348 | <td class="memname">void TSPSolver::CTSPSolver::routePartFound </td> |
---|
349 | <td>(</td> |
---|
350 | <td class="paramtype">int </td> |
---|
351 | <td class="paramname"> <em>n</em></td> |
---|
352 | <td> ) </td> |
---|
353 | <td><code> [signal]</code></td> |
---|
354 | </tr> |
---|
355 | </table> |
---|
356 | </div> |
---|
357 | <div class="memdoc"> |
---|
358 | |
---|
359 | <p>This signal is emitted once every time a part of the route is found. </p> |
---|
360 | <dl><dt><b>Parameters:</b></dt><dd> |
---|
361 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
362 | <tr><td valign="top"></td><td valign="top"><em>n</em> </td><td>Indicates the number of the route parts found. </td></tr> |
---|
363 | </table> |
---|
364 | </dd> |
---|
365 | </dl> |
---|
366 | |
---|
367 | <p><div class="dynheader"> |
---|
368 | Here is the caller graph for this function:</div> |
---|
369 | <div class="dynsection"> |
---|
370 | <div class="center"><img src="class_t_s_p_solver_1_1_c_t_s_p_solver_a5e02867f053089a3e096f6baa70499a2_icgraph.png" border="0" usemap="#class_t_s_p_solver_1_1_c_t_s_p_solver_a5e02867f053089a3e096f6baa70499a2_icgraph_map" alt=""></div> |
---|
371 | <map name="class_t_s_p_solver_1_1_c_t_s_p_solver_a5e02867f053089a3e096f6baa70499a2_icgraph_map" id="class_t_s_p_solver_1_1_c_t_s_p_solver_a5e02867f053089a3e096f6baa70499a2_icgraph"> |
---|
372 | <area shape="rect" id="node3" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#ab8a5a387deebffd898577dba31a95099" title="Solves the given task." alt="" coords="311,5,505,33"/> |
---|
373 | </map> |
---|
374 | </div> |
---|
375 | </p> |
---|
376 | |
---|
377 | </div> |
---|
378 | </div> |
---|
379 | <a class="anchor" id="ab8a5a387deebffd898577dba31a95099"></a><!-- doxytag: member="TSPSolver::CTSPSolver::solve" ref="ab8a5a387deebffd898577dba31a95099" args="(int numCities, const TMatrix &task)" --> |
---|
380 | <div class="memitem"> |
---|
381 | <div class="memproto"> |
---|
382 | <table class="memname"> |
---|
383 | <tr> |
---|
384 | <td class="memname"><a class="el" href="struct_t_s_p_solver_1_1_s_step.html">SStep</a> * TSPSolver::CTSPSolver::solve </td> |
---|
385 | <td>(</td> |
---|
386 | <td class="paramtype">int </td> |
---|
387 | <td class="paramname"> <em>numCities</em>, </td> |
---|
388 | </tr> |
---|
389 | <tr> |
---|
390 | <td class="paramkey"></td> |
---|
391 | <td></td> |
---|
392 | <td class="paramtype">const <a class="elRef" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qlist.html">TMatrix</a> & </td> |
---|
393 | <td class="paramname"> <em>task</em></td><td> </td> |
---|
394 | </tr> |
---|
395 | <tr> |
---|
396 | <td></td> |
---|
397 | <td>)</td> |
---|
398 | <td></td><td></td><td></td> |
---|
399 | </tr> |
---|
400 | </table> |
---|
401 | </div> |
---|
402 | <div class="memdoc"> |
---|
403 | |
---|
404 | <p>Solves the given task. </p> |
---|
405 | <dl><dt><b>Parameters:</b></dt><dd> |
---|
406 | <table border="0" cellspacing="2" cellpadding="0"> |
---|
407 | <tr><td valign="top"></td><td valign="top"><em>numCities</em> </td><td>Number of cities in the task. </td></tr> |
---|
408 | <tr><td valign="top"></td><td valign="top"><em>task</em> </td><td>The matrix of city-to-city travel costs. </td></tr> |
---|
409 | </table> |
---|
410 | </dd> |
---|
411 | </dl> |
---|
412 | <dl class="return"><dt><b>Returns:</b></dt><dd>Pointer to the root of the solution tree.</dd></dl> |
---|
413 | <dl class="todo"><dt><b><a class="el" href="todo.html#_todo000001">Todo:</a></b></dt><dd>TODO: Comment the algorithm. </dd></dl> |
---|
414 | |
---|
415 | <p><div class="dynheader"> |
---|
416 | Here is the call graph for this function:</div> |
---|
417 | <div class="dynsection"> |
---|
418 | <div class="center"><img src="class_t_s_p_solver_1_1_c_t_s_p_solver_ab8a5a387deebffd898577dba31a95099_cgraph.png" border="0" usemap="#class_t_s_p_solver_1_1_c_t_s_p_solver_ab8a5a387deebffd898577dba31a95099_cgraph_map" alt=""></div> |
---|
419 | <map name="class_t_s_p_solver_1_1_c_t_s_p_solver_ab8a5a387deebffd898577dba31a95099_cgraph_map" id="class_t_s_p_solver_1_1_c_t_s_p_solver_ab8a5a387deebffd898577dba31a95099_cgraph"> |
---|
420 | <area shape="rect" id="node3" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#a3ef198959f1b4c32b84fbd5222f8b796" title="Cleans up the object and frees up memory used by the solution tree." alt="" coords="273,55,484,83"/> |
---|
421 | <area shape="rect" id="node11" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qcoreapplication.html#processEvents" title="QCoreApplication::processEvents" alt="" coords="271,106,487,134"/> |
---|
422 | <area shape="rect" id="node13" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qmutexlocker.html#relock" title="QMutexLocker::relock" alt="" coords="304,157,453,185"/> |
---|
423 | <area shape="rect" id="node15" href="class_t_s_p_solver_1_1_c_t_s_p_solver.html#a5e02867f053089a3e096f6baa70499a2" title="This signal is emitted once every time a part of the route is found." alt="" coords="251,207,507,235"/> |
---|
424 | <area shape="rect" id="node17" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qhash.html#size" title="QHash::size" alt="" coords="332,258,425,286"/> |
---|
425 | <area shape="rect" id="node19" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qmutexlocker.html#unlock" title="QMutexLocker::unlock" alt="" coords="303,309,455,337"/> |
---|
426 | <area shape="rect" id="node5" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qhash.html#clear" title="QHash::clear" alt="" coords="621,5,717,33"/> |
---|
427 | <area shape="rect" id="node7" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qapplication.html#restoreOverrideCursor" title="QApplication::restoreOverrideCursor" alt="" coords="556,55,783,83"/> |
---|
428 | <area shape="rect" id="node9" doxygen="qt-4.6.tag:http://doc.trolltech.com/4.6/" href="http://doc.trolltech.com/4.6/qapplication.html#setOverrideCursor" title="QApplication::setOverrideCursor" alt="" coords="567,106,772,134"/> |
---|
429 | </map> |
---|
430 | </div> |
---|
431 | </p> |
---|
432 | |
---|
433 | </div> |
---|
434 | </div> |
---|
435 | <a class="anchor" id="a6cce9079d60735f92037c98d6d361a82"></a><!-- doxytag: member="TSPSolver::CTSPSolver::wasCanceled" ref="a6cce9079d60735f92037c98d6d361a82" args="() const " --> |
---|
436 | <div class="memitem"> |
---|
437 | <div class="memproto"> |
---|
438 | <table class="memname"> |
---|
439 | <tr> |
---|
440 | <td class="memname">bool TSPSolver::CTSPSolver::wasCanceled </td> |
---|
441 | <td>(</td> |
---|
442 | <td class="paramname"></td> |
---|
443 | <td> ) </td> |
---|
444 | <td> const</td> |
---|
445 | </tr> |
---|
446 | </table> |
---|
447 | </div> |
---|
448 | <div class="memdoc"> |
---|
449 | |
---|
450 | <p>Indicates whether or not the solution process was canceled. </p> |
---|
451 | <dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> if the solution process was canceled, otherwise <code>false</code>. </dd></dl> |
---|
452 | |
---|
453 | </div> |
---|
454 | </div> |
---|
455 | <hr/>The documentation for this class was generated from the following files:<ul> |
---|
456 | <li>src/<a class="el" href="tspsolver_8h_source.html">tspsolver.h</a></li> |
---|
457 | <li>src/tspsolver.cpp</li> |
---|
458 | </ul> |
---|
459 | </div> |
---|
460 | <!--- window showing the filter options --> |
---|
461 | <div id="MSearchSelectWindow" |
---|
462 | onmouseover="return searchBox.OnSearchSelectShow()" |
---|
463 | onmouseout="return searchBox.OnSearchSelectHide()" |
---|
464 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
---|
465 | <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark"> </span>Defines</a></div> |
---|
466 | |
---|
467 | <!-- iframe showing the search results (closed by default) --> |
---|
468 | <div id="MSearchResultsWindow"> |
---|
469 | <iframe src="" frameborder="0" |
---|
470 | name="MSearchResults" id="MSearchResults"> |
---|
471 | </iframe> |
---|
472 | </div> |
---|
473 | |
---|
474 | <hr size="1"/><address style="text-align: right;"><small>Generated on Wed Apr 28 02:47:21 2010 for TSPSG: TSP Solver and Generator by |
---|
475 | <a href="http://www.doxygen.org/index.html"> |
---|
476 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> |
---|
477 | </body> |
---|
478 | </html> |
---|