Browse Source

fixes regarding state elimination on mdps

tempestpy_adaptions
TimQu 8 years ago
parent
commit
efd430a33f
  1. 2
      src/storm/modelchecker/parametric/ParameterLifting.cpp
  2. 6
      src/storm/solver/stateelimination/EliminatorBase.cpp
  3. 4
      src/storm/storage/FlexibleSparseMatrix.cpp

2
src/storm/modelchecker/parametric/ParameterLifting.cpp

@ -143,7 +143,7 @@ namespace storm {
while (fractionOfUndiscoveredArea > threshold) { while (fractionOfUndiscoveredArea > threshold) {
STORM_LOG_THROW(indexOfCurrentRegion < regions.size(), storm::exceptions::InvalidStateException, "Threshold for undiscovered area not reached but no unprocessed regions left."); STORM_LOG_THROW(indexOfCurrentRegion < regions.size(), storm::exceptions::InvalidStateException, "Threshold for undiscovered area not reached but no unprocessed regions left.");
STORM_LOG_INFO("Analyzing region #" << regions.size() -1 << " (" << storm::utility::convertNumber<double>(fractionOfUndiscoveredArea) * 100 << "% still unknown)");
STORM_LOG_INFO("Analyzing region #" << indexOfCurrentRegion << " (" << storm::utility::convertNumber<double>(fractionOfUndiscoveredArea) * 100 << "% still unknown)");
auto const& currentRegion = regions[indexOfCurrentRegion].first; auto const& currentRegion = regions[indexOfCurrentRegion].first;
auto& res = regions[indexOfCurrentRegion].second; auto& res = regions[indexOfCurrentRegion].second;
res = analyzeRegion(currentRegion, res, false); res = analyzeRegion(currentRegion, res, false);

6
src/storm/solver/stateelimination/EliminatorBase.cpp

@ -207,7 +207,7 @@ namespace storm {
break; break;
} }
if (first2->getColumn() < first1->getColumn()) { if (first2->getColumn() < first1->getColumn()) {
if (first2->getColumn() != column) {
if (first2->getColumn() != row) {
*result = *first2; *result = *first2;
} }
++first2; ++first2;
@ -225,9 +225,9 @@ namespace storm {
} }
} }
if (isFilterPredecessor()) { if (isFilterPredecessor()) {
std::copy_if(first2, last2, result, [&] (storm::storage::MatrixEntry<typename storm::storage::FlexibleSparseMatrix<ValueType>::index_type, typename storm::storage::FlexibleSparseMatrix<ValueType>::value_type> const& a) { return a.getColumn() != column && filterPredecessor(a.getColumn()); });
std::copy_if(first2, last2, result, [&] (storm::storage::MatrixEntry<typename storm::storage::FlexibleSparseMatrix<ValueType>::index_type, typename storm::storage::FlexibleSparseMatrix<ValueType>::value_type> const& a) { return a.getColumn() != row && filterPredecessor(a.getColumn()); });
} else { } else {
std::copy_if(first2, last2, result, [&] (storm::storage::MatrixEntry<typename storm::storage::FlexibleSparseMatrix<ValueType>::index_type, typename storm::storage::FlexibleSparseMatrix<ValueType>::value_type> const& a) { return a.getColumn() != column; });
std::copy_if(first2, last2, result, [&] (storm::storage::MatrixEntry<typename storm::storage::FlexibleSparseMatrix<ValueType>::index_type, typename storm::storage::FlexibleSparseMatrix<ValueType>::value_type> const& a) { return a.getColumn() != row; });
} }
// Now move the new predecessors in place. // Now move the new predecessors in place.
successorBackwardTransitions = std::move(newPredecessors); successorBackwardTransitions = std::move(newPredecessors);

4
src/storm/storage/FlexibleSparseMatrix.cpp

@ -234,7 +234,7 @@ namespace storm {
oldToNewColumnIndexMapping[oldColumnIndex] = newColumnIndex++; oldToNewColumnIndexMapping[oldColumnIndex] = newColumnIndex++;
} }
storm::storage::SparseMatrixBuilder<ValueType> matrixBuilder(rowConstraint.getNumberOfSetBits(), newColumnIndex, numEntries, hasTrivialRowGrouping(), numRowGroups);
storm::storage::SparseMatrixBuilder<ValueType> matrixBuilder(rowConstraint.getNumberOfSetBits(), newColumnIndex, numEntries, true, hasTrivialRowGrouping(), numRowGroups);
uint_fast64_t currRowIndex = 0; uint_fast64_t currRowIndex = 0;
auto rowGroupIndexIt = getRowGroupIndices().begin(); auto rowGroupIndexIt = getRowGroupIndices().begin();
for (auto const& oldRowIndex : rowConstraint) { for (auto const& oldRowIndex : rowConstraint) {
@ -243,7 +243,7 @@ namespace storm {
// Skip empty row groups // Skip empty row groups
do { do {
++rowGroupIndexIt; ++rowGroupIndexIt;
} while (currRowIndex >= *rowGroupIndexIt);
} while (oldRowIndex >= *rowGroupIndexIt);
} }
auto const& row = data[oldRowIndex]; auto const& row = data[oldRowIndex];
for (auto const& entry : row) { for (auto const& entry : row) {

Loading…
Cancel
Save