This example shows how to instantiate an RandomSearch task to search for the best merit among a random sample of nets.
#include <iostream>
#include <memory>
#include "netbuilder/FigureOfMerit/CoordUniformFigureOfMerit.h"
#include "netbuilder/Task/RandomSearch.h"
#include "latticetester/ProductWeights.h"
#include "latbuilder/Kernel/PAlphaPLR.h"
int main(int argc, char** argv)
{
SET_PATH_TO_LATNETBUILDER_FOR_EXAMPLES();
unsigned int alpha = 2;
auto weights = std::make_unique<LatticeTester::ProductWeights>(.7);
auto figure = std::make_unique<CoordUniformFigureOfMerit<LatBuilder::Kernel::PAlphaPLR, EmbeddingType::UNILEVEL>>(std::move(weights), kernel);
SizeParameter size(10);
auto task = std::make_unique<RandomSearch<NetConstruction::SOBOL, EmbeddingType::UNILEVEL>>(s, size, std::move(figure), 100);
std::cout << task->format();
task->execute();
std::cout << "Best net: " << task->bestNet().format() << std::endl;
std::cout << "Merit value: " << task->bestMeritValue() << std::endl;
}