Browse Source

Fix in BucketPriorityQueue

tempestpy_adaptions
Matthias Volk 6 years ago
parent
commit
a302ec9cfc
  1. 2
      src/storm-dft/builder/ExplicitDFTModelBuilder.cpp
  2. 4
      src/storm-dft/storage/BucketPriorityQueue.cpp
  3. 4
      src/storm-dft/storage/BucketPriorityQueue.h

2
src/storm-dft/builder/ExplicitDFTModelBuilder.cpp

@ -62,7 +62,7 @@ namespace storm {
stateStorage(dft.stateBitVectorSize()), stateStorage(dft.stateBitVectorSize()),
// TODO Matthias: make choosable // TODO Matthias: make choosable
//explorationQueue(dft.nrElements()+1, 0, 1) //explorationQueue(dft.nrElements()+1, 0, 1)
explorationQueue(200, 0, 0.9)
explorationQueue(200, 0, 0.9, false)
{ {
// Intentionally left empty. // Intentionally left empty.
// TODO Matthias: remove again // TODO Matthias: remove again

4
src/storm-dft/storage/BucketPriorityQueue.cpp

@ -8,7 +8,7 @@ namespace storm {
namespace storage { namespace storage {
template<typename ValueType> template<typename ValueType>
BucketPriorityQueue<ValueType>::BucketPriorityQueue(size_t nrBuckets, double lowerValue, double ratio) : lowerValue(lowerValue), logBase(std::log(ratio)), nrBuckets(nrBuckets), nrUnsortedItems(0), buckets(nrBuckets), currentBucket(nrBuckets) {
BucketPriorityQueue<ValueType>::BucketPriorityQueue(size_t nrBuckets, double lowerValue, double ratio, bool higher) : lowerValue(lowerValue), higher(higher), logBase(std::log(ratio)), nrBuckets(nrBuckets), nrUnsortedItems(0), buckets(nrBuckets), currentBucket(nrBuckets) {
compare = ([](HeuristicPointer a, HeuristicPointer b) { compare = ([](HeuristicPointer a, HeuristicPointer b) {
return *a < *b; return *a < *b;
}); });
@ -166,7 +166,7 @@ namespace storm {
if (newBucket >= nrBuckets) { if (newBucket >= nrBuckets) {
newBucket = nrBuckets - 1; newBucket = nrBuckets - 1;
} }
if (!HIGHER) {
if (!higher) {
newBucket = nrBuckets-1 - newBucket; newBucket = nrBuckets-1 - newBucket;
} }
//std::cout << "get Bucket: " << priority << ", " << newBucket << std::endl; //std::cout << "get Bucket: " << priority << ", " << newBucket << std::endl;

4
src/storm-dft/storage/BucketPriorityQueue.h

@ -16,7 +16,7 @@ namespace storm {
using HeuristicPointer = std::shared_ptr<storm::builder::DFTExplorationHeuristicDepth<ValueType>>; using HeuristicPointer = std::shared_ptr<storm::builder::DFTExplorationHeuristicDepth<ValueType>>;
public: public:
explicit BucketPriorityQueue(size_t nrBuckets, double lowerValue, double ratio);
explicit BucketPriorityQueue(size_t nrBuckets, double lowerValue, double ratio, bool higher);
void fix(); void fix();
@ -44,7 +44,7 @@ namespace storm {
const double lowerValue; const double lowerValue;
const bool HIGHER = true;
const bool higher;
const bool AUTOSORT = false; const bool AUTOSORT = false;

Loading…
Cancel
Save