DPsim
RealTimeSimulation.h
1 /* Copyright 2017-2021 Institute for Automation of Complex Power Systems,
2  * EONERC, RWTH Aachen University
3  *
4  * This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
7  *********************************************************************************/
8 
9 #pragma once
10 
11 #include <signal.h>
12 
13 #include <chrono>
14 
15 #include <dpsim/Config.h>
16 #include <dpsim/Simulation.h>
17 #include <dpsim/Timer.h>
18 
19 namespace DPsim {
22 
23 protected:
24  Timer mTimer;
25 
26 public:
27  RealTimeSimulation(String name, CommandLineArgs &args);
29  RealTimeSimulation(String name,
30  CPS::Logger::Level logLevel = CPS::Logger::Level::info);
31 
36  void
37  run(const Timer::StartClock::duration &startIn = std::chrono::seconds(1));
38 
39  void run(const Timer::StartClock::time_point &startAt);
40 
41  void run(Int startIn) { run(std::chrono::seconds(startIn)); }
42 };
43 } // namespace DPsim
Extending Simulation class by real-time functionality.
The Simulation holds a SystemTopology and a Solver.
Definition: Simulation.h:34
void run()
Run simulation until total time is elapsed.
Definition: Simulation.cpp:395