Changeset 110 in tspsg-svn


Ignore:
Timestamp:
Apr 28, 2010, 1:38:10 AM (15 years ago)
Author:
laleppa
Message:

+ Added ChangeLog?, Installation Guide and License pages to doxygen generated documentation.

  • Added city and separator parameters to CTSPSolver::getSortedPath() method to make path generation more flexible.
  • Fixed a bug when the solution graph wasn't drwan correctly in some situations.
Location:
trunk
Files:
5 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/INSTALL.txt

    r104 r110  
    3535or higher.
    3636
     37NOTE: Please, note that there will be some regressions in functionality
     38if your version of \em Qt is lower than the recommended.
     39
    3740
    3841
     
    164167    C:\Qt\bin\lrelease tspsg.pro
    165168    C:\Qt\bin\qmake tspsg.pro CONFIG+=release
    166         nmake
     169    nmake
    167170
    168171If make step finished without errors you can install TSPSG by running
     
    188191    lrelease tspsg.pro
    189192    qmake tspsg.pro CONFIG+=release
    190         nmake
     193    nmake
    191194
    192195There is no automated installation process for Windows Mobile build. To
     
    217220    make release-gcce
    218221
    219 NOTE: You need to unpack the source on the same drive as Qt and Symbian
    220 development tools.
     222WARNING: You need to unpack the source to the same drive as Symbian SDK
     223and the path must not contain any spaces or TSPSG won't build.
    221224
    222225If make step finished without errors you can generate sis installation
     
    299302qmake doesn't always enclose installation paths in quotes. This may
    300303cause 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 TSPSG
    302 installation directory manually.
     304contains spaces. In this case it is safe to delete these files and
     305TSPSG installation directory manually.
    303306
    304307
  • trunk/README.txt

    r104 r110  
    66
    77TSPSG is intended to generate and solve Travelling Salesman Problem
    8 (TSP) tasks. It uses Branch and Bound method for solving. An input
    9 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, its
    12 price, step-by-step matrices of solving and solving graph. The task
    13 can be saved in internal binary format and opened later. The result
    14 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
     9a number of cities and a matrix of city-to-city travel costs. The
     10matrix can be populated with random values in a given range (which is
     11useful for generating tasks). The result is an optimal route, its
     12price, step-by-step matrices of solving and a solving graph. The task
     13can be saved in an internal binary format and opened later. The result
     14can be printed or saved as PDF, HTML, or ODF.
    1515
    1616TSPSG may be useful for teachers to generate test tasks or just for
    1717regular users to solve TSPs. Also, it may be used as an example of
    18 using Branch and bound method to solve particular task.
     18using Branch and Bound method to solve a particular task.
    1919
    2020TSPSG is free software: you can redistribute it and/or modify it
  • trunk/doxygen.conf

    r100 r110  
    597597# with spaces.
    598598
    599 INPUT                  = src
     599INPUT                  = src docs/dox
    600600
    601601# This tag can be used to specify the character encoding of the source files
     
    650650# If left blank NO is used.
    651651
    652 RECURSIVE              = YES
     652RECURSIVE              = NO
    653653
    654654# The EXCLUDE tag can be used to specify files and/or directories that should
     
    684684# the \include command).
    685685
    686 EXAMPLE_PATH           =
     686EXAMPLE_PATH           = .
    687687
    688688# If the value of the EXAMPLE_PATH tag contains directories, you can use the
  • trunk/src/mainwindow.cpp

    r109 r110  
    666666
    667667        cur.insertBlock(fmt_paragraph);
    668         cur.insertText("  " + solver.getSortedPath());
     668        cur.insertText("  " + solver.getSortedPath(tr("City %1")));
    669669
    670670        cur.insertBlock(fmt_paragraph);
     
    861861                pic.drawLine(QPointF(x, y - r), QPointF(r * 2.25, y - 2 * r));
    862862        } 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));
    864864        }
    865865
  • trunk/src/tspsolver.cpp

    r107 r110  
    7171/*!
    7272 * \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.
    7375 * \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 */
     80QString CTSPSolver::getSortedPath(const QString &city, const QString &separator) const
    7681{
    7782        if (!root || route.isEmpty() || (route.size() != nCities))
     
    7984
    8085int i = 0; // We start from City 1
    81 QString path = tr("City %1").arg(1) + " -> ";
     86QStringList path;
     87        path << city.arg(1);
    8288        while ((i = route[i]) != 0) {
    83                 path += tr("City %1").arg(i + 1) + " -> ";
     89                path << city.arg(i + 1);
    8490        }
    8591        // 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);
    8995}
    9096
  • trunk/src/tspsolver.h

    r107 r110  
    113113        CTSPSolver(QObject *parent = NULL);
    114114        void cleanup(bool processEvents = false);
    115         QString getSortedPath() const;
     115        QString getSortedPath(const QString &city, const QString &separator = " -> ") const;
    116116        int getTotalSteps() const;
    117117        bool isOptimal() const;
  • trunk/src/version.h

    r100 r110  
    1111 *
    1212 *  This file is part of TSPSG.
    13  *
    14  *  TSPSG is free software: you can redistribute it and/or modify
    15  *  it under the terms of the GNU General Public License as published by
    16  *  the Free Software Foundation, either version 3 of the License, or
    17  *  (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 of
    21  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    22  *  GNU General Public License for more details.
    23  *
    24  *  You should have received a copy of the GNU General Public License
    25  *  along with TSPSG.  If not, see <http://www.gnu.org/licenses/>.
    26  */
    27 /*!
    28  * \mainpage
    29  * \image html tspsg.png
    30  *  <b>TSPSG: TSP Solver and Generator</b>
    31  * \author Copyright &copy; 2007-2010 Lёppa <contacts[at]oleksii[dot]name>
    32  *
    33  *  \b Homepage: <a href="http://tspsg.sourceforge.net/">tspsg.sourceforge.net</a>
    3413 *
    3514 *  TSPSG is free software: you can redistribute it and/or modify
Note: See TracChangeset for help on using the changeset viewer.