本文整理汇总了C++中ProgramOptions::hasOption方法的典型用法代码示例。如果您正苦于以下问题:C++ ProgramOptions::hasOption方法的具体用法?C++ ProgramOptions::hasOption怎么用?C++ ProgramOptions::hasOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProgramOptions
的用法示例。
在下文中一共展示了ProgramOptions::hasOption方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fFun
Simulation::Simulation(InfoFile &info, ProgramOptions &theProgOpt, ThreadPool &_tp)
: progOpt(theProgOpt)
, numGen(progOpt.getNumberOfGenerations())
, tp(_tp)
{
// create chromosomes
Randomness &rng = tp[0].getRNG();
vector<seqLen_t> lengths = progOpt.get<vector<seqLen_t> >("length");
nat idC = 0;
nat numPop = 1; // TODO pops
for(auto& length : lengths)
{
FitnessFunction fFun(progOpt.get<vector<string>>("selCoef"));
Chromosome* chromo = new Chromosome(length, theProgOpt.hasOption("neutral"), fFun, idC++, numPop);
chromo->init(rng);
chromosomes.push_back(chromo);
}
// create parameters of populations
vector<nat> popSizes = progOpt.get<vector<nat> >("popSize");
assert(popSizes.size() == 1 );
popParams.push_back( PopulationParams(0, numGen, popSizes[0], progOpt));
fractionalSimulation = new FractionalSimulation(tp,info, progOpt, numGen, chromosomes, popParams);
}
示例2: initSize
PopulationParams::PopulationParams(nat id, nat numberOfGenerations, popSize_t initSize, const ProgramOptions &progOpt)
: initSize(initSize)
, correction(1)
// , correction(progOpt.get<nat>("ploidy") - 1 )
, isNeutral(false)
{
vector<string> stringEvents;
if(progOpt.hasOption("popEvent"))
stringEvents = progOpt.get<vector<string> >("popEvent");
// parse rates
recombinationRate = parseRate(progOpt.get<vector<string> >("recRate"),id);
// geneConversionRate = parseRate(progOpt.get<vector<string> >("mutRate"), id);
mutationRate = parseRate(progOpt.get<vector<string> >("mutRate"), id);
if(NOT stringEvents.empty())
{
parseEvents(stringEvents,id);
nat lastPopSize = initSize;
// for(auto event : events)
for(auto eventI = events.begin(); eventI != events.end(); ++eventI)
{
(*eventI)->init(lastPopSize);
if(eventI+1 != events.end())
{
nat whenIsNext = (*(eventI+1))->getWhen();
lastPopSize = (*eventI)->getByTime(whenIsNext-1);
}
}
}
}
示例3: mutNodes
Graph::Graph(nat initSize, const ProgramOptions &progOpt)
: mutNodes(1000)
, recNodes(1000)
, nodMan(1000,
progOpt.hasOption("refForCoal") ?
progOpt.get<nat>("refForCoal") - 1
: 0 ,
NOT progOpt.hasOption("refForCoal"))
, buffer(100)
#ifndef NDEBUG
, survivorsContainStartingNode(true)
#endif
{
previousState.resize(initSize);
fill(previousState.begin(), previousState.end(), nullptr);
}