本文整理汇总了C++中vle::devs::InitEventList::getString方法的典型用法代码示例。如果您正苦于以下问题:C++ InitEventList::getString方法的具体用法?C++ InitEventList::getString怎么用?C++ InitEventList::getString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vle::devs::InitEventList
的用法示例。
在下文中一共展示了InitEventList::getString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
Builder(const vle::devs::ExecutiveInit& init,
const vle::devs::InitEventList& events)
: vle::devs::Executive(init, events)
{
model_prefix = events.getString("model-prefix");
model_classname = events.getString("model-class");
condition_name = events.getString("node-condition");
graph_type = events.getString("graph-type");
graph_connectivity = events.getString("graph-connectiviy");
directed = events.getBoolean("graph-directed");
if (graph_type == "graph")
use_graph_generator(events);
else if (graph_type == "regular")
use_regular_graph_generator(events);
else
throw vle::utils::ModellingError("Unknown graph type %s",
graph_type.c_str());
}
示例2: CompareDateAI
CompareDateAI(const vle::devs::ExecutiveInit &init,
const vle::devs::InitEventList &evts)
: vle::devs::Executive(init, evts)
{
vle::utils::Package package("safihr.cropmodel");
initialize_date(package.getDataFile(evts.getString("filename")));
std::sort(date.begin(), date.end(),
[] (const data& lhs,
const data& rhs)
{
return lhs.dmin < rhs.dmin;
});
DTraceModel(vle::fmt("AI need to build: %1% models") % date.size());
DTraceModel(vle::fmt("Table: %1%") % date);
}
示例3: use_graph_generator
void use_graph_generator(const vle::devs::InitEventList& events)
{
model_number = events.getInt("model-number");
std::string generator_name = events.getString("graph-generator");
if (events.exist("graph-seed"))
generator.seed(events.getInt("graph-seed"));
if (generator_name == "defined")
use_defined_graph_generator(events);
else if (generator_name == "small-world")
use_smallworld_graph_generator(events);
else if (generator_name == "scale-free")
use_scalefree_graph_generator(events);
else if (generator_name == "sorted-erdos-renyi")
use_sortederdesrenyi_graph_generator(events);
else if (generator_name == "erdos_renyi")
use_erdosrenyi_graph_generator(events);
else
throw vle::utils::ModellingError("Unknown graph gererator: %s",
generator_name.c_str());
}