#include /** * @brief 重新载入多维样本相关配置 * @return int */ int ExpSampleMultiDim::init() { int ret = 0; try { ExpSample::init(); this->reload_config_xyz(); if (sample_tag_x1_str_ != "null" && !sample_tag_x1_str_.empty()) { exp_xs_.emplace_back(std::make_unique( sample_tag_x1_str_.c_str(), &this->mm_vars)); } if (sample_tag_x2_str_ != "null" && !sample_tag_x2_str_.empty()) { exp_xs_.emplace_back(std::make_unique( sample_tag_x2_str_.c_str(), &this->mm_vars)); } if (sample_tag_x3_str_ != "null" && !sample_tag_x3_str_.empty()) { exp_xs_.emplace_back(std::make_unique( sample_tag_x3_str_.c_str(), &this->mm_vars)); } this->logger_->Debug() << "sample tag load done" << std::endl; } catch (const std::exception& e) { std::throw_with_nested( mix_cc::Exception(-1, "load error", BOOST_CURRENT_LOCATION)); ret = -1; } return ret; } /** * @brief 载入样本结果表达式 * @return int */ int ExpSampleMultiDim::reload_config_xyz() { json x1 = this->rule_json_["sample"]["tag_x1"][1]; this->sample_tag_x1_str_ = x1.get(); json x2 = this->rule_json_["sample"]["tag_x2"][1]; this->sample_tag_x2_str_ = x2.get(); json x3 = this->rule_json_["sample"]["tag_x3"][1]; this->sample_tag_x3_str_ = x3.get(); return 0; }