Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
SchedulerChoice.cpp
Go to the documentation of this file.
2
5
9
10namespace storm {
11namespace storage {
12
13template<typename ValueType>
15 // Intentionally left empty
16}
17
18template<typename ValueType>
19SchedulerChoice<ValueType>::SchedulerChoice(uint_fast64_t deterministicChoice) {
20 distribution.addProbability(deterministicChoice, storm::utility::one<ValueType>());
21}
22
23template<typename ValueType>
25 // Intentionally left empty
26}
27
28template<typename ValueType>
30 : distribution(std::move(randomizedChoice)) {
31 // Intentionally left empty
32}
33
34template<typename ValueType>
36 return distribution.size() != 0;
37}
38
39template<typename ValueType>
41 return distribution.size() == 1;
42}
43
44template<typename ValueType>
46 STORM_LOG_THROW(isDeterministic(), storm::exceptions::InvalidOperationException,
47 "Tried to obtain the deterministic choice of a scheduler, but the choice is not deterministic");
48 return distribution.begin()->first;
49}
50
51template<typename ValueType>
55
56template<typename ValueType>
57std::ostream& operator<<(std::ostream& out, SchedulerChoice<ValueType> const& schedulerChoice) {
58 if (schedulerChoice.isDefined()) {
59 if (schedulerChoice.isDeterministic()) {
60 out << schedulerChoice.getDeterministicChoice();
61 } else {
62 out << schedulerChoice.getChoiceAsDistribution();
63 }
64 } else {
65 out << "undefined";
66 }
67 return out;
68}
69
70template class SchedulerChoice<double>;
71template std::ostream& operator<<(std::ostream& out, SchedulerChoice<double> const& schedulerChoice);
73template std::ostream& operator<<(std::ostream& out, SchedulerChoice<storm::RationalNumber> const& schedulerChoice);
75template std::ostream& operator<<(std::ostream& out, SchedulerChoice<storm::RationalFunction> const& schedulerChoice);
77template std::ostream& operator<<(std::ostream& out, SchedulerChoice<storm::Interval> const& schedulerChoice);
78
79} // namespace storage
80} // namespace storm
uint_fast64_t getDeterministicChoice() const
If this choice is deterministic, this function returns the selected (local) choice index.
storm::storage::Distribution< ValueType, uint_fast64_t > const & getChoiceAsDistribution() const
Retrieves this choice in the form of a probability distribution.
SchedulerChoice()
Creates an undefined scheduler choice.
bool isDeterministic() const
Returns true iff this scheduler choice is deterministic (i.e., not randomized)
bool isDefined() const
Returns true iff this scheduler choice is defined.
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
std::ostream & operator<<(std::ostream &out, ParameterRegion< ParametricType > const &region)
LabParser.cpp.
Definition cli.cpp:18