Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
EdgeDestination.cpp
Go to the documentation of this file.
2
5
7
8namespace storm {
9namespace jani {
10
11EdgeDestination::EdgeDestination(uint64_t locationIndex, storm::expressions::Expression const& probability,
12 TemplateEdgeDestination const& templateEdgeDestination)
13 : locationIndex(locationIndex), probability(probability), templateEdgeDestination(templateEdgeDestination) {
14 // Intentionally left empty.
15}
16
18 return locationIndex;
19}
20
22 return probability;
23}
24
26 this->probability = probability;
27}
28
29std::map<storm::expressions::Variable, storm::expressions::Expression> EdgeDestination::getAsVariableToExpressionMap() const {
30 std::map<storm::expressions::Variable, storm::expressions::Expression> result;
31
32 for (auto const& assignment : this->getOrderedAssignments()) {
33 result[assignment.getExpressionVariable()] = assignment.getAssignedExpression();
34 }
35
36 return result;
37}
38
40 return templateEdgeDestination.get().getOrderedAssignments();
41}
42
43void EdgeDestination::substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution,
44 bool const substituteTranscendentalNumbers) {
45 this->setProbability(substituteJaniExpression(this->getProbability(), substitution, substituteTranscendentalNumbers));
46}
47
48bool EdgeDestination::hasAssignment(Assignment const& assignment) const {
49 return this->getOrderedAssignments().contains(assignment);
50}
51
55
57 if (this->getOrderedAssignments().empty()) {
58 return false;
59 }
60 return this->getOrderedAssignments().getLowestLevel() != 0 || this->getOrderedAssignments().getHighestLevel() != 0;
61}
62
64 return templateEdgeDestination.get();
65}
66
68 templateEdgeDestination = newTed;
69}
70} // namespace jani
71} // namespace storm
std::map< storm::expressions::Variable, storm::expressions::Expression > getAsVariableToExpressionMap() const
Retrieves the mapping from variables to their assigned expressions that corresponds to the assignment...
bool hasAssignment(Assignment const &assignment) const
Checks whether this destination has the given assignment.
TemplateEdgeDestination const & getTemplateEdgeDestination() const
Retrieves the template destination for this destination.
void updateTemplateEdgeDestination(TemplateEdgeDestination const &newTed)
bool usesAssignmentLevels() const
Retrieves whether the edge uses an assignment level other than zero.
storm::expressions::Expression const & getProbability() const
Retrieves the probability of choosing this destination.
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.
bool hasTransientAssignment() const
Retrieves whether this destination has transient assignments.
OrderedAssignments const & getOrderedAssignments() const
Retrieves the assignments to make when choosing this destination.
EdgeDestination(uint64_t locationIndex, storm::expressions::Expression const &probability, TemplateEdgeDestination const &templateEdgeDestination)
Creates a new edge destination.
void setProbability(storm::expressions::Expression const &probability)
Sets a new probability for this edge destination.
uint64_t getLocationIndex() const
Retrieves the id of the destination location.
int64_t getLowestLevel(bool onlyTransient=false) const
Retrieves the lowest level among all assignments.
detail::ConstAssignments getTransientAssignments() const
Returns all transient assignments in this set of assignments.
int64_t getHighestLevel(bool onlyTransient=false) const
Retrieves the highest level among all assignments.
bool contains(Assignment const &assignment) const
Retrieves whether the given assignment is contained in this set of assignments.
storm::expressions::Expression substituteJaniExpression(storm::expressions::Expression const &expression, std::map< storm::expressions::Variable, storm::expressions::Expression > const &identifierToExpressionMap, bool const substituteTranscendentalNumbers)
LabParser.cpp.
Definition cli.cpp:18