DPsim
Loading...
Searching...
No Matches
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
19namespace DPsim {
21class RealTimeSimulation : public Simulation {
22
23protected:
24 Timer mTimer;
25
26public:
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
Simulation(String name, CommandLineArgs &args)
Creates simulation with name and CommandLineArgs.
void run()
Run simulation until total time is elapsed.