当前位置: 首页>>代码示例>>C++>>正文


C++ ConfigReader::GetIntOption方法代码示例

本文整理汇总了C++中ConfigReader::GetIntOption方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigReader::GetIntOption方法的具体用法?C++ ConfigReader::GetIntOption怎么用?C++ ConfigReader::GetIntOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ConfigReader的用法示例。


在下文中一共展示了ConfigReader::GetIntOption方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Read

int MasterGamlConfig::Read(const char* fname, bool isMaster){
	ConfigReader cr;	
	if (cr.Load(fname) != 0)	{
		printf("ERROR: GamlConfig::General::Read(%s) failed.\n", fname);
		return -1;
	}

	int errors = 0;

	errors += GeneralGamlConfig::Read(fname, true);

#ifdef MPI_VERSION
	
	errors += cr.SetSection("master");

	errors += cr.GetDoubleOption("startupdatethresh", startUpdateThresh);
	errors += cr.GetDoubleOption("minupdatethresh", minUpdateThresh);
//	errors += cr.GetDoubleOption("updatereductionfactor", updateReductionFactor);
				
//	errors += cr.GetIntOption("parallelinterval", subtreeInterval);
#ifdef SUBTREE_VERSION
	errors += cr.GetDoubleOption("subtreestartthresh", subtreeStartThresh);
	errors += cr.GetIntOption("minsubtreesize", minSubtreeSize);
	errors += cr.GetIntOption("targetsubtreesize", targetSubtreeSize);
	errors += cr.GetDoubleOption("orphanfactor", orphanFactor);
#else 
	subtreeStartThresh = 0.0;
	minSubtreeSize = -1;
	targetSubtreeSize = -1;
	orphanFactor = -1.0;
#endif

	errors += cr.GetIntOption("maxrecomindivs", maxRecomIndivs);
#endif
	return errors;
	}
开发者ID:rekepalli,项目名称:garli,代码行数:36,代码来源:configoptions.cpp

示例2: Read

int GeneralGamlConfig::Read(const char* fname, bool isMaster /*=false*/)	{

	ConfigReader cr;	
	if (cr.Load(fname) != 0)	{
		printf("ERROR: GamlConfig::General::Read(%s) failed.\n", fname);
		return -1;
	}
	
	int errors = 0;
	errors += cr.SetSection("general");
	errors += cr.GetIntOption("logevery", logevery);
	errors += cr.GetIntOption("saveevery", saveevery);
	errors += cr.GetDoubleOption("megsclamemory", megsClaMemory);
	errors += cr.GetStringOption("datafname", datafname);
//	errors += cr.GetStringOption("method", method);
	errors += cr.GetStringOption("ofprefix", ofprefix);
	errors += cr.GetStringOption("streefname", streefname);
	errors += cr.GetIntOption("randseed", randseed);
	errors += cr.GetBoolOption("refinestart", refineStart);
	errors += cr.GetBoolOption("outputeachbettertopology", outputTreelog);
	errors += cr.GetBoolOption("enforcetermconditions", enforceTermConditions);
	errors += cr.GetIntOption("genthreshfortopoterm", lastTopoImproveThresh);
	errors += cr.GetDoubleOption("scorethreshforterm", improveOverStoredIntervalsThresh);

	if(isMaster) errors += cr.SetSection("master");
	else errors += cr.SetSection("remote");
	
	errors += cr.GetIntOption("nindivs", min_nindivs);
	max_nindivs=min_nindivs;
	errors += cr.GetIntOption("holdover", holdover);
	errors += cr.GetDoubleOption("selectionintensity", selectionIntensity);
	errors += cr.GetDoubleOption("holdoverpenalty", holdoverPenalty);
	errors += cr.GetIntOption("stopgen", stopgen);
	errors += cr.GetIntOption("stoptime", stoptime);
	errors += cr.GetDoubleOption("startoptprec", startOptPrec);
	errors += cr.GetDoubleOption("minoptprec", minOptPrec);
	errors += cr.GetDoubleOption("precreductionfactor", precReductionFactor);
	errors += cr.GetDoubleOption("topoweight", topoWeight);
	errors += cr.GetDoubleOption("modweight", modWeight);	
	errors += cr.GetDoubleOption("brlenweight", brlenWeight);	
	errors += cr.GetDoubleOption("randnniweight", randNNIweight);
	errors += cr.GetDoubleOption("randsprweight", randSPRweight);	
	errors += cr.GetDoubleOption("limsprweight", limSPRweight);

#ifdef MPI_VERSION
	if(isMaster==false) errors += cr.GetDoubleOption("sendinterval", sendInterval);
#endif
	

#ifdef GANESH
	errors += cr.GetDoubleOption("randpecrweight", randPECRweight);
#endif
	errors += cr.GetIntOption("gammashapebrlen", gammaShapeBrlen);	
	errors += cr.GetIntOption("gammashapemodel", gammaShapeModel);

	errors += cr.GetIntOption("limsprrange", limSPRrange);
	errors += cr.GetIntOption("intervallength", intervalLength);
	errors += cr.GetIntOption("intervalstostore", intervalsToStore);
	errors += cr.GetDoubleOption("meanbrlenmuts", minBrlenMuts);
	maxBrlenMuts=minBrlenMuts;

#ifdef INCLUDE_PERTURBATION
	errors += cr.SetSection("perturbation");

	errors += cr.GetIntOption("perttype", pertType);
	errors += cr.GetDoubleOption("pertthresh", pertThresh);
	errors += cr.GetIntOption("minpertinterval", minPertInterval);
	errors += cr.GetIntOption("maxpertsnoimprove", maxPertsNoImprove);
	errors += cr.GetBoolOption("restartafterabandon", restartAfterAbandon);
	errors += cr.GetIntOption("gensbeforerestart", gensBeforeRestart);
	
	errors += cr.GetDoubleOption("ratchetproportion", ratchetProportion);
	errors += cr.GetDoubleOption("ratchetoffthresh", ratchetOffThresh);
	errors += cr.GetIntOption("ratchetmaxgen", ratchetMaxGen);
	
	errors += cr.GetIntOption("nnitargetaccepts", nniTargetAccepts);
	errors += cr.GetIntOption("nnimaxattempts", nniMaxAttempts);
	
	errors += cr.GetIntOption("numsprcycles", numSprCycles);
	errors += cr.GetIntOption("sprpertrange", sprPertRange);
#endif
	return errors;
}
开发者ID:rekepalli,项目名称:garli,代码行数:83,代码来源:configoptions.cpp

示例3: Read

int GeneralGamlConfig::Read(const char* fname, bool isMaster /*=false*/)	{

	ConfigReader cr;	
	if (cr.Load(fname) != 0)	{
		printf("ERROR: GamlConfig::General::Read(%s) failed.\n", fname);
		return -1;
	}
	
	cr.MakeAllSection();

	int errors = 0;
	errors += cr.SetSection("general");
	if(errors < 0) throw ErrorException("Didn't find [general] section in config file\n     (this section heading is required)");
	errors += cr.GetUnsignedOption("logevery", logevery);
	errors += cr.GetUnsignedOption("saveevery", saveevery);
	int found=cr.GetPositiveNonZeroDoubleOption("megsclamemory", megsClaMemory, true);
	found += cr.GetPositiveNonZeroDoubleOption("availablememory", availableMemory, true);
	if(found == -2) throw ErrorException("Either \"megsclamemory\" or \"availablememory\" must be specified in conf!");
	
	errors += cr.GetStringOption("datafname", datafname);
	errors += cr.GetStringOption("ofprefix", ofprefix);
	errors += cr.GetStringOption("streefname", streefname);
	cr.GetStringOption("constraintfile", constraintfile, true);
	errors += cr.GetIntNonZeroOption("randseed", randseed);
	cr.GetIntNonZeroOption("bootstrapseed", bootstrapSeed, true);
	errors += cr.GetBoolOption("refinestart", refineStart);
	cr.GetBoolOption("refineend", refineEnd, true);
	errors += cr.GetBoolOption("outputeachbettertopology", outputTreelog);
	errors += cr.GetBoolOption("enforcetermconditions", enforceTermConditions);
	errors += cr.GetUnsignedNonZeroOption("genthreshfortopoterm", lastTopoImproveThresh);
	errors += cr.GetPositiveNonZeroDoubleOption("scorethreshforterm", improveOverStoredIntervalsThresh);
	cr.GetPositiveNonZeroDoubleOption("significanttopochange", significantTopoChange, true);
	cr.GetUnsignedNonZeroOption("attachmentspertaxon", attachmentsPerTaxon, true);
	cr.GetUnsignedOption("outputsitelikelihoods", outputSitelikelihoods, true);
	cr.GetBoolOption("reportrunprogress", reportRunProgress, true);
	cr.GetBoolOption("optimizeinputonly", optimizeInputOnly, true);

	cr.GetBoolOption("ignorestopcodons", ignoreStopCodons, true);

	cr.GetBoolOption("outputmostlyuselessfiles", outputMostlyUselessFiles, true);
	cr.GetBoolOption("outputphyliptree", outputPhylipTree, true);
	cr.GetBoolOption("collapsebranches", collapseBranches, true);
	cr.GetIntOption("genthreshforswapterm", swapTermThreshold, true);

	cr.GetStringOption("arbitrarystring", arbitraryString, true);
	cr.GetUnsignedOption("windowlength", siteWindowLength, true);
	cr.GetUnsignedOption("windowstride", siteWindowStride, true);
	cr.GetBoolOption("usepatternmanager", usePatternManager, true);
	cr.GetStringOption("parametervaluestring", parameterValueString, true);
	cr.GetBoolOption("combineadjacentidenticalgappatterns", combineAdjacentIdenticalGapPatterns, true);

	cr.GetBoolOption("rootatbranchmidpoint", rootAtBranchMidpoint, true);
	cr.GetBoolOption("useoptboundedforblen", useOptBoundedForBlen, true);

	//changed the wording of this from besttree to besttopology, to match outputeachbettertopology
	//still allow besttree, since that is what I told Maddison, and I think has already been incorporated
	//into Mesquite
	int ret = cr.GetBoolOption("outputcurrentbesttopology", outputCurrentBestTopology, true);
	if(ret < 0)
		cr.GetBoolOption("outputcurrentbesttree", outputCurrentBestTopology, true);

	cr.GetBoolOption("restart", restart, true);
	cr.GetBoolOption("writecheckpoints", checkpoint, true);

	cr.GetUnsignedNonZeroOption("searchreps", searchReps, true);
	cr.GetUnsignedOption("runmode", runmode, true);
	cr.GetBoolOption("scoreonly", scoreOnly, true);

	//These three used to be in the [master] section, for no apparent reason. Now allowed in [general] 
	//as well.  If in both, will be overridden by master
	cr.GetUnsignedOption("bootstrapreps", bootstrapReps, true);
	cr.GetPositiveNonZeroDoubleOption("resampleproportion", resampleProportion, true);
	cr.GetBoolOption("inferinternalstateprobs", inferInternalStateProbs, true);

	cr.GetBoolOption("workphasedivision", workPhaseDivision, true);

	bool multipleModelsFound = ReadPossibleModelPartition(cr);

	if(!multipleModelsFound){//if we didn't find multiple models in separate model sections, look for them in 
		ConfigModelSettings configModSet;
		int settingsFound = 0;
		settingsFound += cr.GetStringOption("ratehetmodel", configModSet.rateHetModel, true);
		settingsFound += cr.GetUnsignedOption("numratecats", configModSet.numRateCats, true);	
		settingsFound += cr.GetStringOption("statefrequencies", configModSet.stateFrequencies, true);
		settingsFound += cr.GetStringOption("ratematrix", configModSet.rateMatrix, true);
		settingsFound += cr.GetStringOption("invariantsites", configModSet.proportionInvariant, true);
		settingsFound += cr.GetStringOption("datatype", configModSet.datatype, true);
		settingsFound += cr.GetStringOption("geneticcode", configModSet.geneticCode, true);
		if(settingsFound == -7)
			throw ErrorException("No model descriptions found in config file.  Proper setup is either:\n\t1. Model settings found somewhere under [general] heading,\n\t   applying to all data subsets\n\t2. Separate model settings for each partition subset\n\t   found under different headings [model1], [model2]. etc");
		configModelSets.push_back(configModSet);
		}

	cr.GetBoolOption("linkmodels", linkModels, true);
	cr.GetBoolOption("subsetspecificrates", subsetSpecificRates, true);

	cr.GetStringOption("outgroup", outgroupString, true);

	if(isMaster){
		errors += cr.SetSection("master");
//.........这里部分代码省略.........
开发者ID:rekepalli,项目名称:garli,代码行数:101,代码来源:configoptions.cpp


注:本文中的ConfigReader::GetIntOption方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。