Browse Source
Merge branch 'master' of https://sselab.de/lab9/private/git/storm
Merge branch 'master' of https://sselab.de/lab9/private/git/storm
Former-commit-id: 2a52b2a93f
main
32 changed files with 320 additions and 121 deletions
-
12CMakeLists.txt
-
11src/cli/cli.cpp
-
29src/cli/cli.h
-
1src/modelchecker/prctl/HybridMdpPrctlModelChecker.cpp
-
9src/modelchecker/prctl/HybridMdpPrctlModelChecker.h
-
1src/modelchecker/propositional/SparsePropositionalModelChecker.h
-
10src/modelchecker/propositional/SymbolicPropositionalModelChecker.h
-
1src/models/ModelBase.h
-
1src/models/sparse/Dtmc.h
-
5src/models/sparse/Model.h
-
1src/models/symbolic/Model.cpp
-
54src/solver/AllowEarlyTerminationCondition.cpp
-
54src/solver/AllowEarlyTerminationCondition.h
-
4src/solver/GmmxxMinMaxLinearEquationSolver.cpp
-
4src/solver/MinMaxLinearEquationSolver.cpp
-
9src/solver/MinMaxLinearEquationSolver.h
-
4src/solver/NativeMinMaxLinearEquationSolver.cpp
-
3src/solver/SolverSelectionOptions.h
-
1src/storage/DeterministicModelBisimulationDecomposition.h
-
10src/storm.cpp
-
62src/utility/solver.cpp
-
34src/utility/solver.h
-
36src/utility/storm.h
-
5test/functional/modelchecker/GmmxxHybridMdpPrctlModelCheckerTest.cpp
-
8test/functional/modelchecker/GmmxxMdpPrctlModelCheckerTest.cpp
-
5test/functional/modelchecker/NativeHybridMdpPrctlModelCheckerTest.cpp
-
18test/functional/modelchecker/NativeMdpPrctlModelCheckerTest.cpp
-
8test/functional/modelchecker/TopologicalValueIterationMdpPrctlModelCheckerTest.cpp
-
29test/functional/solver/GmmxxMinMaxLinearEquationSolverTest.cpp
-
4test/performance/modelchecker/GmmxxMdpPrctlModelCheckerTest.cpp
-
4test/performance/modelchecker/NativeMdpPrctlModelCheckerTest.cpp
-
4test/performance/modelchecker/TopologicalValueIterationMdpPrctlModelCheckerTest.cpp
@ -0,0 +1,29 @@ |
|||||
|
#ifndef STORM_UTILITY_CLI_H_ |
||||
|
#define STORM_UTILITY_CLI_H_ |
||||
|
|
||||
|
#include <string> |
||||
|
|
||||
|
namespace storm { |
||||
|
namespace cli { |
||||
|
|
||||
|
std::string getCurrentWorkingDirectory(); |
||||
|
|
||||
|
void printHeader(const int argc, const char* argv[]); |
||||
|
|
||||
|
void printUsage(); |
||||
|
|
||||
|
/*! |
||||
|
* Parses the given command line arguments. |
||||
|
* |
||||
|
* @param argc The argc argument of main(). |
||||
|
* @param argv The argv argument of main(). |
||||
|
* @return True iff the program should continue to run after parsing the options. |
||||
|
*/ |
||||
|
bool parseOptions(const int argc, const char* argv[]); |
||||
|
|
||||
|
|
||||
|
void processOptions(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#endif |
@ -0,0 +1,54 @@ |
|||||
|
#include "AllowEarlyTerminationCondition.h"
|
||||
|
#include "src/utility/vector.h"
|
||||
|
|
||||
|
namespace storm { |
||||
|
namespace solver { |
||||
|
|
||||
|
template<typename ValueType> |
||||
|
TerminateAfterFilteredSumPassesThresholdValue<ValueType>::TerminateAfterFilteredSumPassesThresholdValue(storm::storage::BitVector const& filter, ValueType threshold, bool terminateIfAbove) : |
||||
|
terminationThreshold(threshold), filter(filter), terminateIfAboveThreshold(terminateIfAbove) |
||||
|
{ |
||||
|
// Intentionally left empty.
|
||||
|
} |
||||
|
|
||||
|
template<typename ValueType> |
||||
|
bool TerminateAfterFilteredSumPassesThresholdValue<ValueType>::terminateNow(const std::vector<ValueType>& currentValues) const { |
||||
|
assert(currentValues.size() >= filter.size()); |
||||
|
ValueType currentThreshold = storm::utility::vector::sum_if(currentValues, filter); |
||||
|
|
||||
|
if(this->terminateIfAboveThreshold) { |
||||
|
return currentThreshold >= this->terminationThreshold; |
||||
|
} else { |
||||
|
return currentThreshold <= this->terminationThreshold; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
template<typename ValueType> |
||||
|
TerminateAfterFilteredExtremumPassesThresholdValue<ValueType>::TerminateAfterFilteredExtremumPassesThresholdValue(storm::storage::BitVector const& filter, ValueType threshold, bool terminateIfAbove, bool useMinimum) : |
||||
|
terminationThreshold(threshold), filter(filter), terminateIfAboveThreshold(terminateIfAbove), useMinimumAsExtremum(useMinimum) |
||||
|
{ |
||||
|
// Intentionally left empty.
|
||||
|
} |
||||
|
|
||||
|
template<typename ValueType> |
||||
|
bool TerminateAfterFilteredExtremumPassesThresholdValue<ValueType>::terminateNow(const std::vector<ValueType>& currentValues) const { |
||||
|
assert(currentValues.size() >= filter.size()); |
||||
|
|
||||
|
ValueType initVal = terminateIfAboveThreshold ? terminationThreshold - 1 : terminationThreshold + 1; |
||||
|
ValueType currentThreshold = useMinimumAsExtremum ? storm::utility::vector::max_if(currentValues, filter, initVal) : storm::utility::vector::max_if(currentValues, filter, initVal); |
||||
|
|
||||
|
if(this->terminateIfAboveThreshold) { |
||||
|
return currentThreshold >= this->terminationThreshold; |
||||
|
} else { |
||||
|
return currentThreshold <= this->terminationThreshold; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
template class TerminateAfterFilteredExtremumPassesThresholdValue<double>; |
||||
|
template class TerminateAfterFilteredSumPassesThresholdValue<double>; |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,54 @@ |
|||||
|
#ifndef ALLOWEARLYTERMINATIONCONDITION_H |
||||
|
#define ALLOWEARLYTERMINATIONCONDITION_H |
||||
|
|
||||
|
#include <vector> |
||||
|
#include "src/storage/BitVector.h" |
||||
|
|
||||
|
|
||||
|
namespace storm { |
||||
|
namespace solver { |
||||
|
template<typename ValueType> |
||||
|
class AllowEarlyTerminationCondition { |
||||
|
public: |
||||
|
virtual bool terminateNow(std::vector<ValueType> const& currentValues) const = 0; |
||||
|
}; |
||||
|
|
||||
|
template<typename ValueType> |
||||
|
class NoEarlyTerminationCondition : public AllowEarlyTerminationCondition<ValueType> { |
||||
|
public: |
||||
|
bool terminateNow(std::vector<ValueType> const& currentValues) const { return false; } |
||||
|
}; |
||||
|
|
||||
|
template<typename ValueType> |
||||
|
class TerminateAfterFilteredSumPassesThresholdValue : public AllowEarlyTerminationCondition<ValueType> { |
||||
|
public: |
||||
|
TerminateAfterFilteredSumPassesThresholdValue(storm::storage::BitVector const& filter, ValueType threshold, bool terminateAbove); |
||||
|
bool terminateNow(std::vector<ValueType> const& currentValues) const; |
||||
|
|
||||
|
protected: |
||||
|
ValueType terminationThreshold; |
||||
|
storm::storage::BitVector filter; |
||||
|
bool terminateIfAboveThreshold; |
||||
|
}; |
||||
|
|
||||
|
template<typename ValueType> |
||||
|
class TerminateAfterFilteredExtremumPassesThresholdValue : public AllowEarlyTerminationCondition<ValueType>{ |
||||
|
public: |
||||
|
TerminateAfterFilteredExtremumPassesThresholdValue(storm::storage::BitVector const& filter, ValueType threshold, bool terminateAbove, bool useMinimum); |
||||
|
bool terminateNow(std::vector<ValueType> const& currentValue) const; |
||||
|
|
||||
|
protected: |
||||
|
ValueType terminationThreshold; |
||||
|
storm::storage::BitVector filter; |
||||
|
bool terminateIfAboveThreshold; |
||||
|
bool useMinimumAsExtremum; |
||||
|
}; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
#endif /* ALLOWEARLYTERMINATIONCONDITION_H */ |
||||
|
|
Reference in new issue
xxxxxxxxxx