Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ endif()
# Dependencies
# ==============================================================================

find_package(libcbor REQUIRED)
find_package(libcosim REQUIRED)
find_package(Boost REQUIRED COMPONENTS log program_options)

Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def requirements(self):
self.tool_requires("cmake/[>=3.19]")
if self.settings.os == "Linux":
self.tool_requires("patchelf/[<0.18]")
self.requires("libcosim/0.10.4@osp/stable")
self.requires("libcosim/0.11.1@osp/stable")
self.requires("boost/[>=1.71]")

def layout(self):
Expand Down
18 changes: 15 additions & 3 deletions src/run.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,18 @@ cosim::execution load_system_structure(
(cosim::filesystem::is_directory(path) &&
cosim::filesystem::exists(path / "OspSystemStructure.xml"))) {
const auto config = cosim::load_osp_config(path, uriResolver);
auto execution = cosim::execution(
startTime,
std::make_shared<cosim::fixed_step_algorithm>(config.step_size, workerThreadCount));
std::shared_ptr<cosim::algorithm> algorithm;

std::visit([&algorithm, &config, &workerThreadCount](auto&& value) {
using T = std::decay_t<decltype(value)>;
if constexpr (std::is_same_v<T, cosim::fixed_step_algorithm_params>) {
algorithm = std::make_shared<cosim::fixed_step_algorithm>(std::get<cosim::fixed_step_algorithm_params>(config.algorithm_configuration), workerThreadCount);
} else if constexpr (std::is_same_v<T, cosim::ecco_algorithm_params>) {
algorithm = std::make_shared<cosim::ecco_algorithm>(std::get<cosim::ecco_algorithm_params>(config.algorithm_configuration), workerThreadCount);
}
}, config.algorithm_configuration);

auto execution = cosim::execution(startTime, algorithm);
cosim::inject_system_structure(
execution,
config.system_structure,
Expand Down Expand Up @@ -154,6 +163,7 @@ class progress_monitor : public cosim::observer
: logger_(startTime, duration, percentIncrement, mrProgressResolution)
{}


private:
void simulator_added(cosim::simulator_index, cosim::observable*, cosim::time_point) override {}
void simulator_removed(cosim::simulator_index, cosim::time_point) override {}
Expand Down Expand Up @@ -184,6 +194,8 @@ class progress_monitor : public cosim::observer
override
{}

void state_restored(cosim::step_number, cosim::time_point) override {}

progress_logger logger_;
};
} // namespace
Expand Down