Merge branch 'master' of ssh://localhost:8479/gitroot/eodev/eodev
This commit is contained in:
commit
da5b29146b
4 changed files with 131 additions and 13 deletions
|
|
@ -49,6 +49,10 @@ public:
|
|||
assert( this->max().size() > 0 );
|
||||
|
||||
assert( sol.size() > 0);
|
||||
assert( sol.size() == this->min().size() );
|
||||
|
||||
eo::log << eo::debug << "BounderUniform: from sol = " << sol;
|
||||
eo::log.flush();
|
||||
|
||||
unsigned int size = sol.size();
|
||||
for (unsigned int d = 0; d < size; ++d) {
|
||||
|
|
@ -58,6 +62,8 @@ public:
|
|||
sol[d] = rng.uniform( this->min()[d], this->max()[d] );
|
||||
}
|
||||
} // for d in size
|
||||
|
||||
eo::log << eo::debug << "\tto sol = " << sol << std::endl;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -74,18 +74,18 @@ public:
|
|||
\param replacor Population replacor
|
||||
*/
|
||||
edoEDASA (eoSelect< EOT > & selector,
|
||||
edoEstimator< D > & estimator,
|
||||
eoSelectOne< EOT > & selectone,
|
||||
edoModifierMass< D > & modifier,
|
||||
edoSampler< D > & sampler,
|
||||
eoContinue< EOT > & pop_continue,
|
||||
edoContinue< D > & distribution_continue,
|
||||
eoEvalFunc < EOT > & evaluation,
|
||||
moContinuator< moDummyNeighbor<EOT> > & sa_continue,
|
||||
moCoolingSchedule<EOT> & cooling_schedule,
|
||||
double initial_temperature,
|
||||
eoReplacement< EOT > & replacor
|
||||
)
|
||||
edoEstimator< D > & estimator,
|
||||
eoSelectOne< EOT > & selectone,
|
||||
edoModifierMass< D > & modifier,
|
||||
edoSampler< D > & sampler,
|
||||
eoContinue< EOT > & pop_continue,
|
||||
edoContinue< D > & distribution_continue,
|
||||
eoEvalFunc < EOT > & evaluation,
|
||||
moContinuator< moDummyNeighbor<EOT> > & sa_continue,
|
||||
moCoolingSchedule<EOT> & cooling_schedule,
|
||||
double initial_temperature,
|
||||
eoReplacement< EOT > & replacor
|
||||
)
|
||||
: _selector(selector),
|
||||
_estimator(estimator),
|
||||
_selectone(selectone),
|
||||
|
|
|
|||
|
|
@ -91,15 +91,27 @@ public:
|
|||
//! Repair a solution by calling several repair operator on subset of indexes
|
||||
virtual void operator()( EOT& sol )
|
||||
{
|
||||
// ipair is an iterator that points on a pair
|
||||
// std::cout << "in dispatcher, sol = " << sol << std::endl;
|
||||
|
||||
// ipair is an iterator that points on a pair of <indexes,repairer>
|
||||
for( typename edoRepairerDispatcher<EOT>::iterator ipair = this->begin(); ipair != this->end(); ++ipair ) {
|
||||
|
||||
assert( ipair->first.size() <= sol.size() ); // assert there is less indexes than items in the whole solution
|
||||
|
||||
// a partial copy of the sol
|
||||
EOT partsol;
|
||||
|
||||
// std::cout << "\tusing indexes = ";
|
||||
// j is an iterator that points on an uint
|
||||
for( std::vector< unsigned int >::iterator j = ipair->first.begin(); j != ipair->first.end(); ++j ) {
|
||||
|
||||
// std::cout << *j << " ";
|
||||
// std::cout.flush();
|
||||
|
||||
partsol.push_back( sol.at(*j) );
|
||||
} // for j
|
||||
// std::cout << std::endl;
|
||||
// std::cout << "\tpartial sol = " << partsol << std::endl;
|
||||
|
||||
assert( partsol.size() > 0 );
|
||||
|
||||
|
|
|
|||
Reference in a new issue