本文整理汇总了C++中vle::devs::InitEventList::getDouble方法的典型用法代码示例。如果您正苦于以下问题:C++ InitEventList::getDouble方法的具体用法?C++ InitEventList::getDouble怎么用?C++ InitEventList::getDouble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vle::devs::InitEventList
的用法示例。
在下文中一共展示了InitEventList::getDouble方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Rm
Rm(const vle::devs::DynamicsInit& model,
const vle::devs::InitEventList& events) :
DifferentialEquation(model,events)
{
gamma = events.getDouble("gamma"); //= 0.2
nu = events.getDouble("nu");// = 0.0
R.init(this, "R", events);
S.init(this, "S", events);
I.init(this, "I", events);
}
示例2: LotkaVolterraY
LotkaVolterraY(const vle::devs::DynamicsInit& model,
const vle::devs::InitEventList& events) :
DifferentialEquation(model,events)
{
gamma = (events.exist("gamma"))
? events.getDouble("gamma") : 0.5;
delta = (events.exist("delta"))
? events.getDouble("delta") : 0.5;
Y.init(this, "Y", events);
X.init(this, "X", events);
}
示例3: Sm
Sm(const vle::devs::DynamicsInit& model,
const vle::devs::InitEventList& events) :
ved::DifferentialEquation(model,events)
{
beta = events.getDouble("beta");// = 0.9
nu = events.getDouble("nu");// = 0.0
S = createVar("S");
E = createExt("E");
I = createExt("I");
R = createExt("R");
}
示例4: LotkaVolterraY
LotkaVolterraY(const vle::devs::DynamicsInit& model,
const vle::devs::InitEventList& events) :
ved::DifferentialEquation(model,events)
{
gamma = (events.exist("gamma"))
? events.getDouble("gamma") : 0.5;
delta = (events.exist("delta"))
? events.getDouble("delta") : 0.5;
Y = createVar("Y");
X = createExt("X");
}
示例5: ModellingError
TimeSlicingMethod(DifferentialEquation& eq,
const vd::InitEventList& events) :
DifferentialEquationImpl(eq, events), devs_state(INIT),
devs_options(), devs_guards(), devs_internal(),
int_method(*this, events)
{
if (events.exist("output_period")) {
const value::Value& v = *(events.get("output_period"));
devs_options.output_period = 0;
if (v.isInteger()) {
devs_options.output_period = v.toInteger().value();
}
if (devs_options.output_period < 1) {
throw utils::ModellingError(vle::utils::format(
"[%s] Parameter 'output_period' should be an int > 0",
getModelName().c_str()));
}
}
if (events.exist("time_step")) {
devs_options.dt = events.getDouble("time_step");
if (devs_options.dt <= 0) {
throw utils::ModellingError(vle::utils::format(
"[%s] Parameter 'time_step' should be > 0",
getModelName().c_str()));
}
}
}
示例6: 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"));
}
示例7: Seir
Seir(const vle::devs::DynamicsInit& model,
const vle::devs::InitEventList& events) :
DifferentialEquation(model,events)
{
beta = events.getDouble("beta");// = 0.9
gamma = events.getDouble("gamma"); //= 0.2
sigma = events.getDouble("sigma"); // = 0.5
nu = events.getDouble("nu");// = 0.0
S.init(this, "S", events);
E.init(this, "E", events);
I.init(this, "I", events);
R.init(this, "R", events);
n = S()+E()+I()+R();
}
示例8: Im
Im(const vle::devs::DynamicsInit& model,
const vle::devs::InitEventList& events) :
DifferentialEquation(model,events)
{
gamma = events.getDouble("gamma"); //= 0.2
sigma = events.getDouble("sigma"); // = 0.5
I.init(this, "I", events);
E.init(this, "E", events);
}
示例9: Im
Im(const vle::devs::DynamicsInit& model,
const vle::devs::InitEventList& events) :
ved::DifferentialEquation(model,events)
{
gamma = events.getDouble("gamma"); //= 0.2
sigma = events.getDouble("sigma"); // = 0.5
I = createVar("I");
E = createExt("E");
}
示例10: use_scalefree_graph_generator
void use_scalefree_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_scalefree(*this,
generator,
model_number,
events.getDouble("alpha"),
events.getDouble("beta"),
events.getBoolean("allow-self-loops"));
}
示例11: Y
Y(
const vd::DynamicsInit& init,
const vd::InitEventList& events)
: ve::DifferentialEquation(init, events)
{
X = createVar("X");
maturing = createVar("maturing");
masse = createVar("masse");
if (events.exist("KS"))
KS = events.getDouble("KS");
else
throw vle::utils::ModellingError("Parameter KS not found");
if (events.exist("KG"))
KG = events.getDouble("KG");
else
throw vle::utils::ModellingError("Parameter KG not found");
}
示例12: 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;
}
示例13: M
M(
const vd::DynamicsInit& init,
const vd::InitEventList& events)
: ve::DifferentialEquation(init, events)
{
C3 = createVar("C3");
C1 = createVar("C1");
DSAT = createVar("DSAT");
C2 = createVar("C2");
if (events.exist("p1"))
p1 = events.getDouble("p1");
else
throw vle::utils::ModellingError("Parameter p1 not found");
}