Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
TimedTransition.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4
8
9namespace storm {
10namespace gspn {
11template<typename RateType>
13 public:
17
23 void setRate(RateType const& rate) {
24 this->rate = rate;
25 }
26
30 void setKServerSemantics(uint64_t k) {
31 STORM_LOG_THROW(k > 0, storm::exceptions::InvalidArgumentException, "Invalid Parameter for server semantics: 0.");
32 nServers = k;
33 }
34
36 nServers = 1;
37 }
38
40 nServers = 0;
41 }
42
46 bool hasKServerSemantics() const {
47 return nServers > 0;
48 }
49
51 return nServers == 1;
52 }
53
55 return nServers == 0;
56 }
57
58 uint64_t getNumberOfServers() const {
59 STORM_LOG_ASSERT(hasKServerSemantics(), "Tried to get the number of servers of a timed transition although it does not have K-Server-Semantics.");
60 return nServers;
61 }
62
68 RateType getRate() const {
69 return this->rate;
70 }
71
72 private:
73 // the rate of the transition
74 RateType rate;
75
76 // the number of servers of this transition. 0 means infinite server semantics.
77 uint64_t nServers;
78};
79} // namespace gspn
80} // namespace storm
void setRate(RateType const &rate)
Sets the rate of this transition to the given value.
RateType getRate() const
Retrieves the rate of this transition.
void setKServerSemantics(uint64_t k)
Sets the semantics of this transition.
uint64_t getNumberOfServers() const
bool hasKServerSemantics() const
Retrieves the semantics of this transition.
This class represents a transition in a gspn.
Definition Transition.h:14
#define STORM_LOG_ASSERT(cond, message)
Definition macros.h:9
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:28