Changeset 110 in tspsg-svn
- Timestamp:
- Apr 28, 2010, 1:38:10 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/INSTALL.txt
r104 r110 35 35 or higher. 36 36 37 NOTE: Please, note that there will be some regressions in functionality 38 if your version of \em Qt is lower than the recommended. 39 37 40 38 41 … … 164 167 C:\Qt\bin\lrelease tspsg.pro 165 168 C:\Qt\bin\qmake tspsg.pro CONFIG+=release 166 169 nmake 167 170 168 171 If make step finished without errors you can install TSPSG by running … … 188 191 lrelease tspsg.pro 189 192 qmake tspsg.pro CONFIG+=release 190 193 nmake 191 194 192 195 There is no automated installation process for Windows Mobile build. To … … 217 220 make release-gcce 218 221 219 NOTE: You need to unpack the source on the same drive as Qt and Symbian 220 development tools.222 WARNING: You need to unpack the source to the same drive as Symbian SDK 223 and the path must not contain any spaces or TSPSG won't build. 221 224 222 225 If make step finished without errors you can generate sis installation … … 299 302 qmake doesn't always enclose installation paths in quotes. This may 300 303 cause some files not to be installed or removed when their path 301 contains quotes. In this case it is safe to delete this files and TSPSG302 installation directory manually.304 contains spaces. In this case it is safe to delete these files and 305 TSPSG installation directory manually. 303 306 304 307 -
trunk/README.txt
r104 r110 6 6 7 7 TSPSG is intended to generate and solve Travelling Salesman Problem 8 (TSP) tasks. It uses Branch and Bound method for solving. An input9 is number of cities and matrix of city-to-city travel costs. 10 The matrix can be populated with random values in a given range 11 (useful for generating tasks). The result is an optimal route, its12 price, step-by-step matrices of solving and solving graph. The task13 can be saved in internal binary format and opened later. The result14 can be printed without the answer (only input matrix) or with it.8 (TSP) tasks. It uses Branch and Bound method for solving. Its input is 9 a number of cities and a matrix of city-to-city travel costs. The 10 matrix can be populated with random values in a given range (which is 11 useful for generating tasks). The result is an optimal route, its 12 price, step-by-step matrices of solving and a solving graph. The task 13 can be saved in an internal binary format and opened later. The result 14 can be printed or saved as PDF, HTML, or ODF. 15 15 16 16 TSPSG may be useful for teachers to generate test tasks or just for 17 17 regular users to solve TSPs. Also, it may be used as an example of 18 using Branch and bound method to solveparticular task.18 using Branch and Bound method to solve a particular task. 19 19 20 20 TSPSG is free software: you can redistribute it and/or modify it -
trunk/doxygen.conf
r100 r110 597 597 # with spaces. 598 598 599 INPUT = src 599 INPUT = src docs/dox 600 600 601 601 # This tag can be used to specify the character encoding of the source files … … 650 650 # If left blank NO is used. 651 651 652 RECURSIVE = YES652 RECURSIVE = NO 653 653 654 654 # The EXCLUDE tag can be used to specify files and/or directories that should … … 684 684 # the \include command). 685 685 686 EXAMPLE_PATH = 686 EXAMPLE_PATH = . 687 687 688 688 # If the value of the EXAMPLE_PATH tag contains directories, you can use the -
trunk/src/mainwindow.cpp
r109 r110 666 666 667 667 cur.insertBlock(fmt_paragraph); 668 cur.insertText(" " + solver.getSortedPath( ));668 cur.insertText(" " + solver.getSortedPath(tr("City %1"))); 669 669 670 670 cur.insertBlock(fmt_paragraph); … … 861 861 pic.drawLine(QPointF(x, y - r), QPointF(r * 2.25, y - 2 * r)); 862 862 } else if (nstep > 1) { 863 pic.drawLine(QPointF(x, y - r), QPointF((step->pNode-> next == SStep::RightBranch) ? r * 3.5 : r, y - 2 * r));863 pic.drawLine(QPointF(x, y - r), QPointF((step->pNode->pNode->next == SStep::RightBranch) ? r * 3.5 : r, y - 2 * r)); 864 864 } 865 865 -
trunk/src/tspsolver.cpp
r107 r110 71 71 /*! 72 72 * \brief Returns the sorted optimal path, starting from City 1. 73 * \param city A string that represents city elements in the path. 74 * \param separator A string that represents separators between cities in the path. 73 75 * \return A string, containing sorted optimal path. 74 */ 75 QString CTSPSolver::getSortedPath() const 76 * 77 * The resulting path will be in the form \a city+\a separator+\a city+...+\a separator+\a city. 78 * \c \%1 in \a city will be replaced by the city number. 79 */ 80 QString CTSPSolver::getSortedPath(const QString &city, const QString &separator) const 76 81 { 77 82 if (!root || route.isEmpty() || (route.size() != nCities)) … … 79 84 80 85 int i = 0; // We start from City 1 81 QString path = tr("City %1").arg(1) + " -> "; 86 QStringList path; 87 path << city.arg(1); 82 88 while ((i = route[i]) != 0) { 83 path += tr("City %1").arg(i + 1) + " -> ";89 path << city.arg(i + 1); 84 90 } 85 91 // And finish in City 1, too 86 path += tr("City %1").arg(1);87 88 return path ;92 path << city.arg(1); 93 94 return path.join(separator); 89 95 } 90 96 -
trunk/src/tspsolver.h
r107 r110 113 113 CTSPSolver(QObject *parent = NULL); 114 114 void cleanup(bool processEvents = false); 115 QString getSortedPath( ) const;115 QString getSortedPath(const QString &city, const QString &separator = " -> ") const; 116 116 int getTotalSteps() const; 117 117 bool isOptimal() const; -
trunk/src/version.h
r100 r110 11 11 * 12 12 * This file is part of TSPSG. 13 *14 * TSPSG is free software: you can redistribute it and/or modify15 * it under the terms of the GNU General Public License as published by16 * the Free Software Foundation, either version 3 of the License, or17 * (at your option) any later version.18 *19 * TSPSG is distributed in the hope that it will be useful,20 * but WITHOUT ANY WARRANTY; without even the implied warranty of21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the22 * GNU General Public License for more details.23 *24 * You should have received a copy of the GNU General Public License25 * along with TSPSG. If not, see <http://www.gnu.org/licenses/>.26 */27 /*!28 * \mainpage29 * \image html tspsg.png30 * <b>TSPSG: TSP Solver and Generator</b>31 * \author Copyright © 2007-2010 Lёppa <contacts[at]oleksii[dot]name>32 *33 * \b Homepage: <a href="http://tspsg.sourceforge.net/">tspsg.sourceforge.net</a>34 13 * 35 14 * TSPSG is free software: you can redistribute it and/or modify
Note: See TracChangeset
for help on using the changeset viewer.