|
|
@ -2,11 +2,16 @@ |
|
|
|
#include "src/helpers.h"
|
|
|
|
|
|
|
|
#include "storm/storage/Scheduler.h"
|
|
|
|
#include "storm/storage/PostScheduler.h"
|
|
|
|
#include "storm/storage/PreScheduler.h"
|
|
|
|
|
|
|
|
template<typename ValueType> |
|
|
|
void define_scheduler(py::module& m, std::string vt_suffix) { |
|
|
|
using Scheduler = storm::storage::Scheduler<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; |
|
|
|
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("__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?") |
|
|
|
|
|
|
|
; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|