本文整理汇总了C++中devs::ExternalEventList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ ExternalEventList::end方法的具体用法?C++ ExternalEventList::end怎么用?C++ ExternalEventList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类devs::ExternalEventList
的用法示例。
在下文中一共展示了ExternalEventList::end方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: externalTransition
virtual void externalTransition(
const devs::ExternalEventList& event ,
const devs::Time& time)
{
for (vd::ExternalEventList::const_iterator it = event.begin();
it != event.end(); ++it) {
if ((*it)->onPort("surveillance")) {
Intervention newIntervention;
value::Map infNodes = (*it)->getMapAttributeValue("infectedNodes");
for (vv::MapValue::const_iterator node = infNodes.begin();
node != infNodes.end(); node++) {
m_nodeStates[node->first] = node->second->toString().value();
newIntervention.second.push_back(node->first);
}
newIntervention.first = time.getValue() + m_delay;
m_interventions.push_back(newIntervention);
if (m_phase == IDLE)
m_phase = CONTROL;
/*
else {
vle::utils::InternalError error(
"\nControler must recieve only one surveillance repport in this version\n");
throw error;
}
*/
}
}
m_current_time = time.getValue();
}
示例2: externalTransition
void Agent::externalTransition(
const devs::ExternalEventList& events,
const devs::Time& time)
{
mCurrentTime = time;
for (devs::ExternalEventList::const_iterator it = events.begin();
it != events.end(); ++it) {
const std::string& port((*it)->getPortName());
const value::Map& atts = (*it)->getAttributes();
if (port == "ack") {
const std::string& activity(atts.getString("name"));
const std::string& order(atts.getString("value"));
if (order == "done") {
setActivityDone(activity, time);
} else if (order == "fail") {
setActivityFailed(activity, time);
} else {
throw utils::ModellingError(
fmt(_("Decision: unknown order `%1%'")) % order);
}
} else {
value::Map::const_iterator jt = atts.value().find("value");
if (jt == atts.end()) {
jt = atts.value().find("init");
}
if (jt == atts.end() or not jt->second) {
throw utils::ModellingError(
fmt(_("Decision: no value in this message: `%1%'")) %
(*it));
}
if (mPortMode) {
applyFact(port, *jt->second);
} else {
const std::string& fact((*it)->getStringAttributeValue("name"));
applyFact(fact, *jt->second);
}
}
}
mState = UpdateFact;
}