示例#1
0
void Moore::externalTransition(const devs::ExternalEventList& events,
			       devs::Time /* time */)
{
    // mNewStates.clear();
    if (events.size() > 1) {
        devs::ExternalEventList sortedEvents = select(events);
        devs::ExternalEventList* clonedEvents =
            new devs::ExternalEventList;
        devs::ExternalEventList::const_iterator it = sortedEvents.begin();

        while (it != sortedEvents.end()) {
            clonedEvents->emplace_back(it->getPortName());
            devs::ExternalEvent& e = clonedEvents->back();
            copyExternalEventAttrs(*it, e);
            ++it;
        }
        mToProcessEvents.push_back(clonedEvents);
    } else {
        devs::ExternalEventList::const_iterator it = events.begin();
        devs::ExternalEventList* clonedEvents =
            new devs::ExternalEventList;
        clonedEvents->emplace_back(it->getPortName());
        devs::ExternalEvent& e = clonedEvents->back();
        copyExternalEventAttrs(*it, e);
        mToProcessEvents.push_back(clonedEvents);
    }
    mPhase = PROCESSING;
}
示例#2
0
 virtual void externalTransition(const devs::ExternalEventList &events,
                                 devs::Time /* time */) override
 {
     m_counter = m_counter + events.size();
 }
示例#3
0
 virtual void externalTransition(const devs::ExternalEventList& evts,
                                 devs::Time time) override
 {
     mDate = time;
     mNumber += evts.size();
 }