Browse Source

Equality Comparisons for JaniVars, just to make life easier :-)

tempestpy_adaptions
sjunges 8 years ago
parent
commit
c16390e7f5
  1. 9
      src/storm/storage/jani/Variable.cpp
  2. 5
      src/storm/storage/jani/Variable.h

9
src/storm/storage/jani/Variable.cpp

@ -101,6 +101,13 @@ namespace storm {
this->setInitExpression(this->getInitExpression().substitute(substitution));
}
}
bool operator==(Variable const& lhs, Variable const& rhs) {
return lhs.getExpressionVariable() == rhs.getExpressionVariable();
}
bool operator!=(Variable const& lhs, Variable const& rhs) {
return !(lhs == rhs);
}
}
}

5
src/storm/storage/jani/Variable.h

@ -89,7 +89,7 @@ namespace storm {
* Substitutes all variables in all expressions according to the given substitution.
*/
virtual void substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution);
private:
// The name of the variable.
std::string name;
@ -103,6 +103,9 @@ namespace storm {
/// Expression for initial values
boost::optional<storm::expressions::Expression> init;
};
bool operator==(Variable const& lhs, Variable const& rhs);
bool operator!=(Variable const& lhs, Variable const& rhs);
}
}
Loading…
Cancel
Save