本文整理汇总了C++中vle::devs::InitEventList::get方法的典型用法代码示例。如果您正苦于以下问题:C++ InitEventList::get方法的具体用法?C++ InitEventList::get怎么用?C++ InitEventList::get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vle::devs::InitEventList
的用法示例。
在下文中一共展示了InitEventList::get方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ModellingError
Generator(const vd::DynamicsInit& init, const vd::InitEventList& events)
: vd::Dynamics(init, events)
{
vg::ConnectionList my_list;
// m_duration = vv::toDouble(events.get("duration"));
m_duration = 0.1;
if (events.end() != events.find("source_init_level")) {
m_val = vv::toDouble(events.get("source_init_level"));
} else {
m_val = 1;
Trace(6,
"Warning : Model %s got no init"
" output level (source_init_level) : assuming 1\n",
getModelName().c_str());
}
if (events.end() != events.find("source_trend")) {
m_trend = vv::toDouble(events.get("source_trend"));
if (events.end() != events.find("source_quantum")) {
m_quantum = vv::toDouble(events.get("source_quantum"));
} else {
m_quantum = 0.01;
Trace(6,
"Warning : Model %s got no output"
" quantum (source_quantum) : assuming 0.01\n",
getModelName().c_str());
}
} else {
m_trend = 0;
Trace(6,
"%s got no output trend (source_trend)"
" : assuming 0\n",
getModelName().c_str());
// no trend => quantum is useless but..
m_quantum = 0.01;
}
if (0 == m_quantum) {
throw vu::ModellingError("Model %s has null output quantum.",
getModelName().c_str());
}
m_has_output_port = false;
my_list = getModel().getOutputPortList();
if (my_list.size() > 0) {
m_output_port_label = (my_list.begin())->first;
m_has_output_port = true;
}
if (my_list.size() > 1) {
Trace(6,
"Warning: multiple output ports."
" Will use only port %s\n",
m_output_port_label.c_str());
}
}
示例2: 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()));
}
}
}
示例3:
XRay::XRay(const vd::DynamicsInit& init, const vd::InitEventList& events)
: vd::Dynamics(init, events)
{
mProbabilityRightSR = vv::toDouble(events.get("probabilityRightSR"));
mProbabilityRightI = vv::toDouble(events.get("probabilityRightI"));
mObservationTimeStep = vv::toDouble(events.get("timeStep"));
if (events.exist("R_INIT") and
(vv::toBoolean(events.get("R_INIT")))) {
mNbModel =vv::toInteger(events.get("graphInfo_number"));
mPrefix =vv::toString(events.get("graphInfo_prefix"));
} else {
mNbModel = events.getMap("graphInfo").getInt("number");
mPrefix = events.getMap("graphInfo").getString("prefix");
}
mSampleSize = /*boost::lexical_cast<int>*/ (vv::toDouble(events.get("echProp")) * mNbModel);
//std::cout<<"smplesize= "<<mSampleSize<<"\n";
mPrevalence=0.; mIncidence=0.;
}
示例4: ActivityScheduler
ActivityScheduler(const vle::devs::DynamicsInit& init,
const vle::devs::InitEventList& events) :
vle::devs::Dynamics(init, events),
mActivities(events.get("activities"))
{
}