Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
PermissiveSchedulerPenalty.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <unordered_map>
4
5
#include "
storm/storage/StateActionPair.h
"
6
7
namespace
storm
{
8
namespace
ps {
9
10
class
PermissiveSchedulerPenalties
{
11
std::unordered_map<storage::StateActionPair, double> mPenalties;
12
13
public
:
14
double
get
(uint_fast64_t state, uint_fast64_t action)
const
{
15
return
get
(
storage::StateActionPair
(state, action));
16
}
17
18
double
get
(
storage::StateActionPair
const
& sap)
const
{
19
auto
it = mPenalties.find(sap);
20
if
(it == mPenalties.end()) {
21
return
1.0;
22
}
else
{
23
return
it->second;
24
}
25
}
26
27
void
set
(uint64_t state, uint64_t action,
double
penalty) {
28
STORM_LOG_ASSERT
(penalty >= 1.0,
"Penalty too low."
);
29
if
(penalty == 1.0) {
30
auto
it = mPenalties.find(std::make_pair(state, action));
31
if
(it != mPenalties.end()) {
32
mPenalties.erase(it);
33
}
34
}
else
{
35
mPenalties.emplace(std::make_pair(state, action), penalty);
36
}
37
}
38
39
void
clear
() {
40
mPenalties.clear();
41
}
42
};
43
}
// namespace ps
44
}
// namespace storm
StateActionPair.h
storm::ps::PermissiveSchedulerPenalties
Definition
PermissiveSchedulerPenalty.h:10
storm::ps::PermissiveSchedulerPenalties::get
double get(storage::StateActionPair const &sap) const
Definition
PermissiveSchedulerPenalty.h:18
storm::ps::PermissiveSchedulerPenalties::clear
void clear()
Definition
PermissiveSchedulerPenalty.h:39
storm::ps::PermissiveSchedulerPenalties::set
void set(uint64_t state, uint64_t action, double penalty)
Definition
PermissiveSchedulerPenalty.h:27
storm::ps::PermissiveSchedulerPenalties::get
double get(uint_fast64_t state, uint_fast64_t action) const
Definition
PermissiveSchedulerPenalty.h:14
storm::storage::StateActionPair
Definition
StateActionPair.h:8
STORM_LOG_ASSERT
#define STORM_LOG_ASSERT(cond, message)
Definition
macros.h:11
storm
LabParser.cpp.
Definition
cli.cpp:18
src
storm-permissive
analysis
PermissiveSchedulerPenalty.h
Generated by
1.9.8