diff -r f71b0f9a7c3a -r 4dbb6dd2dd4b lemon/simann.h --- a/lemon/simann.h Mon Oct 02 14:41:53 2006 +0000 +++ b/lemon/simann.h Mon Oct 02 16:11:00 2006 +0000 @@ -31,10 +31,7 @@ #include #include #include - -#ifdef WIN32 -#include -#endif +#include namespace lemon { @@ -241,7 +238,6 @@ double _temp = 1000.0, double _ann_fact = 0.9999) : max_iter(_max_iter), max_no_impr(_max_no_impr), temp(_temp), ann_fact(_ann_fact) { - srand48(time(0)); } /// \brief This is called when a neighbouring state gets accepted. void acceptEvent() {} @@ -261,7 +257,7 @@ /// \brief Decides whether to accept the current solution or not. bool accept() { double cost_diff = simann->getCurrCost() - simann->getPrevCost(); - return (drand48() <= exp(-(cost_diff / temp))); + return (rnd.getReal() <= exp(-(cost_diff / temp))); } /// \brief Destructor. virtual ~SimpleController() {} @@ -321,7 +317,6 @@ alpha(_alpha), beta(_beta), gamma(_gamma), end_time(_end_time), ann_fact(_ann_fact), init_ann_fact(_ann_fact), start(false) { - srand48(time(0)); } /// \brief Does initializations before each run. void init() { @@ -370,7 +365,7 @@ } else { double cost_diff = simann->getCurrCost() - simann->getPrevCost(); - return (drand48() <= exp(-(cost_diff / temp))); + return (rnd.getReal() <= exp(-(cost_diff / temp))); } } /// \brief Destructor.