Example #1
0
Archive multiObjSearch( ReferenceSet& ref, StringSet<IupacString>& goodPairs, Parameters& pars )
{
	uint i;
	// initialize rng
	std::mt19937 rng( pars.seed );
	
	// build and populate archive
	Archive ar;
	for( i = 0; i < seqan::length(goodPairs); i+=2 )
		ar.add( PairSet(goodPairs[i], goodPairs[i+1], ref, pars) );
	
	// compute Pareto front
	vector<uint> pFront = ar.paretoFront();
	vector<double> alpha = sampleAlpha( rng );
	Bounds b = ar.getBounds();
	PairSet init = ar.get( 0 );
	
	// Cycle, sampling from Pareto front and running local search
	for( i = 0; i < pars.rest; i++ )
	{
		std::cout << "Restart " << i << "\n";
		init = ar.get( pFront[ rng() % pFront.size()] );
		ar.add( localSearch( init, alpha, pars, b ) );
		// update state
		pFront = ar.paretoFront();
		alpha = sampleAlpha( rng );
		b = ar.getBounds();
	}
	
	return ar;
}