lemon/simann.h
changeset 1904 a64e4735bda6
parent 1633 4bc163d55528
child 1918 09415ae11103
equal deleted inserted replaced
0:086b5ef42166 1:77108763592a
     2 #define LEMON_SIMANN_H
     2 #define LEMON_SIMANN_H
     3 
     3 
     4 /// \ingroup experimental
     4 /// \ingroup experimental
     5 /// \file
     5 /// \file
     6 /// \brief Simulated annealing framework.
     6 /// \brief Simulated annealing framework.
       
     7 ///
       
     8 /// \todo A test and some demo should be added
       
     9 /// \todo Doc should be improved
     7 /// \author Akos Ladanyi
    10 /// \author Akos Ladanyi
     8 
    11 
     9 #include <cstdlib>
    12 #include <cstdlib>
    10 #include <cmath>
    13 #include <cmath>
    11 #include <lemon/time_measure.h>
    14 #include <lemon/time_measure.h>
   296         if (cnt >= 100) {
   299         if (cnt >= 100) {
   297           // calculate starting threshold and starting temperature
   300           // calculate starting threshold and starting temperature
   298           start_threshold = 5.0 * fabs(simann->getBestCost() - avg_cost);
   301           start_threshold = 5.0 * fabs(simann->getBestCost() - avg_cost);
   299           temp = 10000.0;
   302           temp = 10000.0;
   300           warmup = false;
   303           warmup = false;
   301           timer.reset();
   304           timer.restart();
   302         }
   305         }
   303       }
   306       }
   304     }
   307     }
   305     /*! \brief Decides whether to continue the annealing process or not. */
   308     /*! \brief Decides whether to continue the annealing process or not. */
   306     bool next() {
   309     bool next() {