You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One of the current issues with std::chrono clock types is that they either represent Unix time or relative time (though not clearly), and we have a use-case for representing both. A potential solution for this is to define our own clock type1, simulation_clock, as discussed here.
A benefit is that this would allow us to use std::chrono types while maintaining control of the simulation ticks however we see fit.
An attempt at fleshing out an interface similar to the discussed one in the above linked comment. However, unlike conventional chrono clocks, this implementation is a controlled clock, where simulation_clock::now() doesn't change unless simulation_clock::tick(...) is called.
The implementation you've drafted looks pretty good to me. May as well post it in a PR, and we can potentially start using it in the Forcings Engine and Coastal Formulation code that we're writing fresh.
Currently, across Data Providers and BMI instances, we're primarily using C time constructs.
Example
ngen/include/forcing/DataProvider.hpp
Lines 47 to 54 in 9fc3182
ngen/include/simulation_time/Simulation_Time.hpp
Lines 171 to 173 in 9fc3182
However, in some recent changes, we've started using
std::chrono
types.Example
ngen/include/forcing/ForcingsEngineDataProvider.hpp
Lines 208 to 214 in 9fc3182
One of the current issues with
std::chrono
clock types is that they either represent Unix time or relative time (though not clearly), and we have a use-case for representing both. A potential solution for this is to define our own clock type1,simulation_clock
, as discussed here.A benefit is that this would allow us to use
std::chrono
types while maintaining control of the simulation ticks however we see fit.Footnotes
https://en.cppreference.com/w/cpp/named_req/Clock ↩
The text was updated successfully, but these errors were encountered: