Пример #1
0
 static bool performs_one_test(const std::string& precision,
         const std::string& valExpected, vv::Value& res)
 {
     if (precision == "NA") {
         if (res.toString().value() != valExpected) {
             return false;
         }
     } else {
         double prec = boost::lexical_cast<double>(precision);
         double valSim = res.toDouble().value();
         if (std::isnan(valSim)) {
             return (valExpected == "nan");
         }
         double valExpect = boost::lexical_cast<double>(valExpected);
         if ((valSim < valExpect - prec) || (valSim > valExpect + prec)) {
             return false;
         }
     }
     return true;
 }
Пример #2
0
 void date(const vle::value::Value& val)
 {
     yesterday = today;
     today = val.toDouble().value();
 }
Пример #3
0
 void y(const vv::Value& value)
 {
     ladybird_population = value.toDouble().value();
 }
Пример #4
0
 void x(const vv::Value& value)
 {
     plantlouse_population = value.toDouble().value();
 }