diff --git a/eo/src/utils/eoFDCStat.h b/eo/src/utils/eoFDCStat.h index eaee82f2..134a64f0 100644 --- a/eo/src/utils/eoFDCStat.h +++ b/eo/src/utils/eoFDCStat.h @@ -56,13 +56,14 @@ public : */ virtual void operator()(const eoPop& _pop) { + unsigned i; if (!boolOpt) // take the local best theBest = _pop.best_element(); unsigned int pSize = _pop.size(); distToBest.value().resize(pSize); fitnesses.value().resize(pSize); double sumFit = 0.0, sumDist = 0.0; - for (unsigned i=0; i +#include #include @@ -45,7 +45,7 @@ public: virtual void operator()() { // ask for system time - times(&tmsStruct); + utime = clock(); // if (firstTime) /* first generation */ // { // firstTime=false; @@ -53,13 +53,13 @@ public: // } // store elapsed user time // value(tmsStruct.tms_utime - firstUtime); - value()=double(tmsStruct.tms_utime)/100; + value()=double(utime)/CLOCKS_PER_SEC; } private: // bool firstTime; // clock_t firstUtime; - struct tms tmsStruct; // stores time + clock_t utime; }; #endif diff --git a/eo/src/utils/eoUpdater.h b/eo/src/utils/eoUpdater.h index a7413ec0..4d87906b 100644 --- a/eo/src/utils/eoUpdater.h +++ b/eo/src/utils/eoUpdater.h @@ -27,6 +27,7 @@ #ifndef _eoUpdater_h #define _eoUpdater_h +#include #include #include #include @@ -69,13 +70,13 @@ class eoIncrementorParam : public eoUpdater, public eoValueParam { public : /** Default Ctor : a name and optionally an increment*/ - eoIncrementorParam(string _name, T _stepsize = 1) : + eoIncrementorParam( std::string _name, T _stepsize = 1) : eoValueParam(T(0), _name), stepsize(_stepsize) {} /** Ctor with a name and non-zero initial value * and mandatory stepSize to remove ambiguity */ - eoIncrementorParam(string _name, T _countValue, T _stepsize) : + eoIncrementorParam( std::string _name, T _countValue, T _stepsize) : eoValueParam(_countValue, _name), stepsize(_stepsize) {} /** Simply increments */