当前位置: 首页>>代码示例>>C++>>正文


C++ ExternalEventList::push_back方法代码示例

本文整理汇总了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);
 }
开发者ID:,项目名称:,代码行数:11,代码来源:

示例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);
                      });
    }
开发者ID:quesnel,项目名称:safihr.cropmodel,代码行数:35,代码来源:CompareDateAI.cpp

示例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);
     }
 }
开发者ID:eric-casellas,项目名称:packages,代码行数:8,代码来源:OnlyAgentPrecedenceConstraint.cpp

示例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);
            }
        }
开发者ID:devs-labs,项目名称:rcpsp,代码行数:46,代码来源:Assignment.cpp

示例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);
    }
开发者ID:GG31,项目名称:packages,代码行数:9,代码来源:Perturb7.cpp

示例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));
		}	
	}
开发者ID:picasa,项目名称:archidemio,代码行数:9,代码来源:Connector.cpp

示例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);
     }
 }
开发者ID:dayre31,项目名称:idm2014,代码行数:10,代码来源:OS_recolte.cpp

示例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);
                }
            }
        }
开发者ID:devs-labs,项目名称:rcpsp,代码行数:20,代码来源:ActivityScheduler.cpp


注:本文中的vle::devs::ExternalEventList::push_back方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。