@@ -139,8 +139,7 @@ class MainModelImpl<ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentLis
139
139
140
140
using OwnedUpdateDataset = std::tuple<std::vector<typename ComponentType::UpdateType>...>;
141
141
142
- using UpdateCompIndependence = std::array<main_core::UpdateCompProperties, n_types>;
143
- using ComponentFlags = std::array<bool , n_types>;
142
+ using ComponentFlags = std::array<bool , n_types>; // TODO: (figueroa1395) also in update.hpp ish
144
143
using ComponentCountInBase = std::pair<std::string, Idx>;
145
144
146
145
// TODO: (figueroa1395) probably move to common.hpp or somewhere else
@@ -581,7 +580,10 @@ class MainModelImpl<ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentLis
581
580
582
581
// cache component update order where possible.
583
582
// the order for a cacheable (independent) component by definition is the same across all scenarios
584
- auto const is_independent = is_update_independent (update_data);
583
+ // TODO: (figueroa1395): don't use string lookup, it is slow
584
+ std::map<std::string, Idx, std::less<>> const relevant_component_count_map = all_component_count ();
585
+ auto const is_independent =
586
+ main_core::is_update_independent<ComponentType...>(update_data, relevant_component_count_map);
585
587
all_scenarios_sequence = get_sequence_idx_map (update_data, 0 , is_independent);
586
588
587
589
return [&base_model, &exceptions, &infos, &calculation_fn, &result_data, &update_data,
@@ -750,22 +752,6 @@ class MainModelImpl<ExtraRetrievableTypes<ExtraRetrievableType...>, ComponentLis
750
752
// TODO: (figueroa1395) may want to move this to update.hpp or make something similar there
751
753
template <class Component > using UpdateType = typename Component::UpdateType;
752
754
753
- UpdateCompIndependence check_components_independence (ConstDataset const & update_data) const {
754
- // check and return indenpendence of all components
755
- return main_core::utils::run_functor_with_all_types_return_array<ComponentType...>(
756
- [this , &update_data]<typename CT>() {
757
- auto const n_component = this ->component_count <CT>();
758
- return main_core::check_component_independence<CT>(update_data, n_component);
759
- });
760
- }
761
-
762
- ComponentFlags is_update_independent (ConstDataset const & update_data) {
763
- ComponentFlags result;
764
- std::ranges::transform (check_components_independence (update_data), result.begin (),
765
- [](auto const & comp) { return comp.is_independent (); });
766
- return result;
767
- }
768
-
769
755
// Calculate with optimization, e.g., automatic tap changer
770
756
template <calculation_type_tag calculation_type, symmetry_tag sym> auto calculate (Options const & options) {
771
757
auto const calculator = [this , &options] {
0 commit comments