Browse Source

changed print to stream to be pure virtual

tempestpy_adaptions
Thomas Knoll 1 year ago
parent
commit
021b2036e6
  1. 12
      src/storm/modelchecker/results/ExplicitQuantitativeCheckResult.h
  2. 5
      src/storm/shields/AbstractShield.cpp
  3. 2
      src/storm/shields/AbstractShield.h
  4. 8
      src/storm/shields/OptimalShield.cpp
  5. 2
      src/storm/shields/OptimalShield.h
  6. 10
      src/storm/shields/PostShield.cpp
  7. 3
      src/storm/shields/PostShield.h
  8. 11
      src/storm/shields/PreShield.cpp
  9. 3
      src/storm/shields/PreShield.h

12
src/storm/modelchecker/results/ExplicitQuantitativeCheckResult.h

@ -14,6 +14,8 @@
#include "storm/utility/OsDetection.h"
#include "storm/adapters/JsonAdapter.h"
#include "storm/shields/AbstractShield.h"
namespace storm {
namespace modelchecker {
// fwd
@ -24,7 +26,8 @@ namespace storm {
public:
typedef std::vector<ValueType> vector_type;
typedef std::map<storm::storage::sparse::state_type, ValueType> map_type;
typedef typename storm::storage::SparseMatrix<ValueType>::index_type IndexType;
ExplicitQuantitativeCheckResult();
ExplicitQuantitativeCheckResult(map_type const& values);
ExplicitQuantitativeCheckResult(map_type&& values);
@ -74,10 +77,15 @@ namespace storm {
virtual ValueType sum() const override;
virtual bool hasScheduler() const override;
virtual bool hasShield() const override;
void setScheduler(std::unique_ptr<storm::storage::Scheduler<ValueType>>&& scheduler);
storm::storage::Scheduler<ValueType> const& getScheduler() const;
storm::storage::Scheduler<ValueType>& getScheduler();
void setShield(std::unique_ptr<tempest::shields::AbstractShield<ValueType, IndexType>> shield);
std::shared_ptr<tempest::shields::AbstractShield<ValueType, IndexType>> const& getShield() const;
storm::json<ValueType> toJson(boost::optional<storm::storage::sparse::StateValuations> const& stateValuations = boost::none) const;
private:
@ -86,6 +94,8 @@ namespace storm {
// An optional scheduler that accompanies the values.
boost::optional<std::shared_ptr<storm::storage::Scheduler<ValueType>>> scheduler;
boost::optional<std::shared_ptr<tempest::shields::AbstractShield<ValueType, IndexType>>> shield;
};
}
}

5
src/storm/shields/AbstractShield.cpp

@ -39,10 +39,7 @@ namespace tempest {
return shieldingExpression->getFilename() + ".shield";
}
template<typename ValueType, typename IndexType>
void AbstractShield<ValueType, IndexType>::printToStream(std::ostream& out, std::shared_ptr<storm::models::sparse::Model<ValueType>> const& model) const {
// construct().printToStream(out, shieldingExpression, model)
}
// Explicitly instantiate appropriate
template class AbstractShield<double, typename storm::storage::SparseMatrix<double>::index_type>;
#ifdef STORM_HAVE_CARL

2
src/storm/shields/AbstractShield.h

@ -51,7 +51,7 @@ namespace tempest {
std::string getClassName() const;
std::string getShieldFileName() const;
void printToStream(std::ostream& out, std::shared_ptr<storm::models::sparse::Model<ValueType>> const& model) const;
virtual void printToStream(std::ostream& out, std::shared_ptr<storm::models::sparse::Model<ValueType>> const& model) = 0;
protected:
AbstractShield(std::vector<IndexType> const& rowGroupIndices, std::shared_ptr<storm::logic::ShieldExpression const> const& shieldingExpression, storm::OptimizationDirection optimizationDirection, storm::storage::BitVector relevantStates, boost::optional<storm::storage::BitVector> coalitionStates);

8
src/storm/shields/OptimalShield.cpp

@ -64,11 +64,17 @@ namespace tempest {
return shield;
}
template<typename ValueType, typename IndexType>
void OptimalShield<ValueType, IndexType>::printToStream(std::ostream& out, std::shared_ptr<storm::models::sparse::Model<ValueType>> const& model) {
this->construct().printToStream(out, this->shieldingExpression, model);
}
// Explicitly instantiate appropriate classes
template class OptimalShield<double, typename storm::storage::SparseMatrix<double>::index_type>;
#ifdef STORM_HAVE_CARL
template class OptimalShield<storm::RationalNumber, typename storm::storage::SparseMatrix<storm::RationalNumber>::index_type>;
// template class OptimalShield<storm::RationalFunction, typename storm::storage::SparseMatrix<storm::RationalFunction>::index_type>;
#endif
}
}

2
src/storm/shields/OptimalShield.h

@ -14,6 +14,8 @@ namespace tempest {
storm::storage::PostScheduler<ValueType> construct();
template<typename Compare, bool relative>
storm::storage::PostScheduler<ValueType> constructWithCompareType();
virtual void printToStream(std::ostream& out, std::shared_ptr<storm::models::sparse::Model<ValueType>> const& model) override;
private:
std::vector<ValueType> choiceValues;
};

10
src/storm/shields/PostShield.cpp

@ -67,11 +67,19 @@ namespace tempest {
return shield;
}
template<typename ValueType, typename IndexType>
void PostShield<ValueType, IndexType>::printToStream(std::ostream& out, std::shared_ptr<storm::models::sparse::Model<ValueType>> const& model) {
this->construct().printToStream(out, this->shieldingExpression, model);
}
// Explicitly instantiate appropriate classes
template class PostShield<double, typename storm::storage::SparseMatrix<double>::index_type>;
#ifdef STORM_HAVE_CARL
template class PostShield<storm::RationalNumber, typename storm::storage::SparseMatrix<storm::RationalNumber>::index_type>;
// template class PostShield<storm::RationalFunction, typename storm::storage::SparseMatrix<storm::RationalFunction>::index_type>;
#endif
}
}

3
src/storm/shields/PostShield.h

@ -14,6 +14,9 @@ namespace tempest {
storm::storage::PostScheduler<ValueType> construct();
template<typename Compare, bool relative>
storm::storage::PostScheduler<ValueType> constructWithCompareType();
virtual void printToStream(std::ostream& out, std::shared_ptr<storm::models::sparse::Model<ValueType>> const& model) override;
private:
std::vector<ValueType> choiceValues;
};

11
src/storm/shields/PreShield.cpp

@ -67,11 +67,20 @@ namespace tempest {
}
return shield;
}
template<typename ValueType, typename IndexType>
void PreShield<ValueType, IndexType>::printToStream(std::ostream& out, std::shared_ptr<storm::models::sparse::Model<ValueType>> const& model) {
this->construct().printToStream(out, this->shieldingExpression, model);
}
// Explicitly instantiate appropriate classes
template class PreShield<double, typename storm::storage::SparseMatrix<double>::index_type>;
#ifdef STORM_HAVE_CARL
template class PreShield<storm::RationalNumber, typename storm::storage::SparseMatrix<storm::RationalNumber>::index_type>;
//template class PreShield<storm::RationalFunction, typename storm::storage::SparseMatrix<storm::RationalFunction>::index_type>;
#endif
}
}

3
src/storm/shields/PreShield.h

@ -14,6 +14,9 @@ namespace tempest {
storm::storage::PreScheduler<ValueType> construct();
template<typename Compare, bool relative>
storm::storage::PreScheduler<ValueType> constructWithCompareType();
virtual void printToStream(std::ostream& out, std::shared_ptr<storm::models::sparse::Model<ValueType>> const& model) override;
private:
std::vector<ValueType> choiceValues;
};

Loading…
Cancel
Save