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


C++ StringData::getName方法代码示例

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


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

示例1: createAgent

Agent* BlindAgentFactory::createAgent()
{
	//Create the agent and the Database
	Agent *bond = new Agent();
	Hive::Database *db = bond->getDatabase();

	// //////////////////////////////////////////////////////////////////
	// Create the base Data objects that are needed by the blind agent
	/////////////////////////////////////////////////////////////////////

	// type name
	StringData *mytypename = new StringData("mytypename", "hans");
	db->addData(mytypename->getName(), mytypename);

	// Internal clock
	DoubleData *celltime = new DoubleData("celltime", 0.0);
	db->addData(celltime->getName(), celltime);

	// record the last dt
	DoubleData *dt = new DoubleData("dt", 0);
	db->addData(dt);

	DoubleData *noutt = new DoubleData("nextOutputTime", 0.0);
	db->addData(noutt->getName(), noutt);

	// Equilibration Time  used by chemotaxis model
	DoubleData *eqtime = new DoubleData("eqtime", cpi->getEqTime());
	db->addData(eqtime->getName(), eqtime);

	// Output frequency of data from the cell may or may not be used
	DoubleData *outputinterval_Data = new DoubleData("outputinterval",this->output_interval);
	db->addData(outputinterval_Data->getName(), outputinterval_Data);

	// at the present the world as well as the metabolism simulatots can only handle one ligand profile
	TVectorData<double> *ligands = new TVectorData<double> ("ligands","tvector_double");
	ligands->reserveSize(1);
	ligands->at(0) = 0;
	db->addData(ligands->getName(),ligands);

	// this stores how much  nutrient a cell would like to get from the world
	TVectorData<double> *appetite = new TVectorData<double> ("appetite", "tvector_double");
	appetite->reserveSize(1);
	appetite->at(0) = 0;
	db->addData(appetite->getName(), appetite);


	// parameter that sets the base effeciency at which nutrient is removed and added to energy
	DoubleData *effeciency = new DoubleData("base_effeciency_of_conversion", 1);
	db->addData(effeciency);

	DoubleData *r1 = new DoubleData("r1", 1);
	db->addData(r1);

	// Marker of the generation of the cell
	IntegerData *generationData = new IntegerData("generation",0);
	db->addData(generationData);


	/// flag that will be set by the death simulator, if the cell has to die
	BoolData *death_flag = new BoolData("death_flag", false);
	db->addData(death_flag->getName(), death_flag);

	/// flag that will be set by the birth simulator, if the cell gives rise to offspring
	BoolData *birth_flag = new BoolData("birth_flag", false);
	db->addData(birth_flag->getName(), birth_flag);

	// UPDATED METABOLISM / BIRTH / DEATH SIMULATOR
	// starting or default values, same for all cells
	double starting_essence = 0.5;
	double default_kcat = 5;
	double default_Km   = 0.1;
	double default_essence_cost_for_movement = 0.025;
	double default_mass_threshold_for_birth = 1;
	double default_essence_threshold_for_death = 0.000001;
	double default_background_death_rate_per_unit_time = 0; // not sure whether it is a good idea to have this in the cell.
    double default_yield = 1;
    bool   default_is_levy = false;
    double default_parameter_for_steplength_dist = 1;
    double default_rho = 0.3;
    double default_velocity = 2;
    double default_current_angle = 2.0;
    double default_distance_desired_to_travel = 0.0;
    double default_traveled_distance = 0.0;

	// create the data items storing these parameters
	DoubleData *essence = new DoubleData("essence",starting_essence);
	// kcat and Km are the rescaled variables
	DoubleData *kcat = new DoubleData("kcat",default_kcat);
	DoubleData *Km = new DoubleData("Km",default_Km);
	// this is the parameter alpha
	DoubleData *essence_cost_for_movement = new DoubleData("essence_cost_for_movement",default_essence_cost_for_movement);
	DoubleData *background_death_rate_per_unit_time = new DoubleData("background_death_rate_per_unit_time",default_background_death_rate_per_unit_time);
	// the user will not be able to set the birth threshold it  is always equal to one
	DoubleData *essence_threshold_for_birth = new DoubleData("essence_threshold_for_birth",default_mass_threshold_for_birth);
	DoubleData *essence_threshold_for_death = new DoubleData("essence_threshold_for_death",default_essence_threshold_for_death);
	DoubleData *velocity = new DoubleData("velocity",default_velocity);
	DoubleData *yield = new DoubleData("yield", default_yield);
	BoolData   *is_levy = new BoolData("is_levy", default_is_levy);
	DoubleData *rho = new DoubleData("rho", default_rho);
	DoubleData *parameter_for_steplength_dist =new DoubleData("parameter_for_steplength_dist", default_parameter_for_steplength_dist);
//.........这里部分代码省略.........
开发者ID:BHIVE,项目名称:BHIVE,代码行数:101,代码来源:blindagentfactory.cpp


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