本文整理汇总了C++中vle::devs::ExternalEventList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ ExternalEventList::push_back方法的具体用法?C++ ExternalEventList::push_back怎么用?C++ ExternalEventList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vle::devs::ExternalEventList
的用法示例。
在下文中一共展示了ExternalEventList::push_back方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void out2(const vle::devs::Time& /* time */, vle::devs::ExternalEventList& output) const
{
vle::devs::ExternalEvent* e = new vle::devs::ExternalEvent("g");
e->attributes().addString("name","g");
e->attributes().addDouble("value",0);
output.push_back(e);
e = new vle::devs::ExternalEvent("b");
e->attributes().addString("name","b");
e->attributes().addDouble("value",0);
output.push_back(e);
}
示例2: output
virtual void output(const vle::devs::Time &time,
vle::devs::ExternalEventList &output) const
{
(void)time;
DTraceModel(vle::fmt("CompareDateAI: output at %1%") % time);
if (date.empty() || index >= date.size())
return;
auto low = std::lower_bound(date.begin() + index, date.end(),
(*(date.begin() + index)).dmin,
[] (const data& d, vle::devs::Time value)
{
return d.dmin <= value;
});
DTraceModel(vle::fmt("CompareDateAI: need to send %1% start message"
" (%2%)") % (std::distance(date.begin() + index,
low)) % index);
std::for_each(date.begin() + index, low,
[&output] (const data& d)
{
vle::devs::ExternalEvent *ret =
new vle::devs::ExternalEvent("start");
ret->putAttribute("specie_name",
new vle::value::String(
d.name));
ret->putAttribute("landunit_id",
new vle::value::Integer(
d.id));
output.push_back(ret);
});
}
示例3: aout
void aout(const std::string& /*name*/, const vmd::Activity& activity,
vd::ExternalEventList& out)
{
if (activity.isInStartedState()) {
vd::ExternalEvent* evt = new vd::ExternalEvent("out");
out.push_back(evt);
}
}
示例4: output
void output(const vle::devs::Time& time,
vle::devs::ExternalEventList& output) const
{
if (mPhase == SEND_ASSIGN) {
for (ResourceConstraints::const_iterator it =
mResourceConstraints->begin();
it != mResourceConstraints->end(); ++it) {
vle::devs::ExternalEvent* ee =
new vle::devs::ExternalEvent("assign");
ee << vle::devs::attribute("type", it->type());
ee << vle::devs::attribute("quantity", (int)it->quantity());
output.push_back(ee);
}
} else if (mPhase == SEND_DEMAND) {
for (ResourceConstraints::const_iterator it =
mResourceConstraints->begin();
it != mResourceConstraints->end(); ++it) {
vle::devs::ExternalEvent* ee =
new vle::devs::ExternalEvent("demand");
TraceModel(
vle::fmt(" [%1%:%2%] at %3% -> demand: %4% = %5%") %
getModel().getParentName() % getModelName() %
time % it->type() % it->quantity());
ee << vle::devs::attribute("type", it->type());
ee << vle::devs::attribute("quantity", (int)it->quantity());
output.push_back(ee);
}
} else if (mPhase == SEND_RELEASE) {
vle::devs::ExternalEvent* ee =
new vle::devs::ExternalEvent("release");
ee << vle::devs::attribute("resources",
mReleasedResources->toValue());
output.push_back(ee);
} else if (mPhase == SEND_UNAVAILABLE) {
vle::devs::ExternalEvent* ee =
new vle::devs::ExternalEvent("unavailable");
ee << vle::devs::attribute("resources",
mUnavailableResources.toValue());
output.push_back(ee);
}
}
示例5: out
void out(const vd::Time& /* time */, vd::ExternalEventList& output) const
{
vd::ExternalEvent* ee = new vd::ExternalEvent("out");
ee << vd::attribute("name", std::string("a"));
ee << vd::attribute("value", 2.);
ee << vd::attribute("type", ve::DifferenceEquation::ADD);
output.push_back(ee);
}
示例6: output
virtual void output(const vle::devs::Time& /* time */,
vle::devs::ExternalEventList& output) const
{
std::vector < std::string >::const_iterator it;
for (it = mPortList.begin(); it != mPortList.end(); ++it) {
output.push_back(buildEventWithAString("add", "name", *it));
}
}
示例7: out
void out(const vd::Time& time, vd::ExternalEventList& output) const
{
if(signal == "stop") {
std::cout << std::setprecision(8) << time << " OS::out model:" << getModelName() << std::endl;
vd::ExternalEvent* evt = new vd::ExternalEvent("act");
evt->putAttribute("name", new vv::String("Stade"));
evt->putAttribute("value", new vv::Double(RECOLTE));
output.push_back(evt);
}
}
示例8: output
void output(const vle::devs::Time& /* time */,
vle::devs::ExternalEventList& output) const
{
if (mPhase == SEND) {
const Activities::result_t& activities =
mActivities.startingActivities();
for(Activities::result_t::const_iterator it =
activities.begin();
it != activities.end(); ++it) {
vle::devs::ExternalEvent* ee =
new vle::devs::ExternalEvent((*it)->location().name());
ee << vle::devs::attribute("location",
(*it)->location().name());
ee << vle::devs::attribute("activity", (*it)->toValue());
output.push_back(ee);
}
}
}