13#include <spdlog/fmt/chrono.h>
29 run(Timer::StartClock::now() + startIn);
39 SPDLOG_LOGGER_INFO(
mLog,
"Opening interfaces.");
48 "Starting simulation at {:%Y-%m-%d %H:%M:%S} (delta_T = {} seconds)",
49 startAt, startAt - Timer::StartClock::now());
51 mTimer.setStartTime(startAt);
61 SPDLOG_LOGGER_INFO(
mLog,
"Simulation started.");
64 SPDLOG_LOGGER_INFO(
mLog,
"Simulation finished.");
spdlog::level::level_enum Level
RealTimeSimulation(String name, CommandLineArgs &args)
void sync() const
Synchronize simulation with remotes by exchanging intial state over interfaces.
virtual Real step()
Solve system A * x = z for x and current time.
const CPS::Attribute< Real >::Ptr mTimeStep
Simulation timestep.
void initialize()
Create solver instances etc.
const CPS::Attribute< Real >::Ptr mFinalTime
Final time of the simulation.
std::shared_ptr< Scheduler > mScheduler
Scheduler used for task scheduling.
std::vector< Interface::Ptr > mInterfaces
Vector of Interfaces.
Simulation(String name, CommandLineArgs &args)
Creates simulation with name and CommandLineArgs.
Real mTime
Time variable that is incremented at every step.
void run()
Run simulation until total time is elapsed.
DataLoggerInterface::List mLoggers
The data loggers.
CPS::Logger::Log mLog
Simulation logger.