• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ beagle::System类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中beagle::System的典型用法代码示例。如果您正苦于以下问题:C++ System类的具体用法?C++ System怎么用?C++ System使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: lDescription

/*!
 *  \brief Register the parameters of the constrained GP tree "grow" intialization operator.
 *  \param ioSystem System of the evolution.
 */
void GP::InitGrowOp::registerParams(Beagle::System& ioSystem)
{
	Beagle_StackTraceBeginM();
	GP::InitializationOp::registerParams(ioSystem);
	{
		Register::Description lDescription(
		    "Flag for whether the 'grow' method works as defined by Koza",
		    "Bool",
		    "0",
		    "Set this flag if you wish to initialize individuals using the 'grow' method as defined by Koza in GPI (and as used in GPII, GPIII, and probably GPIV---although it is not made entirely clear).  If this flag is set to true then individuals are grown with a minimum depth of 2.  If this flag is set to false then the minimum depth of individuals is paired to the register variable 'gp.init.mindepth'.  Irrespective of this flag, maximum depth of individuals will range according to the values of 'gp.init.mindepth' and 'gp.init.maxdepth'; note that if you wish to entirely replicate Koza's method then mindepth and maxdepth should be set to the same value."
		);
		mKozaGrow = castHandleT<Bool>
		            (ioSystem.getRegister().insertEntry("gp.init.kozagrow", new Bool(false), lDescription));
	}

	Beagle_StackTraceEndM("void GP::InitGrowOp::registerParams(Beagle::System&)");
}
开发者ID:splodginald,项目名称:MPI-PACC-OpenBeagle,代码行数:21,代码来源:InitGrowOp.cpp


示例2: lDescription

/*!
 *  \brief Register the parameters of the constrained GP tree swap mutation operator.
 *  \param ioSystem System of the evolution.
 */
void STGP::MutationSwapConstrainedOp::registerParams(Beagle::System& ioSystem)
{
	Beagle_StackTraceBeginM();
	MutationSwapOp::registerParams(ioSystem);
	std::ostringstream lOSS;
	lOSS << "Maximum number of attempts to modify a GP tree in a genetic ";
	lOSS << "operation. As there is topological constraints on GP trees (i.e. tree ";
	lOSS << "depth limit), it is often necessary to try a genetic operation several times.";
	Register::Description lDescription(
	    "Max number of attempts",
	    "UInt",
	    "2",
	    lOSS.str()
	);
	mNumberAttempts = castHandleT<UInt>(
	                      ioSystem.getRegister().insertEntry("gp.try", new UInt(2), lDescription));
	Beagle_StackTraceEndM();
}
开发者ID:GhostGambler,项目名称:beagle,代码行数:22,代码来源:MutationSwapConstrainedOp.cpp


示例3: lDescription

/*!
 *  \brief Register the parameters of this operator.
 *  \param ioSystem System used to initialize the operator.
 */
void GP::TermMaxHitsOp::registerParams(Beagle::System& ioSystem)
{
	Beagle_StackTraceBeginM();
	TerminationOp::registerParams(ioSystem);
	std::ostringstream lOSS;
	lOSS << "Number of hits required in an individual ";
	lOSS << "in order for the evolution process to terminate. ";
	lOSS << "If 0, termination criteria is ignored.";
	Register::Description lDescription(
	    "Max hits term criterion",
	    "UInt",
	    uint2str(mMaxHitsDefault),
	    lOSS.str()
	);
	mMaxHits = castHandleT<UInt>(
	               ioSystem.getRegister().insertEntry("gp.term.maxhits", new UInt(mMaxHitsDefault), lDescription));
	Beagle_StackTraceEndM("void GP::TermMaxHitsOp::registerParams(Beagle::System&)");
}
开发者ID:splodginald,项目名称:MPI-PACC-OpenBeagle,代码行数:22,代码来源:TermMaxHitsOp.cpp


示例4: Beagle_IOExceptionNodeM

/*!
 *  \brief Read a primitive super set from a XML subtree.
 *  \param inIter XML iterator used to read the super set from.
 *  \param ioSystem Evolutionary system.
 *  \throw Beagle::IOException If size atribute not present.
 */
void GP::PrimitiveSuperSet::readWithSystem(PACC::XML::ConstIterator inIter, Beagle::System& ioSystem)
{
	Beagle_StackTraceBeginM();
	if((inIter->getType()!=PACC::XML::eData) || (inIter->getValue()!="GP-PrimitiveSuperSet"))
		throw Beagle_IOExceptionNodeM(*inIter, "tag <GP-PrimitiveSuperSet> expected!");
	const Factory& lFactory = ioSystem.getFactory();
	Context::Alloc::Handle lContextAlloc =
	    castHandleT<Context::Alloc>(lFactory.getConceptAllocator("Context"));
	GP::Context::Handle lGPContext =
	    castHandleT<GP::Context>(lContextAlloc->allocate());
	lGPContext->setSystemHandle(System::Handle(&ioSystem));
	GP::PrimitiveSet::Alloc::Handle lPrimitSetsAlloc =
		castHandleT<GP::PrimitiveSet::Alloc>(lFactory.getConceptAllocator("GP-PrimitiveSet"));
	mPrimitSets.clear();
	for(PACC::XML::ConstIterator lChild=inIter->getFirstChild(); lChild; ++lChild) {
		if((lChild->getType()==PACC::XML::eData) && (lChild->getValue()=="GP-PrimitiveSet")) {
			GP::PrimitiveSet::Handle lPrimitSet =
				castHandleT<GP::PrimitiveSet>(lPrimitSetsAlloc->allocate());
			lPrimitSet->readWithContext(lChild, *lGPContext);
			mPrimitSets.push_back(lPrimitSet);
		}
	}
	Beagle_StackTraceEndM("void GP::PrimitiveSuperSet::readWithSystem(PACC::XML::ConstIterator inIter, Beagle::System& ioSystem)");
}
开发者ID:splodginald,项目名称:MPI-PACC-OpenBeagle,代码行数:30,代码来源:PrimitiveSuperSet.cpp


示例5: lProbaDescription

/*!
 *  \brief Register the parameters of this operator.
 *  \param ioSystem System of the evolution.
 */
void GP::MutationSwapSubtreeOp::registerParams(Beagle::System& ioSystem)
{
	Beagle_StackTraceBeginM();

	{
		std::ostringstream lOSS;
		lOSS << "Swap subtree mutation probability for an individual. ";
		lOSS << "A swap subtree mutation consists to swap two subtrees of a tree in an ";
		lOSS << "individual.";
		Register::Description lProbaDescription(
		    "Swap subtree mutation prob.",
		    "Double",
		    "0.0",
		    lOSS.str()
		);
		mMutationProba = castHandleT<Double>(
		                     ioSystem.getRegister().insertEntry(mMutationPbName, new Double(0.0f), lProbaDescription));
	}
	Beagle::MutationOp::registerParams(ioSystem);
	{
		std::ostringstream lOSS;
		lOSS << "Probability that a swap subtree is internal ";
		lOSS << "(the mutation occurs between three points, where the 2nd point is in the ";
		lOSS << "1st point's subtree, and the 3rd point is in the 2nd point's subtree) vs ";
		lOSS << "being external (the mutation occurs between two points, ";
		lOSS << "where both points are not within the other's subtree). ";
		lOSS << "Value of 1.0 means that the swap subtrees mutations are all internal ";
		lOSS << "while value of 0.0 means that swap subtrees mutations are all external.";
		Register::Description lDescription(
		    "Swap subtree mut. distrib. prob.",
		    "Float",
		    "0.5",
		    lOSS.str()
		);
		mDistributionProba = castHandleT<Float>(
		                         ioSystem.getRegister().insertEntry(mDistribPbName, new Float(0.5f), lDescription));
	}
	{
		Register::Description lDescription(
		    "Maximum tree depth",
		    "UInt",
		    "17",
		    "Maximum allowed depth for the trees."
		);
		mMaxTreeDepth = castHandleT<UInt>(
		                    ioSystem.getRegister().insertEntry("gp.tree.maxdepth", new UInt(17), lDescription));
	}
	{
		std::ostringstream lOSS;
		lOSS << "Maximum number of attempts to modify a GP tree in a genetic ";
		lOSS << "operation. As there is topological constraints on GP trees (i.e. tree ";
		lOSS << "depth limit), it is often necessary to try a genetic operation several times.";
		Register::Description lDescription(
		    "Max number of attempts",
		    "UInt",
		    "2",
		    lOSS.str()
		);
		mNumberAttempts = castHandleT<UInt>(
		                      ioSystem.getRegister().insertEntry("gp.try", new UInt(2), lDescription));
	}
	Beagle_StackTraceEndM();
}
开发者ID:AngelGate,项目名称:beagle,代码行数:67,代码来源:MutationSwapSubtreeOp.cpp


示例6: RunTimeException

/*!
 * \brief Initialize this MPICommunication component.
 * \param ioSystem System reference.
 */
void HPC::MPICommunication::init(Beagle::System& ioSystem)
{
	Beagle_StackTraceBeginM();
	void* lValue;
	if(!MPI::COMM_WORLD.Get_attr( MPI::TAG_UB, &lValue ))
		throw RunTimeException("HPC::MPICommunication::init(Beagle::System&) the MPI::TAG_UB couldn't be retrieve.",__FILE__,__LINE__);
	mTagUpperBound = *(int*)lValue;

	unsigned int lSize = MPI::COMM_WORLD.Get_size();
	mNodeRank = new UInt(MPI::COMM_WORLD.Get_rank());
	int lRank = (*mNodeRank);
	UIntArray::Handle lPopulationSize = castHandleT<UIntArray>(ioSystem.getRegister().getEntry("ec.pop.size"));

	unsigned int lNbEvolvers = (*mNbEvolvers);
	int lNbEvaluators = lSize - lNbEvolvers - 1;

	Beagle_ValidateParameterM( lNbEvolvers <= lPopulationSize->size() && lNbEvolvers > 0,
					"hpc.evolver.nb",
					"The number of evolver must between 1 and the number of deme");

	Beagle_ValidateParameterM( lNbEvolvers <= lNbEvaluators  &&  lNbEvaluators > 0,
					"Number of nodes.",
					"There is not enough node for each evolver node to have at least one evaluator node each.");

	mTopology["Supervisor"] = new IntArray;
	mTopology["Any"] = new IntArray;
	mTopology["Parent"] = new IntArray;
	mTopology["Sibling"] = new IntArray;
	mTopology["Child"] = new IntArray;

	mTopology["Supervisor"]->push_back(0);
	mTopology["Any"]->push_back(MPI::ANY_SOURCE);

	mTypesMap["Supervisor"] = 1;
	mTypesMap["Evolver"] = lNbEvolvers;
	mTypesMap["Evaluator"] = lSize - lNbEvolvers - 1;

	if( lRank == 0 ){
		mNodeType = "Supervisor";
		for(int i = 0; i < lPopulationSize->size(); ++i){
			mTopology["Child"]->push_back((i % lNbEvolvers) + 1);
		}
	}
	else if( lRank <= lNbEvolvers){
		mNodeType = "Evolver";
		mTopology["Parent"]->push_back(0);
		int i = lRank + 1;
		for(;  i <= lNbEvolvers; ++i)
			mTopology["Sibling"]->push_back(i);
		for(i = 1; i < lRank; ++i)
			mTopology["Sibling"]->push_back(i);

		for(int j = lRank + lNbEvolvers; j < lSize; j += lNbEvolvers){
			mTopology["Child"]->push_back(j);
		}

		UIntArray::Handle lNewPopulationSize = new UIntArray;
		for(unsigned int k =  lRank - 1; k < lPopulationSize->size(); k += lNbEvolvers){
			lNewPopulationSize->push_back( (*lPopulationSize)[k] );
		}
		(*lPopulationSize) = (*lNewPopulationSize);
	}
	else{
		mNodeType = "Evaluator";
		UIntArray::Handle lNewPopulationSize = new UIntArray;

		if(lRank % lNbEvolvers != 0 ){
			mTopology["Parent"]->push_back(lRank % lNbEvolvers);
		} else {
			mTopology["Parent"]->push_back(lNbEvolvers);
		}
		for(unsigned int i = (*mTopology["Parent"])[0] - 1; i < lPopulationSize->size(); i+= lNbEvolvers){
			lNewPopulationSize->push_back( (*lPopulationSize)[i] );
		}
		(*lPopulationSize) = (*lNewPopulationSize);
	}

	Beagle_HPC_StackTraceEndM("void HPC::MPICommunication::init(System& ioSystem)");
}
开发者ID:GhostGambler,项目名称:beagle,代码行数:83,代码来源:MPICommunication.cpp


示例7: lDescription

/*!
 *  \brief Register the parameters of the generic GP intialization operator.
 *  \param ioSystem System of the evolution.
 */
void GP::InitializationOp::registerParams(Beagle::System& ioSystem)
{
	Beagle_StackTraceBeginM();
	Beagle::InitializationOp::registerParams(ioSystem);
	{
		Register::Description lDescription(
		    "Maximum initial tree depth",
		    "UInt",
		    "5",
		    "Maximum depth for newly initialized trees."
		);
		mMaxTreeDepth = castHandleT<UInt>(
		                    ioSystem.getRegister().insertEntry("gp.init.maxdepth", new UInt(5), lDescription));
	}
	{
		Register::Description lDescription(
		    "Minimum initial tree depth",
		    "UInt",
		    "2",
		    "Minimum depth for newly initialized trees."
		);
		mMinTreeDepth = castHandleT<UInt>(
		                    ioSystem.getRegister().insertEntry("gp.init.mindepth", new UInt(2), lDescription));
	}
	{
		std::ostringstream lOSS;
		lOSS << "Maximum number of GP tree in newly initialized individuals. More than one tree ";
		lOSS << "is usually useful with ADFs (and other ADx).";
		Register::Description lDescription(
		    "Maximum number of trees",
		    "UInt",
		    "1",
		    lOSS.str()
		);
		mMaxNumberTrees = castHandleT<UInt>(
		                      ioSystem.getRegister().insertEntry("gp.init.maxtree", new UInt(1), lDescription));
	}
	{
		std::ostringstream lOSS;
		lOSS << "Minimum number of GP tree in newly initialized individuals. More than one tree ";
		lOSS << "is usually useful with ADFs (and other ADx).";
		Register::Description lDescription(
		    "Minimum number of trees",
		    "UInt",
		    "1",
		    lOSS.str()
		);
		mMinNumberTrees = castHandleT<UInt>(
		                      ioSystem.getRegister().insertEntry("gp.init.mintree", new UInt(1), lDescription));
	}
	{
		std::ostringstream lOSS;
		lOSS << "Maximum number of arguments in GP tree.  The first element in the array "
		<< "specifies the maximum number of arguments in the first tree of an individual, "
		<< "the second element specifies the second tree and so on.  If there are more "
		<< "trees in an individual than elements in the array then the last element is "
		<< "recycled.  Tree arguments are usually useful with ADFs (and similar).";
		Register::Description lDescription(
		    "Max. number of tree arguments",
		    "UIntArray",
		    "0/2",
		    lOSS.str()
		);
		mMaxTreeArgs = new UIntArray;
		mMaxTreeArgs->push_back(0);
		mMaxTreeArgs->push_back(2);
		mMaxTreeArgs = castHandleT<UIntArray>(
		                   ioSystem.getRegister().insertEntry("gp.tree.maxargs", mMaxTreeArgs, lDescription));
	}
	{
		std::ostringstream lOSS;
		lOSS << "Minimum number of arguments in GP tree.  The first element in the array "
		<< "specifies the minimum number of arguments in the first tree of an individual, "
		<< "the second element specifies the second tree and so on.  If there are more "
		<< "trees in an individual than elements in the array then the last element is "
		<< "recycled.  Tree arguments are usually useful with ADFs (and similar).";
		Register::Description lDescription(
		    "Min. number of tree arguments",
		    "UIntArray",
		    "0/2",
		    lOSS.str()
		);
		mMinTreeArgs = new UIntArray;
		mMinTreeArgs->push_back(0);
		mMinTreeArgs->push_back(2);
		mMinTreeArgs = castHandleT<UIntArray>(
		                   ioSystem.getRegister().insertEntry("gp.tree.minargs", mMinTreeArgs, lDescription));
	}
	Beagle_StackTraceEndM();
}
开发者ID:AngelGate,项目名称:beagle,代码行数:94,代码来源:InitializationOp.cpp


示例8: lDescription

/*!
 *  \brief Register parameters of the MilestoneWrite operator.
 *  \param ioSystem Reference to the system.
 */
void Master::MilestoneWriteOp::registerParams(Beagle::System& ioSystem)
{
	Beagle_StackTraceBeginM();

	Beagle::MilestoneWriteOp::registerParams(ioSystem);
	{
		Register::Description lDescription(
		    "Application name",
		    "String",
		    std::string("'")+mDefaultAppName+std::string("'"),
		    "Name of the application, as registered in the server."
		);
		mAppName = castHandleT<Beagle::String>(
		               ioSystem.getRegister().insertEntry("db.app.name", new Beagle::String(mDefaultAppName), lDescription));
	}
	{
		Register::Description lDescription(
		    "IP server address",
		    "String",
		    "127.0.0.1",
		    "IP address of the master-slave server."
		);
		mServerIP = castHandleT<Beagle::String>(
		                ioSystem.getRegister().insertEntry("db.server.ip", new Beagle::String("127.0.0.1"), lDescription));
	}
	{
		Register::Description lDescription(
		    "IP server port",
		    "UInt",
		    "9123",
		    "IP port of the master-slave server."
		);
		mServerPort = castHandleT<UInt>(
		                  ioSystem.getRegister().insertEntry("db.server.port", new UInt(9123), lDescription));
	}
	{
		Register::Description lDescription(
		    "Compression level",
		    "UInt",
		    "3",
		    "Evolver communication compression."
		);
		mCompressionLevel = castHandleT<UInt>(
		                        ioSystem.getRegister().insertEntry("db.evolver.compression", new UInt(0), lDescription));
	}
#ifdef BEAGLE_HAVE_LIBZ
	{
		std::ostringstream lOSS;
		lOSS << "If true, this flag indicates that milestones will be ";
		lOSS << "compressed with gzip. Otherwise, each milestone are kept plain text.";
		Register::Description lDescription(
		    "Milestone compression flag",
		    "Bool",
		    "1",
		    lOSS.str()
		);
		mCompressMilestone = castHandleT<Bool>(
		                         ioSystem.getRegister().insertEntry("ms.write.compress", new Bool(true), lDescription));
	}
#endif // BEAGLE_HAVE_LIBZ

	Beagle_StackTraceEndM();
}
开发者ID:AngelGate,项目名称:beagle,代码行数:67,代码来源:MilestoneWriteOp.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ beast::Journal类代码示例发布时间:2022-05-31
下一篇:
C++ beagle::Context类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap