Browse Source
created a modelCheckerHint class that allows to store all kinds of hints that a model checker might make use of
tempestpy_adaptions
created a modelCheckerHint class that allows to store all kinds of hints that a model checker might make use of
tempestpy_adaptions
TimQu
8 years ago
19 changed files with 304 additions and 93 deletions
-
45src/storm/modelchecker/CheckTask.h
-
81src/storm/modelchecker/hints/ExplicitModelCheckerHint.cpp
-
48src/storm/modelchecker/hints/ExplicitModelCheckerHint.h
-
34src/storm/modelchecker/hints/ModelCheckerHint.cpp
-
36src/storm/modelchecker/hints/ModelCheckerHint.h
-
17src/storm/modelchecker/parametric/SparseDtmcInstantiationModelChecker.cpp
-
6src/storm/modelchecker/parametric/SparseDtmcInstantiationModelChecker.h
-
18src/storm/modelchecker/parametric/SparseMdpInstantiationModelChecker.cpp
-
4src/storm/modelchecker/parametric/SparseMdpInstantiationModelChecker.h
-
4src/storm/modelchecker/prctl/SparseDtmcPrctlModelChecker.cpp
-
4src/storm/modelchecker/prctl/SparseMdpPrctlModelChecker.cpp
-
21src/storm/modelchecker/prctl/helper/SparseDtmcPrctlHelper.cpp
-
9src/storm/modelchecker/prctl/helper/SparseDtmcPrctlHelper.h
-
41src/storm/modelchecker/prctl/helper/SparseMdpPrctlHelper.cpp
-
9src/storm/modelchecker/prctl/helper/SparseMdpPrctlHelper.h
-
6src/storm/modelchecker/results/ExplicitQuantitativeCheckResult.cpp
-
1src/storm/modelchecker/results/ExplicitQuantitativeCheckResult.h
-
5src/storm/storage/TotalScheduler.cpp
-
8src/storm/storage/TotalScheduler.h
@ -0,0 +1,81 @@ |
|||
#include "storm/modelchecker/hints/ExplicitModelCheckerHint.h"
|
|||
#include "storm/adapters/CarlAdapter.h"
|
|||
namespace storm { |
|||
namespace modelchecker { |
|||
|
|||
template<typename ValueType> |
|||
ExplicitModelCheckerHint<ValueType>::ExplicitModelCheckerHint(boost::optional<std::vector<ValueType>> const& resultHint, boost::optional<storm::storage::TotalScheduler> const& schedulerHint) : resultHint(resultHint), schedulerHint(schedulerHint) { |
|||
// Intentionally left empty
|
|||
} |
|||
|
|||
template<typename ValueType> |
|||
ExplicitModelCheckerHint<ValueType>::ExplicitModelCheckerHint(boost::optional<std::vector<ValueType>>&& resultHint, boost::optional<storm::storage::TotalScheduler>&& schedulerHint) : resultHint(resultHint), schedulerHint(schedulerHint) { |
|||
// Intentionally left empty
|
|||
} |
|||
|
|||
template<typename ValueType> |
|||
bool ExplicitModelCheckerHint<ValueType>::isEmpty() const { |
|||
return !resultHint.is_initialized() && !schedulerHint.is_initialized(); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
bool ExplicitModelCheckerHint<ValueType>::isExplicitModelCheckerHint() const { |
|||
return true; |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
bool ExplicitModelCheckerHint<ValueType>::hasResultHint() const { |
|||
return resultHint.is_initialized(); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
std::vector<ValueType> const& ExplicitModelCheckerHint<ValueType>::getResultHint() const { |
|||
return *resultHint; |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
std::vector<ValueType>& ExplicitModelCheckerHint<ValueType>::getResultHint() { |
|||
return *resultHint; |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
void ExplicitModelCheckerHint<ValueType>::setResultHint(boost::optional<std::vector<ValueType>> const& resultHint) { |
|||
this->resultHint = resultHint; |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
void ExplicitModelCheckerHint<ValueType>::setResultHint(boost::optional<std::vector<ValueType>>&& resultHint) { |
|||
this->resultHint = resultHint; |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
bool ExplicitModelCheckerHint<ValueType>::hasSchedulerHint() const { |
|||
return schedulerHint.is_initialized(); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
storm::storage::TotalScheduler const& ExplicitModelCheckerHint<ValueType>::getSchedulerHint() const { |
|||
return *schedulerHint; |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
storm::storage::TotalScheduler& ExplicitModelCheckerHint<ValueType>::getSchedulerHint() { |
|||
return *schedulerHint; |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
void ExplicitModelCheckerHint<ValueType>::setSchedulerHint(boost::optional<storm::storage::TotalScheduler> const& schedulerHint) { |
|||
this->schedulerHint = schedulerHint; |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
void ExplicitModelCheckerHint<ValueType>::setSchedulerHint(boost::optional<storm::storage::TotalScheduler>&& schedulerHint) { |
|||
this->schedulerHint = schedulerHint; |
|||
} |
|||
|
|||
template class ExplicitModelCheckerHint<double>; |
|||
template class ExplicitModelCheckerHint<storm::RationalNumber>; |
|||
template class ExplicitModelCheckerHint<storm::RationalFunction>; |
|||
|
|||
} |
|||
} |
@ -0,0 +1,48 @@ |
|||
#ifndef STORM_MODELCHECKER_HINTS_EXPLICITMODELCHECKERHINT_H |
|||
#define STORM_MODELCHECKER_HINTS_EXPLICITMODELCHECKERHINT_H |
|||
|
|||
#include <vector> |
|||
#include <boost/optional.hpp> |
|||
|
|||
#include "storm/modelchecker/hints/ModelCheckerHint.h" |
|||
#include "storm/storage/TotalScheduler.h" |
|||
|
|||
namespace storm { |
|||
namespace modelchecker { |
|||
|
|||
template<typename ValueType> |
|||
class ExplicitModelCheckerHint : public ModelCheckerHint { |
|||
public: |
|||
|
|||
ExplicitModelCheckerHint(ExplicitModelCheckerHint<ValueType> const& other) = default; |
|||
ExplicitModelCheckerHint(ExplicitModelCheckerHint<ValueType>&& other) = default; |
|||
ExplicitModelCheckerHint(boost::optional<std::vector<ValueType>> const& resultHint = boost::none, boost::optional<storm::storage::TotalScheduler> const& schedulerHint = boost::none); |
|||
ExplicitModelCheckerHint(boost::optional<std::vector<ValueType>>&& resultHint, boost::optional<storm::storage::TotalScheduler>&& schedulerHint = boost::none); |
|||
|
|||
// Returns true iff this hint does not contain any information |
|||
virtual bool isEmpty() const override; |
|||
|
|||
// Returns true iff this is an explicit model checker hint |
|||
virtual bool isExplicitModelCheckerHint() const override; |
|||
|
|||
bool hasResultHint() const; |
|||
std::vector<ValueType> const& getResultHint() const; |
|||
std::vector<ValueType>& getResultHint(); |
|||
void setResultHint(boost::optional<std::vector<ValueType>> const& resultHint); |
|||
void setResultHint(boost::optional<std::vector<ValueType>>&& resultHint); |
|||
|
|||
bool hasSchedulerHint() const; |
|||
storm::storage::TotalScheduler const& getSchedulerHint() const; |
|||
storm::storage::TotalScheduler& getSchedulerHint(); |
|||
void setSchedulerHint(boost::optional<storage::TotalScheduler> const& schedulerHint); |
|||
void setSchedulerHint(boost::optional<storage::TotalScheduler>&& schedulerHint); |
|||
|
|||
private: |
|||
boost::optional<std::vector<ValueType>> resultHint; |
|||
boost::optional<storm::storage::TotalScheduler> schedulerHint; |
|||
}; |
|||
|
|||
} |
|||
} |
|||
|
|||
#endif /* STORM_MODELCHECKER_HINTS_EXPLICITMODELCHECKERHINT_H */ |
@ -0,0 +1,34 @@ |
|||
#include "storm/modelchecker/hints/ModelCheckerHint.h"
|
|||
#include "storm/modelchecker/hints/ExplicitModelCheckerHint.h"
|
|||
#include "storm/adapters/CarlAdapter.h"
|
|||
|
|||
namespace storm { |
|||
namespace modelchecker { |
|||
|
|||
bool ModelCheckerHint::isEmpty() const { |
|||
return true; |
|||
} |
|||
|
|||
bool ModelCheckerHint::isExplicitModelCheckerHint() const { |
|||
return false; |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
ExplicitModelCheckerHint<ValueType> const& ModelCheckerHint::asExplicitModelCheckerHint() const { |
|||
return dynamic_cast<ExplicitModelCheckerHint<ValueType> const&>(*this); |
|||
} |
|||
|
|||
template<typename ValueType> |
|||
ExplicitModelCheckerHint<ValueType>& ModelCheckerHint::asExplicitModelCheckerHint() { |
|||
return dynamic_cast<ExplicitModelCheckerHint<ValueType>&>(*this); |
|||
} |
|||
|
|||
template ExplicitModelCheckerHint<double> const& ModelCheckerHint::asExplicitModelCheckerHint() const; |
|||
template ExplicitModelCheckerHint<double>& ModelCheckerHint::asExplicitModelCheckerHint(); |
|||
template ExplicitModelCheckerHint<storm::RationalNumber> const& ModelCheckerHint::asExplicitModelCheckerHint() const; |
|||
template ExplicitModelCheckerHint<storm::RationalNumber>& ModelCheckerHint::asExplicitModelCheckerHint(); |
|||
template ExplicitModelCheckerHint<storm::RationalFunction> const& ModelCheckerHint::asExplicitModelCheckerHint() const; |
|||
template ExplicitModelCheckerHint<storm::RationalFunction>& ModelCheckerHint::asExplicitModelCheckerHint(); |
|||
|
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
#ifndef STORM_MODELCHECKER_HINTS_MODELCHECKERHINT_H |
|||
#define STORM_MODELCHECKER_HINTS_MODELCHECKERHINT_H |
|||
|
|||
namespace storm { |
|||
namespace modelchecker { |
|||
|
|||
template<typename ValueType> |
|||
class ExplicitModelCheckerHint; |
|||
|
|||
|
|||
/* |
|||
* This class contains information that might accelerate the solving process |
|||
*/ |
|||
class ModelCheckerHint { |
|||
public: |
|||
|
|||
ModelCheckerHint() = default; |
|||
|
|||
// Returns true iff this hint does not contain any information |
|||
virtual bool isEmpty() const; |
|||
|
|||
// Returns true iff this is an explicit model checker hint |
|||
virtual bool isExplicitModelCheckerHint() const; |
|||
|
|||
template<typename ValueType> |
|||
ExplicitModelCheckerHint<ValueType>& asExplicitModelCheckerHint(); |
|||
|
|||
template<typename ValueType> |
|||
ExplicitModelCheckerHint<ValueType> const& asExplicitModelCheckerHint() const; |
|||
|
|||
}; |
|||
|
|||
} |
|||
} |
|||
|
|||
#endif /* STORM_MODELCHECKER_HINTS_MODELCHECKERHINT_H */ |
Write
Preview
Loading…
Cancel
Save
Reference in new issue