Changeset caef58b531 in tspsg for src/tspsolver.h


Ignore:
Timestamp:
Oct 20, 2009, 9:38:01 PM (15 years ago)
Author:
Oleksii Serdiuk
Branches:
0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
Children:
85ad815b0b
Parents:
bc1b8837b6
Message:

More code documentation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tspsolver.h

    rbc1b8837b6 rcaef58b531  
    1 /*
    2  *  TSPSG: TSP Solver and Generator
    3  *  Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
     1/*!
     2 * \class CTSPSolver
     3 * \author Copyright &copy; 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
     4 * \brief This class solves Travelling Salesman Problem task.
    45 *
    56 *  $Id$
    67 *  $URL$
     8 *
     9 *  <b>TSPSG: TSP Solver and Generator</b>
    710 *
    811 *  This file is part of TSPSG.
     
    2023 *  You should have received a copy of the GNU General Public License
    2124 *  along with TSPSG.  If not, see <http://www.gnu.org/licenses/>.
     25 *
     26 * \todo TODO: Deletion of solution tree on destroy and cleanup.
    2227 */
    2328
     
    2934#include "tspmodel.h"
    3035
     36//! A matrix of city-to-city travel costs.
    3137typedef QList<QList<double> > tMatrix;
    3238
    33 // This structure represents one step of solving
    34 // The tree of such elements will represent the solving process
     39/*!
     40 * \brief This structure represents one step of solving.
     41 *
     42 *  A tree of such elements will represent the solving process.
     43 */
     44//! \todo TODO: List alternative candidates.
    3545struct sStep {
    36         tMatrix matrix; // Steps's matrix
    37         double price; // Price of travel to this step
    38         struct {int nRow; int nCol;} candidate; // Candiadate for branching in current matrix
    39         bool alts; // This matrix has alternative candidates
    40         sStep *plNode, *prNode; // Pointers to left and right branch steps
    41         sStep() { price = candidate.nRow = candidate.nCol = -1; alts = false; plNode = prNode = NULL; } // Default values
     46        tMatrix matrix; //!< This step's matrix
     47        double price; //!< The price of travel to this step
     48        struct {
     49                int nRow; //!< A zero-based row number of the candidate
     50                int nCol; //!< A zero-based column number of the candidate
     51        } candidate; //!< A candiadate for branching in the current matrix
     52        bool alts; //!< Indicates whether or not matrix has alternative candidates
     53        sStep *plNode; //!< Pointer to the left branch step
     54        sStep *prNode; //!< Pointer to the right branch step
     55
     56        //! Assigns default values
     57        sStep() {
     58                price = candidate.nRow = candidate.nCol = -1;
     59                alts = false;
     60                plNode = prNode = NULL;
     61        }
    4262};
    4363
    44 // TSP Solver class
    4564class CTSPSolver
    4665{
Note: See TracChangeset for help on using the changeset viewer.