Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
TimedTransition.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace storm {
7namespace gspn {
8template<typename RateType>
10 public:
14
20 void setRate(RateType const& rate) {
21 this->rate = rate;
22 }
23
27 void setKServerSemantics(uint64_t k) {
28 STORM_LOG_THROW(k > 0, storm::exceptions::InvalidArgumentException, "Invalid Parameter for server semantics: 0");
29 nServers = k;
30 }
31
33 nServers = 1;
34 }
35
37 nServers = 0;
38 }
39
43 bool hasKServerSemantics() const {
44 return nServers > 0;
45 }
46
48 return nServers == 1;
49 }
50
52 return nServers == 0;
53 }
54
55 uint64_t getNumberOfServers() const {
56 STORM_LOG_ASSERT(hasKServerSemantics(), "Tried to get the number of servers of a timed transition although it does not have K-Server-Semantics.");
57 return nServers;
58 }
59
65 RateType getRate() const {
66 return this->rate;
67 }
68
69 private:
70 // the rate of the transition
71 RateType rate;
72
73 // the number of servers of this transition. 0 means infinite server semantics.
74 uint64_t nServers;
75};
76} // namespace gspn
77} // 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:11
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
LabParser.cpp.
Definition cli.cpp:18