[修改]修改了错误的exporter名称

This commit is contained in:
makotocc0107
2024-09-04 09:51:10 +08:00
committed by Coding
parent 211a89778c
commit d93daaab6b
37 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
//
// Created by fly on 2022/4/6.
//
#ifndef FAULT_SIMULATION_ALGORITHM_ALGORITHM_HPP
#define FAULT_SIMULATION_ALGORITHM_ALGORITHM_HPP
#include <nlohmann/json.hpp>
class algorithm {
public:
virtual void set_config(nlohmann::json const &config) = 0;
virtual nlohmann::json config() = 0;
virtual double eval(double value) = 0;
protected:
double jsonValue(nlohmann::json const &j, std::string const &key) {
if (j.contains(key)) {
if (j[key].is_string()) {
return std::atof(j[key].get<std::string>().c_str());
}
if (j[key].is_number()) {
return j[key].get<double>();
}
}
return std::nan("");
}
};
#endif //FAULT_SIMULATION_ALGORITHM_ALGORITHM_HPP