- char *optim = xbt_cfg_get_string("cpu/optim");
- int select = xbt_cfg_get_boolean("cpu/maxmin-selective-update");
-
- if (!strcmp(optim, "Full")) {
- updateMechanism_ = UM_FULL;
- selectiveUpdate_ = select;
- } else if (!strcmp(optim, "Lazy")) {
- updateMechanism_ = UM_LAZY;
- selectiveUpdate_ = 1;
- xbt_assert((select == 1)
- || (xbt_cfg_is_default_value("cpu/maxmin-selective-update")),
- "Disabling selective update while using the lazy update mechanism is dumb!");
+ std::string optim = xbt_cfg_get_string("cpu/optim");
+ bool select = xbt_cfg_get_boolean("cpu/maxmin-selective-update");
+
+ if (optim == "Full") {
+ setUpdateMechanism(Model::UpdateAlgo::Full);
+ } else if (optim == "Lazy") {
+ xbt_assert(select || xbt_cfg_is_default_value("cpu/maxmin-selective-update"),
+ "You cannot disable cpu selective update when using the lazy update mechanism");
+ setUpdateMechanism(Model::UpdateAlgo::Lazy);
+ select = true;