@@ -82,9 +82,18 @@ cosim::execution load_system_structure(
8282 (cosim::filesystem::is_directory (path) &&
8383 cosim::filesystem::exists (path / " OspSystemStructure.xml" ))) {
8484 const auto config = cosim::load_osp_config (path, uriResolver);
85- auto execution = cosim::execution (
86- startTime,
87- std::make_shared<cosim::fixed_step_algorithm>(config.step_size , workerThreadCount));
85+ std::shared_ptr<cosim::algorithm> algorithm;
86+
87+ std::visit ([&algorithm, &config, &workerThreadCount](auto && value) {
88+ using T = std::decay_t <decltype (value)>;
89+ if constexpr (std::is_same_v<T, cosim::fixed_step_algorithm_params>) {
90+ algorithm = std::make_shared<cosim::fixed_step_algorithm>(std::get<cosim::fixed_step_algorithm_params>(config.algorithm_configuration ), workerThreadCount);
91+ } else if constexpr (std::is_same_v<T, cosim::ecco_algorithm_params>) {
92+ algorithm = std::make_shared<cosim::ecco_algorithm>(std::get<cosim::ecco_algorithm_params>(config.algorithm_configuration ), workerThreadCount);
93+ }
94+ }, config.algorithm_configuration );
95+
96+ auto execution = cosim::execution (startTime, algorithm);
8897 cosim::inject_system_structure (
8998 execution,
9099 config.system_structure ,
@@ -154,6 +163,7 @@ class progress_monitor : public cosim::observer
154163 : logger_(startTime, duration, percentIncrement, mrProgressResolution)
155164 {}
156165
166+
157167private:
158168 void simulator_added (cosim::simulator_index, cosim::observable*, cosim::time_point) override {}
159169 void simulator_removed (cosim::simulator_index, cosim::time_point) override {}
@@ -184,6 +194,8 @@ class progress_monitor : public cosim::observer
184194 override
185195 {}
186196
197+ void state_restored (cosim::step_number, cosim::time_point) override {}
198+
187199 progress_logger logger_;
188200};
189201} // namespace
0 commit comments