Browse Source

Changed result output iterator for DFTs

main
Matthias Volk 5 years ago
parent
commit
de27fa82fe
  1. 3
      src/storm-dft/modelchecker/dft/DFTModelChecker.cpp
  2. 15
      src/storm-dft/modelchecker/dft/DFTModelChecker.h

3
src/storm-dft/modelchecker/dft/DFTModelChecker.cpp

@ -534,7 +534,8 @@ namespace storm {
} else { } else {
os << ", "; os << ", ";
} }
os << boost::apply_visitor(ResultOutputVisitor(), result);
boost::variant<std::ostream&> stream(os);
boost::apply_visitor(ResultOutputVisitor(), result, stream);
} }
os << "]" << std::endl; os << "]" << std::endl;
} }

15
src/storm-dft/modelchecker/dft/DFTModelChecker.h

@ -22,20 +22,15 @@ namespace storm {
typedef std::vector<boost::variant<ValueType, approximation_result>> dft_results; typedef std::vector<boost::variant<ValueType, approximation_result>> dft_results;
typedef std::vector<std::shared_ptr<storm::logic::Formula const>> property_vector; typedef std::vector<std::shared_ptr<storm::logic::Formula const>> property_vector;
class ResultOutputVisitor : public boost::static_visitor<std::string> {
class ResultOutputVisitor : public boost::static_visitor<> {
public: public:
std::string operator()(ValueType result) const {
std::stringstream stream;
stream << result;
return stream.str();
void operator()(ValueType result, std::ostream& os) const {
os << result;
} }
std::string operator()(std::pair<ValueType, ValueType> const& result) const {
std::stringstream stream;
stream << "(" << result.first << ", " << result.second << ")";
return stream.str();
void operator()(std::pair<ValueType, ValueType> const& result, std::ostream& os) const {
os << "(" << result.first << ", " << result.second << ")";
} }
}; };
/*! /*!

Loading…
Cancel
Save