continuator/moTimeContinuator: Add a method to set the maximum running time
git-svn-id: svn://scm.gforge.inria.fr/svnroot/paradiseo@2532 331e1502-861f-0410-8da2-ba01fb791d7f
This commit is contained in:
parent
3ea5833715
commit
cf0696a2a0
3 changed files with 21 additions and 10 deletions
|
|
@ -47,7 +47,7 @@ public:
|
|||
* @param _max maximum running time
|
||||
* @param _verbose verbose mode true/false -> on/off
|
||||
*/
|
||||
moTimeContinuator(time_t _max, bool _verbose=true): max(_max), verbose(_verbose) {
|
||||
moTimeContinuator(time_t _max, bool _verbose = true): max(_max), verbose(_verbose) {
|
||||
external = false;
|
||||
start = time(NULL);
|
||||
}
|
||||
|
|
@ -72,6 +72,16 @@ public:
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* To set the maximum running time
|
||||
*
|
||||
* @param _maxTime maximum running time
|
||||
*/
|
||||
virtual void maxTime(time_t _maxTime) {
|
||||
max = _maxTime
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns false when the running time is reached.
|
||||
* @param _sol the current solution
|
||||
|
|
|
|||
|
|
@ -115,15 +115,14 @@ public:
|
|||
* @return this monitor (sorry I don't why, but it is like this in EO)
|
||||
*/
|
||||
eoMonitor& operator()(void) {
|
||||
if (doubleParam != NULL)
|
||||
valueVec.push_back(doubleParam->value());
|
||||
else
|
||||
if (intParam != NULL)
|
||||
valueVec.push_back((double) intParam->value());
|
||||
else
|
||||
eotVec.push_back(eotParam->value());
|
||||
|
||||
return *this ;
|
||||
if (doubleParam != NULL)
|
||||
valueVec.push_back(doubleParam->value());
|
||||
else
|
||||
if (intParam != NULL)
|
||||
valueVec.push_back((double) intParam->value());
|
||||
else
|
||||
eotVec.push_back(eotParam->value());
|
||||
return *this ;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@
|
|||
#include <coolingSchedule/moCoolingSchedule.h>
|
||||
#include <coolingSchedule/moDynSpanCoolingSchedule.h>
|
||||
#include <coolingSchedule/moSimpleCoolingSchedule.h>
|
||||
#include <coolingSchedule/moDynSpanCoolingSchedule.h>
|
||||
|
||||
#include <eval/moDummyEval.h>
|
||||
#include <eval/moEval.h>
|
||||
|
|
@ -139,6 +140,7 @@
|
|||
#include <memory/moNeighborVectorTabuList.h>
|
||||
#include <memory/moRndIndexedVectorTabuList.h>
|
||||
#include <memory/moSolVectorTabuList.h>
|
||||
#include <memory/moRndIndexedVectorTabuList.h>
|
||||
#include <memory/moTabuList.h>
|
||||
|
||||
#include <neighborhood/moBackableNeighbor.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue