本文整理汇总了C++中beagle::Context::getProcessedDeme方法的典型用法代码示例。如果您正苦于以下问题:C++ Context::getProcessedDeme方法的具体用法?C++ Context::getProcessedDeme怎么用?C++ Context::getProcessedDeme使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类beagle::Context
的用法示例。
在下文中一共展示了Context::getProcessedDeme方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: maxOf
/*!
* \brief Calculate MCC statistics of a given deme.
* \param outStats Evaluated statistics.
* \param ioDeme Deme to evalute.
* \param ioContext Context of the evolution.
*
* The following statistics are calculated and made available in outStats:
* + mcc (as returned by FitnessMCC::getValue)
* + true-positives
* + false-positives
* + true-negatives
* + false-negatives
* + true-positives-relative
* + false-positives-relative
* + true-negatives-relative
* + false-negatives-relative
* + treedepth
* + treesize
*
*/
void GP::StatsCalcFitnessMCCOp::calculateStatsDeme(Beagle::Stats& outStats,
Beagle::Deme& ioDeme,
Beagle::Context& ioContext) const
{
Beagle_StackTraceBeginM();
outStats.clear();
outStats.clearItems();
outStats.addItem("processed", ioContext.getProcessedDeme());
outStats.addItem("total-processed", ioContext.getTotalProcessedDeme());
//std::cerr << ioDeme.size() << std::endl;
if(ioDeme.size() == 0) {
/*
* The deme does not contain any individuals.
* Set all statistics to 0.0.
*/
outStats.setGenerationValues(std::string("deme")+uint2str(ioContext.getDemeIndex()),
ioContext.getGeneration(), 0, true);
outStats.resize(11);
outStats[0].mID = "mcc";
outStats[0].mAvg = 0.0;
outStats[0].mStd = 0.0;
outStats[0].mMax = 0.0;
outStats[0].mMin = 0.0;
outStats[1].mID = "true-positives";
outStats[1].mAvg = 0.0;
outStats[1].mStd = 0.0;
outStats[1].mMax = 0.0;
outStats[1].mMin = 0.0;
outStats[2].mID = "false-positives";
outStats[2].mAvg = 0.0;
outStats[2].mStd = 0.0;
outStats[2].mMax = 0.0;
outStats[2].mMin = 0.0;
outStats[3].mID = "true-negatives";
outStats[3].mAvg = 0.0;
outStats[3].mStd = 0.0;
outStats[3].mMax = 0.0;
outStats[3].mMin = 0.0;
outStats[4].mID = "false-negatives";
outStats[4].mAvg = 0.0;
outStats[4].mStd = 0.0;
outStats[4].mMax = 0.0;
outStats[4].mMin = 0.0;
outStats[5].mID = "true-positives-relative";
outStats[5].mAvg = 0.0;
outStats[5].mStd = 0.0;
outStats[5].mMax = 0.0;
outStats[5].mMin = 0.0;
outStats[6].mID = "false-positives-relative";
outStats[6].mAvg = 0.0;
outStats[6].mStd = 0.0;
outStats[6].mMax = 0.0;
outStats[6].mMin = 0.0;
outStats[7].mID = "true-negatives-relative";
outStats[7].mAvg = 0.0;
outStats[7].mStd = 0.0;
outStats[7].mMax = 0.0;
outStats[7].mMin = 0.0;
outStats[8].mID = "false-negatives-relative";
outStats[8].mAvg = 0.0;
outStats[8].mStd = 0.0;
outStats[8].mMax = 0.0;
outStats[8].mMin = 0.0;
outStats[9].mID = "treedepth";
outStats[9].mAvg = 0.0;
outStats[9].mStd = 0.0;
outStats[9].mMax = 0.0;
//.........这里部分代码省略.........
示例2: maxOf
/*!
* \brief Calculate statistics of a given deme.
* \param outStats Evaluated statistics.
* \param ioDeme Deme to evalute the statistics.
* \param ioContext Context of the evolution.
*/
void GP::StatsCalcFitnessKozaOp::calculateStatsDeme(Beagle::Stats& outStats,
Beagle::Deme& ioDeme,
Beagle::Context& ioContext) const
{
Beagle_StackTraceBeginM();
outStats.clear();
outStats.clearItems();
outStats.addItem("processed", ioContext.getProcessedDeme());
outStats.addItem("total-processed", ioContext.getTotalProcessedDeme());
if(ioDeme.size() == 0) {
outStats.setGenerationValues(std::string("deme")+uint2str(ioContext.getDemeIndex()),
ioContext.getGeneration(), 0, true);
outStats.resize(7);
outStats[0].mID = "normalized";
outStats[0].mAvg = 0.0;
outStats[0].mStd = 0.0;
outStats[0].mMax = 0.0;
outStats[0].mMin = 0.0;
outStats[1].mID = "adjusted";
outStats[1].mAvg = 0.0;
outStats[1].mStd = 0.0;
outStats[1].mMax = 0.0;
outStats[1].mMin = 0.0;
outStats[2].mID = "standardized";
outStats[2].mAvg = 0.0;
outStats[2].mStd = 0.0;
outStats[2].mMax = 0.0;
outStats[2].mMin = 0.0;
outStats[3].mID = "raw";
outStats[3].mAvg = 0.0;
outStats[3].mStd = 0.0;
outStats[3].mMax = 0.0;
outStats[3].mMin = 0.0;
outStats[4].mID = "hits";
outStats[4].mAvg = 0.0;
outStats[4].mStd = 0.0;
outStats[4].mMax = 0.0;
outStats[4].mMin = 0.0;
outStats[5].mID = "treedepth";
outStats[5].mAvg = 0.0;
outStats[5].mStd = 0.0;
outStats[5].mMax = 0.0;
outStats[5].mMin = 0.0;
outStats[6].mID = "treesize";
outStats[6].mAvg = 0.0;
outStats[6].mStd = 0.0;
outStats[6].mMax = 0.0;
outStats[6].mMin = 0.0;
return;
}
const GP::Individual::Handle lFirstIndiv =
castHandleT<GP::Individual>(ioDeme[0]);
const GP::FitnessKoza::Handle lFirstIndivFitness =
castHandleT<GP::FitnessKoza>(lFirstIndiv->getFitness());
if(ioDeme.size() == 1) {
outStats.setGenerationValues(std::string("deme")+uint2str(ioContext.getDemeIndex()),
ioContext.getGeneration(), 1, true);
outStats.resize(7);
outStats[0].mID = "normalized";
outStats[0].mAvg = lFirstIndivFitness->getNormalizedFitness();
outStats[0].mStd = 0.0;
outStats[0].mMax = lFirstIndivFitness->getNormalizedFitness();
outStats[0].mMin = lFirstIndivFitness->getNormalizedFitness();
outStats[1].mID = "adjusted";
outStats[1].mAvg = lFirstIndivFitness->getAdjustedFitness();
outStats[1].mStd = 0.0;
outStats[1].mMax = lFirstIndivFitness->getAdjustedFitness();
outStats[1].mMin = lFirstIndivFitness->getAdjustedFitness();
outStats[2].mID = "standardized";
outStats[2].mAvg = lFirstIndivFitness->getStandardizedFitness();
outStats[2].mStd = 0.0;
outStats[2].mMax = lFirstIndivFitness->getStandardizedFitness();
outStats[2].mMin = lFirstIndivFitness->getStandardizedFitness();
outStats[3].mID = "raw";
outStats[3].mAvg = lFirstIndivFitness->getRawFitness();
outStats[3].mStd = 0.0;
outStats[3].mMax = lFirstIndivFitness->getRawFitness();
outStats[3].mMin = lFirstIndivFitness->getRawFitness();
//.........这里部分代码省略.........