You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.7 KiB
53 lines
1.7 KiB
#ifndef ALLOWEARLYTERMINATIONCONDITION_H
|
|
#define ALLOWEARLYTERMINATIONCONDITION_H
|
|
|
|
#include <vector>
|
|
#include "src/storage/BitVector.h"
|
|
|
|
|
|
namespace storm {
|
|
namespace solver {
|
|
template<typename ValueType>
|
|
class TerminationCondition {
|
|
public:
|
|
virtual bool terminateNow(std::vector<ValueType> const& currentValues) const = 0;
|
|
};
|
|
|
|
template<typename ValueType>
|
|
class NoTerminationCondition : public TerminationCondition<ValueType> {
|
|
public:
|
|
bool terminateNow(std::vector<ValueType> const& currentValues) const;
|
|
};
|
|
|
|
template<typename ValueType>
|
|
class TerminateIfFilteredSumExceedsThreshold : public TerminationCondition<ValueType> {
|
|
public:
|
|
TerminateIfFilteredSumExceedsThreshold(storm::storage::BitVector const& filter, ValueType const& threshold, bool strict);
|
|
bool terminateNow(std::vector<ValueType> const& currentValues) const;
|
|
|
|
protected:
|
|
ValueType threshold;
|
|
storm::storage::BitVector filter;
|
|
bool strict;
|
|
};
|
|
|
|
template<typename ValueType>
|
|
class TerminateIfFilteredExtremumExceedsThreshold : public TerminateIfFilteredSumExceedsThreshold<ValueType>{
|
|
public:
|
|
TerminateIfFilteredExtremumExceedsThreshold(storm::storage::BitVector const& filter, ValueType const& threshold, bool strict, bool useMinimum);
|
|
bool terminateNow(std::vector<ValueType> const& currentValue) const;
|
|
|
|
protected:
|
|
ValueType threshold;
|
|
storm::storage::BitVector filter;
|
|
bool useMinimum;
|
|
};
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* ALLOWEARLYTERMINATIONCONDITION_H */
|
|
|