From 74ecd91159c9ac5e6abaaa802bf792baeefae9cd Mon Sep 17 00:00:00 2001 From: Thomas Knoll Date: Fri, 4 Aug 2023 15:19:54 +0200 Subject: [PATCH] added pre / post scheduler skeleton --- src/storage/scheduler.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/storage/scheduler.cpp b/src/storage/scheduler.cpp index 7480351..ca3a0ab 100644 --- a/src/storage/scheduler.cpp +++ b/src/storage/scheduler.cpp @@ -2,11 +2,16 @@ #include "src/helpers.h" #include "storm/storage/Scheduler.h" +#include "storm/storage/PostScheduler.h" +#include "storm/storage/PreScheduler.h" template void define_scheduler(py::module& m, std::string vt_suffix) { using Scheduler = storm::storage::Scheduler; using SchedulerChoice = storm::storage::SchedulerChoice; + using PreScheduler = storm::storage::PreScheduler; + using PostScheduler = storm::storage::PostScheduler; + std::string schedulerClassName = std::string("Scheduler") + vt_suffix; py::class_>> scheduler(m, schedulerClassName.c_str(), "A Finite Memory Scheduler"); @@ -33,6 +38,21 @@ void define_scheduler(py::module& m, std::string vt_suffix) { .def("get_choice", &SchedulerChoice::getChoiceAsDistribution, "Get the distribution over the actions") .def("__str__", &streamToString); + std::string preSchedulerClassName = std::string("PreScheduler") + vt_suffix; + py::class_ preScheduler(m, preSchedulerClassName.c_str(), "A pre scheduler"); + preScheduler + .def_property_readonly("memoryless", &PreScheduler::isMemorylessScheduler, "is the pre scheduler memoryless?") + .def_property_readonly("memory_size", &PreScheduler::getNumberOfMemoryStates, "How much memory does the scheduler take?") + + ; + + std::string postSchedulerClassName = std::string("PostScheduler") + vt_suffix; + py::class_ postScheduler(m, postSchedulerClassName.c_str(), "A post scheduler"); + postScheduler + .def_property_readonly("memoryless", &PostScheduler::isMemorylessScheduler, "is the pre scheduler memoryless?") + + ; + }