mirror of
https://git.gfz-potsdam.de/naaice/poet.git
synced 2025-12-16 04:48:23 +01:00
Added ctrl_cell_ids
This commit is contained in:
parent
8c388e3c6c
commit
7c97f29fa6
@ -52,6 +52,7 @@ public:
|
|||||||
std::uint32_t control_interval;
|
std::uint32_t control_interval;
|
||||||
std::vector<std::string> species_names;
|
std::vector<std::string> species_names;
|
||||||
std::vector<double> mape_threshold;
|
std::vector<double> mape_threshold;
|
||||||
|
std::vector<double> ctrl_cell_ids;
|
||||||
};
|
};
|
||||||
|
|
||||||
void enableControlLogic(const ControlSetup &setup) {
|
void enableControlLogic(const ControlSetup &setup) {
|
||||||
@ -60,6 +61,7 @@ public:
|
|||||||
this->control_interval = setup.control_interval;
|
this->control_interval = setup.control_interval;
|
||||||
this->species_names = setup.species_names;
|
this->species_names = setup.species_names;
|
||||||
this->mape_threshold = setup.mape_threshold;
|
this->mape_threshold = setup.mape_threshold;
|
||||||
|
this->ctrl_cell_ids = setup.ctrl_cell_ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool getControlIntervalEnabled() const {
|
bool getControlIntervalEnabled() const {
|
||||||
@ -78,6 +80,8 @@ public:
|
|||||||
|
|
||||||
std::vector<double> getMapeThreshold() const { return this->mape_threshold; }
|
std::vector<double> getMapeThreshold() const { return this->mape_threshold; }
|
||||||
|
|
||||||
|
std::vector<uint32_t> getCtrlCellIds() const { return this->ctrl_cell_ids; }
|
||||||
|
|
||||||
/* Profiling getters */
|
/* Profiling getters */
|
||||||
|
|
||||||
auto getUpdateCtrlLogicTime() const { return this->prep_t; }
|
auto getUpdateCtrlLogicTime() const { return this->prep_t; }
|
||||||
@ -100,6 +104,7 @@ private:
|
|||||||
std::uint32_t rollback_count = 0;
|
std::uint32_t rollback_count = 0;
|
||||||
std::uint32_t sur_disabled_counter = 0;
|
std::uint32_t sur_disabled_counter = 0;
|
||||||
std::vector<double> mape_threshold;
|
std::vector<double> mape_threshold;
|
||||||
|
std::vector<uint32_t> ctrl_cell_ids;
|
||||||
|
|
||||||
std::vector<std::string> species_names;
|
std::vector<std::string> species_names;
|
||||||
std::string out_dir;
|
std::string out_dir;
|
||||||
|
|||||||
@ -250,10 +250,13 @@ int parseInitValues(int argc, char **argv, RuntimeParameters ¶ms) {
|
|||||||
|
|
||||||
params.timesteps =
|
params.timesteps =
|
||||||
Rcpp::as<std::vector<double>>(global_rt_setup->operator[]("timesteps"));
|
Rcpp::as<std::vector<double>>(global_rt_setup->operator[]("timesteps"));
|
||||||
|
params.checkpoint_interval = Rcpp::as<uint32_t>(global_rt_setup->operator[]("checkpoint_interval"));
|
||||||
params.control_interval =
|
params.control_interval =
|
||||||
Rcpp::as<uint32_t>(global_rt_setup->operator[]("control_interval"));
|
Rcpp::as<uint32_t>(global_rt_setup->operator[]("control_interval"));
|
||||||
params.mape_threshold = Rcpp::as<std::vector<double>>(
|
params.mape_threshold = Rcpp::as<std::vector<double>>(
|
||||||
global_rt_setup->operator[]("mape_threshold"));
|
global_rt_setup->operator[]("mape_threshold"));
|
||||||
|
params.ctrl_cell_ids = Rcpp::as<std::vector<uint32_t>>(
|
||||||
|
global_rt_setup->operator[]("ctrl_cell_ids"));
|
||||||
|
|
||||||
catch (const std::exception &e) {
|
catch (const std::exception &e) {
|
||||||
ERRMSG("Error while parsing R scripts: " + std::string(e.what()));
|
ERRMSG("Error while parsing R scripts: " + std::string(e.what()));
|
||||||
|
|||||||
@ -41,7 +41,6 @@ static const inline std::string r_runtime_parameters = "mysetup";
|
|||||||
struct RuntimeParameters {
|
struct RuntimeParameters {
|
||||||
std::string out_dir;
|
std::string out_dir;
|
||||||
std::vector<double> timesteps;
|
std::vector<double> timesteps;
|
||||||
std::vector<double> species_epsilon;
|
|
||||||
|
|
||||||
Rcpp::List init_params;
|
Rcpp::List init_params;
|
||||||
|
|
||||||
@ -52,13 +51,10 @@ struct RuntimeParameters {
|
|||||||
|
|
||||||
bool print_progress = false;
|
bool print_progress = false;
|
||||||
|
|
||||||
std::uint32_t penalty_iteration = 0;
|
std::uint32_t checkpoint_interval = 0;
|
||||||
std::uint32_t max_penalty_iteration = 0;
|
std::uint32_t control_interval = 0;
|
||||||
std::uint32_t penalty_counter = 0;
|
std::vector<double> mape_threshold;
|
||||||
std::uint32_t next_penalty_check = 0;
|
std::vector<double> ctrl_cell_ids;
|
||||||
bool rollback_simulation = false;
|
|
||||||
bool control_iteration_active = false;
|
|
||||||
std::uint32_t control_iteration = 1;
|
|
||||||
|
|
||||||
static constexpr std::uint32_t WORK_PACKAGE_SIZE_DEFAULT = 32;
|
static constexpr std::uint32_t WORK_PACKAGE_SIZE_DEFAULT = 32;
|
||||||
std::uint32_t work_package_size = WORK_PACKAGE_SIZE_DEFAULT;
|
std::uint32_t work_package_size = WORK_PACKAGE_SIZE_DEFAULT;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user