Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Edge.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4
5#include <boost/optional.hpp>
6#include <iostream>
7
11
12namespace storm {
13namespace jani {
14
15class TemplateEdge;
16
17class Edge {
18 public:
19 Edge() = default;
20
21 Edge(uint64_t sourceLocationIndex, uint64_t actionIndex, boost::optional<storm::expressions::Expression> const& rate,
22 std::shared_ptr<TemplateEdge> const& templateEdge,
23 std::vector<std::pair<uint64_t, storm::expressions::Expression>> const& destinationTargetLocationsAndProbabilities);
24 Edge(uint64_t sourceLocationIndex, uint64_t actionIndex, boost::optional<storm::expressions::Expression> const& rate,
25 std::shared_ptr<TemplateEdge> const& templateEdge, std::vector<uint64_t> const& destinationLocations,
26 std::vector<storm::expressions::Expression> const& destinationProbabilities);
27
31 uint64_t getSourceLocationIndex() const;
32
36 uint64_t getActionIndex() const;
37
41 bool hasSilentAction() const;
42
46 bool hasRate() const;
47
52
56 boost::optional<storm::expressions::Expression> const& getOptionalRate() const;
57
62
67
72
76 EdgeDestination const& getDestination(uint64_t index) const;
77
81 std::vector<EdgeDestination> const& getDestinations() const;
82
86 std::vector<EdgeDestination>& getDestinations();
87
91 std::size_t getNumberOfDestinations() const;
92
96 void substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution, bool const substituteTranscendentalNumbers);
97
102
106 OrderedAssignments const& getAssignments() const;
107
111 bool usesVariablesInNonTransientAssignments(std::set<storm::expressions::Variable> const& variables) const;
112
117
121 bool usesAssignmentLevels(bool onlyTransient = false) const;
122
126 uint64_t getColor() const;
127
131 void setColor(uint64_t newColor);
132
137 void simplifyIndexedAssignments(VariableSet const& localVars);
138
139 std::shared_ptr<TemplateEdge> const& getTemplateEdge();
140 void setTemplateEdge(std::shared_ptr<TemplateEdge> const& newTe);
141
146 int64_t const& getLowestAssignmentLevel() const;
147
152 int64_t const& getHighestAssignmentLevel() const;
153
154 std::string toString() const;
155
156 void assertValid() const;
157
158 private:
160 uint64_t sourceLocationIndex;
161
163 uint64_t actionIndex;
164
167 boost::optional<storm::expressions::Expression> rate;
168
170 std::shared_ptr<TemplateEdge> templateEdge;
171
173 std::vector<EdgeDestination> destinations;
174
176 uint64_t color = 0;
177};
178
179std::ostream& operator<<(std::ostream& stream, Edge const& edge);
180
181} // namespace jani
182} // namespace storm
bool hasSilentAction() const
Returns whether it contains the silent action.
Definition Edge.cpp:102
void setTemplateEdge(std::shared_ptr< TemplateEdge > const &newTe)
Definition Edge.cpp:151
void setRate(storm::expressions::Expression const &rate)
Sets a new rate for this edge.
Definition Edge.cpp:61
bool usesVariablesInNonTransientAssignments(std::set< storm::expressions::Variable > const &variables) const
Checks whether the provided variables appear on the right-hand side of non-transient assignments.
Definition Edge.cpp:118
std::string toString() const
Definition Edge.cpp:165
bool usesAssignmentLevels(bool onlyTransient=false) const
Retrieves whether the edge uses an assignment level other than zero.
Definition Edge.cpp:126
storm::storage::FlatSet< storm::expressions::Variable > const & getWrittenGlobalVariables() const
Retrieves a set of (global) variables that are written by at least one of the edge's destinations.
Definition Edge.cpp:114
std::shared_ptr< TemplateEdge > const & getTemplateEdge()
Definition Edge.cpp:171
uint64_t getActionIndex() const
Retrieves the id of the action with which this edge is labeled.
Definition Edge.cpp:45
void simplifyIndexedAssignments(VariableSet const &localVars)
Definition Edge.cpp:130
std::vector< EdgeDestination > const & getDestinations() const
Retrieves the destinations of this edge.
Definition Edge.cpp:77
bool hasRate() const
Retrieves whether this edge has an associated rate.
Definition Edge.cpp:49
uint64_t getSourceLocationIndex() const
Retrieves the index of the source location.
Definition Edge.cpp:41
bool hasTransientEdgeDestinationAssignments() const
Retrieves whether there is any transient edge destination assignment in the edge.
Definition Edge.cpp:122
OrderedAssignments const & getAssignments() const
Retrieves the assignments of this edge.
Definition Edge.cpp:89
storm::expressions::Expression const & getRate() const
Retrieves the rate of this edge.
Definition Edge.cpp:53
void substitute(std::map< storm::expressions::Variable, storm::expressions::Expression > const &substitution, bool const substituteTranscendentalNumbers)
Substitutes all variables in all expressions according to the given substitution.
Definition Edge.cpp:93
int64_t const & getHighestAssignmentLevel() const
Retrieves the highest assignment level occurring in a destination assignment If no assignment exists,...
Definition Edge.cpp:147
std::size_t getNumberOfDestinations() const
Retrieves the number of destinations of this edge.
Definition Edge.cpp:85
boost::optional< storm::expressions::Expression > const & getOptionalRate() const
Retrieves an optional that stores the rate if there is any and none otherwise.
Definition Edge.cpp:57
uint64_t getColor() const
Retrieves the color of the edge.
Definition Edge.cpp:106
int64_t const & getLowestAssignmentLevel() const
Retrieves the lowest assignment level occurring in a destination assignment.
Definition Edge.cpp:143
void assertValid() const
void setGuard(storm::expressions::Expression const &guard)
Sets a new guard for this edge.
Definition Edge.cpp:69
storm::expressions::Expression const & getGuard() const
Retrieves the guard of this edge.
Definition Edge.cpp:65
EdgeDestination const & getDestination(uint64_t index) const
Retrieves the destination with the given index.
Definition Edge.cpp:73
void setColor(uint64_t newColor)
Sets the color of the edge.
Definition Edge.cpp:110
std::ostream & operator<<(std::ostream &stream, Assignment const &assignment)
boost::container::flat_set< Key, std::less< Key >, boost::container::new_allocator< Key > > FlatSet
Redefinition of flat_set was needed, because from Boost 1.70 on the default allocator is set to void.
Definition BoostTypes.h:13
LabParser.cpp.
Definition cli.cpp:18