27 changed files with 585 additions and 24 deletions
			
			
		- 
					16src/storm/abstraction/AbstractionInformation.cpp
- 
					8src/storm/abstraction/AbstractionInformation.h
- 
					48src/storm/abstraction/ExplicitQuantiativeResultMinMax.cpp
- 
					54src/storm/abstraction/ExplicitQuantitativeResult.cpp
- 
					31src/storm/abstraction/ExplicitQuantitativeResult.h
- 
					61src/storm/abstraction/ExplicitQuantitativeResultMinMax.cpp
- 
					32src/storm/abstraction/ExplicitQuantitativeResultMinMax.h
- 
					9src/storm/abstraction/MenuGameAbstractor.cpp
- 
					2src/storm/abstraction/MenuGameAbstractor.h
- 
					177src/storm/abstraction/MenuGameRefiner.cpp
- 
					5src/storm/abstraction/MenuGameRefiner.h
- 
					5src/storm/abstraction/jani/AutomatonAbstractor.cpp
- 
					5src/storm/abstraction/jani/AutomatonAbstractor.h
- 
					5src/storm/abstraction/jani/EdgeAbstractor.cpp
- 
					5src/storm/abstraction/jani/EdgeAbstractor.h
- 
					5src/storm/abstraction/jani/JaniMenuGameAbstractor.cpp
- 
					5src/storm/abstraction/jani/JaniMenuGameAbstractor.h
- 
					5src/storm/abstraction/prism/CommandAbstractor.cpp
- 
					5src/storm/abstraction/prism/CommandAbstractor.h
- 
					5src/storm/abstraction/prism/ModuleAbstractor.cpp
- 
					5src/storm/abstraction/prism/ModuleAbstractor.h
- 
					5src/storm/abstraction/prism/PrismMenuGameAbstractor.cpp
- 
					5src/storm/abstraction/prism/PrismMenuGameAbstractor.h
- 
					89src/storm/modelchecker/abstraction/GameBasedMdpModelChecker.cpp
- 
					7src/storm/modelchecker/abstraction/GameBasedMdpModelChecker.h
- 
					5src/storm/models/symbolic/StochasticTwoPlayerGame.cpp
- 
					5src/storm/models/symbolic/StochasticTwoPlayerGame.h
| @ -0,0 +1,48 @@ | |||
| #include "storm/abstraction/ExplicitQuantitativeResultMinMax.h"
 | |||
| 
 | |||
| namespace storm { | |||
|     namespace abstraction { | |||
|          | |||
|         template<typename ValueType> | |||
|         ExplicitQuantitativeResultMinMax<ValueType>::ExplicitQuantitativeResultMinMax(uint64_t numberOfStates) = default; | |||
|          | |||
|         template<typename ValueType> | |||
|         ExplicitQuantitativeResult<ValueType> const& ExplicitQuantitativeResultMinMax<ValueType>::getMin() const { | |||
|             return min; | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         ExplicitQuantitativeResult<ValueType>& ExplicitQuantitativeResultMinMax<ValueType>::getMin() { | |||
|             return min; | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         ExplicitQuantitativeResult<ValueType> const& ExplicitQuantitativeResultMinMax<ValueType>::getMax() const { | |||
|             return max; | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         ExplicitQuantitativeResult<ValueType>& ExplicitQuantitativeResultMinMax<ValueType>::getMax() { | |||
|             return max; | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         ExplicitQuantitativeResult<ValueType> const& ExplicitQuantitativeResultMinMax<ValueType>::get(storm::OptimizationDirection const& dir) const { | |||
|             if (dir == storm::OptimizationDirection::Minimize) { | |||
|                 return this->getMin(); | |||
|             } else { | |||
|                 return this->getMax(); | |||
|             } | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         ExplicitQuantitativeResult<ValueType>& ExplicitQuantitativeResultMinMax<ValueType>::get(storm::OptimizationDirection const& dir) { | |||
|             if (dir == storm::OptimizationDirection::Minimize) { | |||
|                 return this->getMin(); | |||
|             } else { | |||
|                 return this->getMax(); | |||
|             } | |||
|         } | |||
| 
 | |||
|     } | |||
| } | |||
| @ -0,0 +1,54 @@ | |||
| #include "storm/abstraction/ExplicitQuantitativeResult.h"
 | |||
| 
 | |||
| #include "storm/storage/BitVector.h"
 | |||
| 
 | |||
| #include "storm/utility/macros.h"
 | |||
| #include "storm/exceptions/InvalidArgumentException.h"
 | |||
| 
 | |||
| namespace storm { | |||
|     namespace abstraction { | |||
|          | |||
|         template<typename ValueType> | |||
|         ExplicitQuantitativeResult<ValueType>::ExplicitQuantitativeResult(uint64_t numberOfStates) : values(numberOfStates) { | |||
|             // Intentionally left empty.
 | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         std::vector<ValueType> const& ExplicitQuantitativeResult<ValueType>::getValues() const { | |||
|             return values; | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         std::vector<ValueType>& ExplicitQuantitativeResult<ValueType>::getValues() { | |||
|             return values; | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         void ExplicitQuantitativeResult<ValueType>::setValue(uint64_t state, ValueType const& value) { | |||
|             values[state] = value; | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         std::pair<ValueType, ValueType> ExplicitQuantitativeResult<ValueType>::getRange(storm::storage::BitVector const& states) const { | |||
|             STORM_LOG_THROW(!states.empty(), storm::exceptions::InvalidArgumentException, "Expected non-empty set of states."); | |||
|              | |||
|             auto stateIt = states.begin(); | |||
|             std::pair<ValueType, ValueType> result = std::make_pair(values[*stateIt], values[*stateIt]); | |||
|             ++stateIt; | |||
|              | |||
|             while (stateIt != states.end()) { | |||
|                 if (values[*stateIt] < result.first) { | |||
|                     result.first = values[*stateIt]; | |||
|                 } else if (values[*stateIt] < result.first) { | |||
|                     result.second = values[*stateIt]; | |||
|                 } | |||
|                  | |||
|                 ++stateIt; | |||
|             } | |||
|              | |||
|             return result; | |||
|         } | |||
|          | |||
|         template class ExplicitQuantitativeResult<double>; | |||
|     } | |||
| } | |||
| @ -0,0 +1,31 @@ | |||
| #pragma once | |||
| 
 | |||
| #include <cstdint> | |||
| #include <vector> | |||
| 
 | |||
| namespace storm { | |||
|     namespace storage { | |||
|         class BitVector; | |||
|     } | |||
|      | |||
|     namespace abstraction { | |||
|          | |||
|         template<typename ValueType> | |||
|         class ExplicitQuantitativeResult { | |||
|         public: | |||
|             ExplicitQuantitativeResult() = default; | |||
|             ExplicitQuantitativeResult(uint64_t numberOfStates); | |||
|              | |||
|             std::vector<ValueType> const& getValues() const; | |||
|             std::vector<ValueType>& getValues(); | |||
|             void setValue(uint64_t state, ValueType const& value); | |||
|              | |||
|             std::pair<ValueType, ValueType> getRange(storm::storage::BitVector const& states) const; | |||
|              | |||
|         private: | |||
|             std::vector<ValueType> values; | |||
|         }; | |||
|          | |||
|     } | |||
| } | |||
| 
 | |||
| @ -0,0 +1,61 @@ | |||
| #include "storm/abstraction/ExplicitQuantitativeResultMinMax.h"
 | |||
| 
 | |||
| namespace storm { | |||
|     namespace abstraction { | |||
|          | |||
|         template<typename ValueType> | |||
|         ExplicitQuantitativeResultMinMax<ValueType>::ExplicitQuantitativeResultMinMax(uint64_t numberOfStates) : min(numberOfStates), max(numberOfStates) { | |||
|             // Intentionally left empty.
 | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         ExplicitQuantitativeResult<ValueType> const& ExplicitQuantitativeResultMinMax<ValueType>::getMin() const { | |||
|             return min; | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         ExplicitQuantitativeResult<ValueType>& ExplicitQuantitativeResultMinMax<ValueType>::getMin() { | |||
|             return min; | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         ExplicitQuantitativeResult<ValueType> const& ExplicitQuantitativeResultMinMax<ValueType>::getMax() const { | |||
|             return max; | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         ExplicitQuantitativeResult<ValueType>& ExplicitQuantitativeResultMinMax<ValueType>::getMax() { | |||
|             return max; | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         void ExplicitQuantitativeResultMinMax<ValueType>::setMin(ExplicitQuantitativeResult<ValueType>&& newMin) { | |||
|             min = std::move(newMin); | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         void ExplicitQuantitativeResultMinMax<ValueType>::setMax(ExplicitQuantitativeResult<ValueType>&& newMax) { | |||
|             max = std::move(newMax); | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         ExplicitQuantitativeResult<ValueType> const& ExplicitQuantitativeResultMinMax<ValueType>::get(storm::OptimizationDirection const& dir) const { | |||
|             if (dir == storm::OptimizationDirection::Minimize) { | |||
|                 return this->getMin(); | |||
|             } else { | |||
|                 return this->getMax(); | |||
|             } | |||
|         } | |||
|          | |||
|         template<typename ValueType> | |||
|         ExplicitQuantitativeResult<ValueType>& ExplicitQuantitativeResultMinMax<ValueType>::get(storm::OptimizationDirection const& dir) { | |||
|             if (dir == storm::OptimizationDirection::Minimize) { | |||
|                 return this->getMin(); | |||
|             } else { | |||
|                 return this->getMax(); | |||
|             } | |||
|         } | |||
| 
 | |||
|         template class ExplicitQuantitativeResultMinMax<double>; | |||
|     } | |||
| } | |||
| @ -0,0 +1,32 @@ | |||
| #pragma once | |||
| 
 | |||
| #include "storm/abstraction/ExplicitQuantitativeResult.h" | |||
| 
 | |||
| #include "storm/solver/OptimizationDirection.h" | |||
| 
 | |||
| namespace storm { | |||
|     namespace abstraction { | |||
|          | |||
|         template<typename ValueType> | |||
|         class ExplicitQuantitativeResultMinMax { | |||
|         public: | |||
|             ExplicitQuantitativeResultMinMax() = default; | |||
|             ExplicitQuantitativeResultMinMax(uint64_t numberOfStates); | |||
| 
 | |||
|             ExplicitQuantitativeResult<ValueType> const& getMin() const; | |||
|             ExplicitQuantitativeResult<ValueType>& getMin(); | |||
|             ExplicitQuantitativeResult<ValueType> const& getMax() const; | |||
|             ExplicitQuantitativeResult<ValueType>& getMax(); | |||
|             ExplicitQuantitativeResult<ValueType> const& get(storm::OptimizationDirection const& dir) const; | |||
|             ExplicitQuantitativeResult<ValueType>& get(storm::OptimizationDirection const& dir); | |||
| 
 | |||
|             void setMin(ExplicitQuantitativeResult<ValueType>&& newMin); | |||
|             void setMax(ExplicitQuantitativeResult<ValueType>&& newMax); | |||
| 
 | |||
|         private: | |||
|             ExplicitQuantitativeResult<ValueType> min; | |||
|             ExplicitQuantitativeResult<ValueType> max; | |||
|         }; | |||
|          | |||
|     } | |||
| } | |||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue