#ifndef ALLOWEARLYTERMINATIONCONDITION_H #define ALLOWEARLYTERMINATIONCONDITION_H #include #include "storm/solver/SolverGuarantee.h" #include "storm/storage/BitVector.h" namespace storm { namespace solver { template class TerminationCondition { public: virtual bool terminateNow(std::vector const& currentValues, SolverGuarantee const& guarantee = SolverGuarantee::None) const = 0; }; template class NoTerminationCondition : public TerminationCondition { public: bool terminateNow(std::vector const& currentValues, SolverGuarantee const& guarantee = SolverGuarantee::None) const; }; template class TerminateIfFilteredSumExceedsThreshold : public TerminationCondition { public: TerminateIfFilteredSumExceedsThreshold(storm::storage::BitVector const& filter, ValueType const& threshold, bool strict); bool terminateNow(std::vector const& currentValues, SolverGuarantee const& guarantee = SolverGuarantee::None) const; protected: ValueType threshold; storm::storage::BitVector filter; bool strict; }; template class TerminateIfFilteredExtremumExceedsThreshold : public TerminateIfFilteredSumExceedsThreshold{ public: TerminateIfFilteredExtremumExceedsThreshold(storm::storage::BitVector const& filter, bool strict, ValueType const& threshold, bool useMinimum); bool terminateNow(std::vector const& currentValue, SolverGuarantee const& guarantee = SolverGuarantee::None) const; protected: bool useMinimum; }; template class TerminateIfFilteredExtremumBelowThreshold : public TerminateIfFilteredSumExceedsThreshold{ public: TerminateIfFilteredExtremumBelowThreshold(storm::storage::BitVector const& filter, ValueType const& threshold, bool strict, bool useMinimum); bool terminateNow(std::vector const& currentValue, SolverGuarantee const& guarantee = SolverGuarantee::None) const; protected: bool useMinimum; }; } } #endif /* ALLOWEARLYTERMINATIONCONDITION_H */