本文整理汇总了C++中vle::devs::InitEventList::getInt方法的典型用法代码示例。如果您正苦于以下问题:C++ InitEventList::getInt方法的具体用法?C++ InitEventList::getInt怎么用?C++ InitEventList::getInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vle::devs::InitEventList
的用法示例。
在下文中一共展示了InitEventList::getInt方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rgg
void use_1d_regular_graph_generator(const vle::devs::InitEventList& events)
{
vle::translator::regular_graph_generator::parameter param{
std::bind(&Builder::regular_graph_generator_make_model,
this,
std::placeholders::_1,
std::placeholders::_2,
std::placeholders::_3),
regular_graph_generator_connectivity()
};
vle::translator::regular_graph_generator rgg(param);
const auto& v = events.getSet("mask").value();
std::vector<std::string> mask;
std::transform(v.begin(),
v.end(),
std::back_inserter(mask),
[](const auto& v) { return v->toString().value(); });
rgg.make_1d(*this,
events.getInt("lenght"),
events.getBoolean("graph-wrap"),
mask,
events.getInt("x-mask"));
}
示例2: use_erdosrenyi_graph_generator
void use_erdosrenyi_graph_generator(const vle::devs::InitEventList& events)
{
vle::translator::graph_generator::parameter param{
std::bind(&Builder::graph_generator_make_model,
this,
std::placeholders::_1,
std::placeholders::_2,
std::placeholders::_3),
graph_generator_connectivity(),
directed
};
vle::translator::graph_generator gg(param);
if (events.exist("fraction"))
gg.make_erdos_renyi(*this,
generator,
model_number,
events.getDouble("fraction"),
events.getBoolean("allow-self-loops"));
else
gg.make_erdos_renyi(*this,
generator,
model_number,
events.getInt("edges_number"),
events.getBoolean("allow-self-loops"));
}
示例3: use_regular_graph_generator
void use_regular_graph_generator(const vle::devs::InitEventList& events)
{
int dimension = events.getInt("graph-dimension");
if (dimension == 1)
use_1d_regular_graph_generator(events);
else if (dimension == 2)
use_2d_regular_graph_generator(events);
else
throw vle::utils::ModellingError(
"Undefined regular graph with %d dimension", dimension);
}
示例4: ExBohachevsky
ExBohachevsky(const vd::DynamicsInit& init, const vd::InitEventList& events) :
vd::Dynamics(init,events)
{
x1 = events.getDouble("x1");
x2 = events.getDouble("x2");
my = pow(x1,2) + 2 * pow(x2,2) - 0.3 * cos(3 * M_PI * x1)
- 0.4 * cos(4 * M_PI * x2) + 0.7;
mrand.seed(events.getInt("seed"));
double noise = mrand.normal(0,0.1);
my_noise = my + noise;
}
示例5: 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());
}
示例6: use_smallworld_graph_generator
void use_smallworld_graph_generator(const vle::devs::InitEventList& events)
{
vle::translator::graph_generator::parameter param{
std::bind(&Builder::graph_generator_make_model,
this,
std::placeholders::_1,
std::placeholders::_2,
std::placeholders::_3),
graph_generator_connectivity(),
directed
};
vle::translator::graph_generator gg(param);
gg.make_smallworld(*this,
generator,
model_number,
events.getInt("k"),
events.getDouble("probability"),
events.getBoolean("allow-self-loops"));
}
示例7: ConstantGenerator
ConstantGenerator(const vle::devs::DynamicsInit &init,
const vle::devs::InitEventList &events)
: vle::devs::Dynamics(init, events)
{
m_neighborhood = events.getInt("neighborhood");
}