|
|
@ -1,10 +1,14 @@ |
|
|
|
#include "src/storage/expressions/SimpleValuation.h"
|
|
|
|
|
|
|
|
#include <boost/functional/hash.hpp>
|
|
|
|
#include <boost/algorithm/string/join.hpp>
|
|
|
|
|
|
|
|
#include "src/storage/expressions/ExpressionManager.h"
|
|
|
|
#include "src/storage/expressions/Variable.h"
|
|
|
|
|
|
|
|
#include "src/utility/macros.h"
|
|
|
|
#include "src/exceptions/InvalidTypeException.h"
|
|
|
|
|
|
|
|
namespace storm { |
|
|
|
namespace expressions { |
|
|
|
SimpleValuation::SimpleValuation() : Valuation(nullptr) { |
|
|
@ -87,6 +91,25 @@ namespace storm { |
|
|
|
rationalValues[rationalVariable.getOffset()] = value; |
|
|
|
} |
|
|
|
|
|
|
|
std::string SimpleValuation::toPrettyString() const { |
|
|
|
std::vector<std::string> assignments; |
|
|
|
for (auto const& variable : this->getManager()) { |
|
|
|
std::stringstream stream; |
|
|
|
stream << variable.first.getName() << "="; |
|
|
|
if (variable.second.isBooleanType()) { |
|
|
|
stream << std::boolalpha << this->getBooleanValue(variable.first) << std::noboolalpha; |
|
|
|
} else if (variable.second.isIntegerType()) { |
|
|
|
stream << this->getIntegerValue(variable.first); |
|
|
|
} else if (variable.second.isRationalType()) { |
|
|
|
stream << this->getRationalValue(variable.first); |
|
|
|
} else { |
|
|
|
STORM_LOG_THROW(false, storm::exceptions::InvalidTypeException, "Unexpected variable type."); |
|
|
|
} |
|
|
|
assignments.push_back(stream.str()); |
|
|
|
} |
|
|
|
return "[" + boost::join(assignments, ", ") + "]"; |
|
|
|
} |
|
|
|
|
|
|
|
std::ostream& operator<<(std::ostream& out, SimpleValuation const& valuation) { |
|
|
|
out << "valuation {" << std::endl; |
|
|
|
out << valuation.getManager() << std::endl; |
|
|
|