Browse Source

added pre / post scheduler skeleton

refactoring
Thomas Knoll 1 year ago
parent
commit
74ecd91159
  1. 20
      src/storage/scheduler.cpp

20
src/storage/scheduler.cpp

@ -2,11 +2,16 @@
#include "src/helpers.h" #include "src/helpers.h"
#include "storm/storage/Scheduler.h" #include "storm/storage/Scheduler.h"
#include "storm/storage/PostScheduler.h"
#include "storm/storage/PreScheduler.h"
template<typename ValueType> template<typename ValueType>
void define_scheduler(py::module& m, std::string vt_suffix) { void define_scheduler(py::module& m, std::string vt_suffix) {
using Scheduler = storm::storage::Scheduler<ValueType>; using Scheduler = storm::storage::Scheduler<ValueType>;
using SchedulerChoice = storm::storage::SchedulerChoice<ValueType>; using SchedulerChoice = storm::storage::SchedulerChoice<ValueType>;
using PreScheduler = storm::storage::PreScheduler<ValueType>;
using PostScheduler = storm::storage::PostScheduler<ValueType>;
std::string schedulerClassName = std::string("Scheduler") + vt_suffix; std::string schedulerClassName = std::string("Scheduler") + vt_suffix;
py::class_<Scheduler, std::shared_ptr<storm::storage::Scheduler<ValueType>>> scheduler(m, schedulerClassName.c_str(), "A Finite Memory Scheduler"); py::class_<Scheduler, std::shared_ptr<storm::storage::Scheduler<ValueType>>> 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("get_choice", &SchedulerChoice::getChoiceAsDistribution, "Get the distribution over the actions")
.def("__str__", &streamToString<SchedulerChoice>); .def("__str__", &streamToString<SchedulerChoice>);
std::string preSchedulerClassName = std::string("PreScheduler") + vt_suffix;
py::class_<PreScheduler> 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> postScheduler(m, postSchedulerClassName.c_str(), "A post scheduler");
postScheduler
.def_property_readonly("memoryless", &PostScheduler::isMemorylessScheduler, "is the pre scheduler memoryless?")
;
} }

Loading…
Cancel
Save