Beispiel #1
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);
 }
Beispiel #2
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);
 }
Beispiel #3
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));
 }
Beispiel #4
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));

    }
Beispiel #5
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);
        }
    }
Beispiel #6
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();
         }
     }
 }
Beispiel #8
0
 void out2(const vle::devs::Time& /*time*/ , vle::devs::ExternalEventList& output) const
 {
     output.emplace_back("c");
     output.back().addDouble(0);
 }
Beispiel #9
0
 void output(vle::devs::Time /*time*/,
     vle::devs::ExternalEventList& output) const override
 {
     output.emplace_back("a");
     output.back().addDouble(a+3);
 }