lemon/simann.h
changeset 2338 359f0b71919b
parent 2242 16523135943d
child 2370 ed6539025f27
equal deleted inserted replaced
7:e2f4945ea5a5 8:518c1e0478ee
    81     /// \brief Destructor.
    81     /// \brief Destructor.
    82     virtual ~EntityBase() {}
    82     virtual ~EntityBase() {}
    83   };
    83   };
    84 
    84 
    85   /// \brief Simulated annealing abstract base class.
    85   /// \brief Simulated annealing abstract base class.
       
    86   ///
    86   /// Can be used to derive a custom simulated annealing class if \ref SimAnn
    87   /// Can be used to derive a custom simulated annealing class if \ref SimAnn
    87   /// doesn't fit your needs.
    88   /// doesn't fit your needs.
    88   class SimAnnBase {
    89   class SimAnnBase {
    89   private:
    90   private:
    90     /// \brief Pointer to the controller.
    91     /// \brief Pointer to the controller.
   212     /// \brief Returns a copy of the best found entity.
   213     /// \brief Returns a copy of the best found entity.
   213     EntityBase* getBestEntity() { return best_ent->clone(); }
   214     EntityBase* getBestEntity() { return best_ent->clone(); }
   214   };
   215   };
   215 
   216 
   216   /// \brief A simple controller for the simulated annealing class.
   217   /// \brief A simple controller for the simulated annealing class.
       
   218   ///
   217   /// This controller starts from a given initial temperature and evenly
   219   /// This controller starts from a given initial temperature and evenly
   218   /// decreases it.
   220   /// decreases it.
   219   class SimpleController : public ControllerBase {
   221   class SimpleController : public ControllerBase {
   220   private:
   222   private:
   221     /// \brief Maximum number of iterations.
   223     /// \brief Maximum number of iterations.
   263     virtual ~SimpleController() {}
   265     virtual ~SimpleController() {}
   264   };
   266   };
   265 
   267 
   266   /// \brief A controller with preset running time for the simulated annealing
   268   /// \brief A controller with preset running time for the simulated annealing
   267   /// class.
   269   /// class.
       
   270   ///
   268   /// With this controller you can set the running time of the annealing
   271   /// With this controller you can set the running time of the annealing
   269   /// process in advance. It works the following way: the controller measures
   272   /// process in advance. It works the following way: the controller measures
   270   /// a kind of divergence. The divergence is the difference of the average
   273   /// a kind of divergence. The divergence is the difference of the average
   271   /// cost of the recently found solutions the cost of the best found one. In
   274   /// cost of the recently found solutions the cost of the best found one. In
   272   /// case this divergence is greater than a given threshold, then we decrease
   275   /// case this divergence is greater than a given threshold, then we decrease