9 #include <dpsim/SequentialScheduler.h>
12 using namespace DPsim;
19 #include <unordered_map>
21 void SequentialScheduler::createSchedule(
const Task::List &tasks,
23 const Edges &outEdges) {
24 if (mOutMeasurementFile.size() != 0)
25 Scheduler::initMeasurements(tasks);
26 Scheduler::topologicalSort(tasks, inEdges, outEdges, mSchedule);
28 for (
auto task : mSchedule)
29 SPDLOG_LOGGER_INFO(mSLog,
"{}", task->toString());
32 void SequentialScheduler::step(Real time, Int timeStepCount) {
33 if (mOutMeasurementFile.size() != 0) {
34 for (
auto task : mSchedule) {
35 auto start = std::chrono::steady_clock::now();
36 task->execute(time, timeStepCount);
37 auto end = std::chrono::steady_clock::now();
38 updateMeasurement(task.get(), end - start);
41 for (
auto it : mSchedule) {
42 it->execute(time, timeStepCount);
47 void SequentialScheduler::stop() {
48 if (mOutMeasurementFile.size() != 0)
49 writeMeasurements(mOutMeasurementFile);
std::unordered_map< CPS::Task::Ptr, std::deque< CPS::Task::Ptr > > Edges