Example #1
0
 void out1(const vle::devs::Time&  /*time*/, vle::devs::ExternalEventList& output) const
 {
     output.emplace_back("g");
     value::Map& map = output.back().addMap();
     map.addString("name","g");
     map.addDouble("value",10);
     output.emplace_back("b");
     value::Map& map2 = output.back().addMap();//TODO pas compris error qaund ion utilise la meme ref map (sur unique_ptr<Value>)
     map2.addString("name","b");
     map2.addDouble("value",10);
 }
Example #2
0
 void out2(const vle::devs::Time& /* time */, vle::devs::ExternalEventList& output) const
 {
     output.emplace_back("g");
     value::Map& map = output.back().addMap();
     map.addString("name","g");
     map.addDouble("value",0);
     output.emplace_back("b");
     value::Map& map2 = output.back().addMap();
     map2.addString("name","b");
     map2.addDouble("value",0);
 }
Example #3
0
    void treat(const std::string& /*name*/, const ved::Activity& /*activity*/,
            vd::ExternalEventList& output)
    {
        output.emplace_back("x");
        value::Map& m = output.back().addMap();
        m.addString("name","x");
        m.addDouble("value",
                plantlouse_population * (1-treatment_effect_on_plantlouse));

        output.emplace_back("y");
        value::Map& m2 = output.back().addMap();
        m2.addString("name","y");
        m2.addDouble("value",
                ladybird_population * (1-treatment_effect_on_ladybird));

    }
Example #4
0
 virtual void output(vle::devs::Time /*time*/,
                     vle::devs::ExternalEventList &output) const override
 {
     output.emplace_back("out");
     output.back().addMap().addDouble("value",
                                      static_cast<double>(m_neighborhood));
 }
 void aout(const std::string& /*name*/, const vmd::Activity& activity,
           vd::ExternalEventList& out)
 {
     if (activity.isInStartedState()) {
     	out.emplace_back("out");
     }
 }
Example #6
0
    void output(vd::Time time, vd::ExternalEventList& output) const override
    {
        if (m_has_output_port) {
            const double out_val = m_val + m_trend * time;

            output.emplace_back(m_output_port_label);
            output.back().addMap().addDouble("d_val", out_val);
        }
    }
Example #7
0
 virtual void output(vd::Time  /*time*/,
                     vd::ExternalEventList &output) const override
 {
     if (m_has_output_port) {
         output.emplace_back(m_output_port_label);
         auto& m = output.back().addMap();
         m.addDouble("up", m_upthreshold);
         m.addDouble("down", m_downthreshold);
     }
 }
 /**
  * @brief Output function that fills the value of state variables
  * @param time, time of the output
  * @param extEvtList, the list of external event
  */
 void outputVar(const vd::Time& /*time*/,
         vd::ExternalEventList& extEvtList) const
 {
     Variables::const_iterator itb = vars().begin();
     Variables::const_iterator ite = vars().end();
     for (; itb != ite; itb++) {
         const Variable& v = *itb->second;
         if (getModel().existOutputPort(itb->first)) {
             extEvtList.emplace_back(itb->first);
             value::Double& val = extEvtList.back().addDouble();
             val = v.getVal();
         }
     }
 }
Example #9
0
 void out2(const vle::devs::Time& /*time*/ , vle::devs::ExternalEventList& output) const
 {
     output.emplace_back("c");
     output.back().addDouble(0);
 }
Example #10
0
 void output(vle::devs::Time /*time*/,
     vle::devs::ExternalEventList& output) const override
 {
     output.emplace_back("a");
     output.back().addDouble(a+3);
 }