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


C++ Population::SelectionOnPhenotypes方法代码示例

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


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

示例1: main


//.........这里部分代码省略.........
			{
				new_within_chrom_dprime.push_back(0);
				//	adams_avg_dprime.push_back(0);
				ld << "\tchrom_" << c << "_D" << "\tchrom_" << c << "_ldDp";
				for (int cc = 0; cc < Pop.NumQTLs; cc++)
					QTLs << '\t' << c << "." << cc;
			}
			QTLs << '\n';
			ld << '\n';
			parameters << NumReps << '\t' << Pop.CarryingCapacity << '\t' << Pop.MaximumFecundity << '\t' << Pop.MaximumEncounters << '\t'
				<< Pop.pAdultSample << '\t' << Pop.ProgSample << '\t' << Pop.Generations << '\t' << Pop.NumSelGen << '\t' << Pop.NumMarkers << '\t'
				<< Pop.NumChrom << '\t' << Pop.NumQTLs << '\t' << Pop.NumAlleles << '\t' << Pop.RecombRate << '\t' << Pop.MutationRate << '\t'
				<< Pop.MutationalVariance << '\t' << Pop.EnvironmentalVariance << '\t' << Pop.sigma << '\t' << Pop.bs_replicates << '\t' << Pop.NumLD << '\n';
		}
		QTLs << reps;
		for (int c = 0; c < Pop.NumChrom; c++)
		{
			for (int cc = 0; cc < Pop.NumQTLs; cc++)
				QTLs << '\t' << Pop.Locations[c].LociOnChrom[cc];
		}
		QTLs << '\n';

		for (g = 0; g < Pop.Generations; g++)
		{
			Pop.PopulationSize = Pop.DeterminePopSize();
			Pop.Mating(ss_initial);//random mating if 0
			if (Pop.popExtinct == true)
			{
				cout << "Extinct Generation " << g + 1 << '\n';
				break;
			}

			Pop.Mutation();
			Pop.SelectionOnPhenotypes(vs_initial);//none if 0
			Pop.DensityRegulation();
			Pop.PopulationSize = Pop.DeterminePopSize();
			Pop.CalcMeanTraitValues();
			Pop.AdultSumm();
			double mean_new_longdist_d, mean_new_longdist_dprime;
			mean_new_longdist_d = mean_new_longdist_dprime = 0;
			Pop.AvgLD = 0;
			Pop.avg_pairwise_d = 0;
			Pop.avg_longdist_d = 0;
			mean_dp_ldistchrom = 0;
			ld_count = 0;
			while (ld_count < Pop.NumLD)
			{
				returned_data = Pop.AdultPopLD(randnum(Pop.NumChrom), randnum(Pop.NumChrom), randnum(Pop.NumMarkers), randnum(Pop.NumMarkers));
				if (returned_data.dprime != -5)
				{
					mean_new_longdist_d = mean_new_longdist_d + returned_data.d;
					mean_new_longdist_dprime = mean_new_longdist_dprime + returned_data.dprime;
					ld_count++;
				}
			}
			mean_new_longdist_d = mean_new_longdist_d / Pop.NumLD;
			mean_new_longdist_dprime = mean_new_longdist_dprime / Pop.NumLD;
			for (int c = 0; c < Pop.NumChrom; c++)
			{
				for (int cc = 0; cc < Pop.NumMarkers - 1; cc++)
				{//Pairwise
					returned_data = Pop.AdultPopLD(c, c, cc, cc + 1);
					Pop.avg_pairwise_d = Pop.avg_pairwise_d + returned_data.d;
					Pop.AvgLD = Pop.AvgLD + returned_data.dprime;
				}
				//adams_avg_dprime[c] = 0;
开发者ID:spflanagan,项目名称:gwsca_simulation_model,代码行数:67,代码来源:life_cycle.cpp


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