Browse Source

fixed a few bugs

tempestpy_adaptions
dehnert 8 years ago
parent
commit
a2e29893f2
  1. 7
      src/storm/modelchecker/prctl/helper/HybridMdpPrctlHelper.cpp
  2. 1
      src/storm/modelchecker/prctl/helper/SparseDtmcPrctlHelper.cpp
  3. 2
      src/storm/modelchecker/prctl/helper/SymbolicDtmcPrctlHelper.cpp
  4. 1
      src/storm/modelchecker/results/HybridQuantitativeCheckResult.cpp
  5. 6
      src/storm/solver/SymbolicMinMaxLinearEquationSolver.cpp

7
src/storm/modelchecker/prctl/helper/HybridMdpPrctlHelper.cpp

@ -243,6 +243,11 @@ namespace storm {
// Then compute the state reward vector to use in the computation. // Then compute the state reward vector to use in the computation.
storm::dd::Add<DdType, ValueType> subvector = rewardModel.getTotalRewardVector(maybeStatesAdd, submatrix, model.getColumnVariables()); storm::dd::Add<DdType, ValueType> subvector = rewardModel.getTotalRewardVector(maybeStatesAdd, submatrix, model.getColumnVariables());
if (!rewardModel.hasStateActionRewards() && !rewardModel.hasTransitionRewards()) {
// If the reward model neither has state-action nor transition rewards, we need to multiply
// it with the legal nondetermism encodings in each state.
subvector *= transitionMatrixBdd.existsAbstract(model.getColumnVariables()).template toAdd<ValueType>();
}
// Since we are cutting away target and infinity states, we need to account for this by giving // Since we are cutting away target and infinity states, we need to account for this by giving
// choices the value infinity that have some successor contained in the infinity states. // choices the value infinity that have some successor contained in the infinity states.
@ -250,7 +255,7 @@ namespace storm {
subvector = choicesWithInfinitySuccessor.ite(model.getManager().template getInfinity<ValueType>(), subvector); subvector = choicesWithInfinitySuccessor.ite(model.getManager().template getInfinity<ValueType>(), subvector);
// Before cutting the non-maybe columns, we need to compute the sizes of the row groups. // Before cutting the non-maybe columns, we need to compute the sizes of the row groups.
storm::dd::Add<DdType, uint_fast64_t> stateActionAdd = (submatrix.notZero().existsAbstract(model.getColumnVariables()) || subvector.notZero()).template toAdd<uint_fast64_t>();
storm::dd::Add<DdType, uint_fast64_t> stateActionAdd = submatrix.notZero().existsAbstract(model.getColumnVariables()).template toAdd<uint_fast64_t>();
std::vector<uint_fast64_t> rowGroupSizes = stateActionAdd.sumAbstract(model.getNondeterminismVariables()).toVector(odd); std::vector<uint_fast64_t> rowGroupSizes = stateActionAdd.sumAbstract(model.getNondeterminismVariables()).toVector(odd);
// Finally cut away all columns targeting non-maybe states. // Finally cut away all columns targeting non-maybe states.

1
src/storm/modelchecker/prctl/helper/SparseDtmcPrctlHelper.cpp

@ -88,7 +88,6 @@ namespace storm {
storm::utility::vector::selectVectorValues(x, maybeStates, resultHint.get()); storm::utility::vector::selectVectorValues(x, maybeStates, resultHint.get());
} }
// Prepare the right-hand side of the equation system. For entry i this corresponds to // Prepare the right-hand side of the equation system. For entry i this corresponds to
// the accumulated probability of going from state i to some 'yes' state. // the accumulated probability of going from state i to some 'yes' state.
std::vector<ValueType> b = transitionMatrix.getConstrainedRowSumVector(maybeStates, statesWithProbability1); std::vector<ValueType> b = transitionMatrix.getConstrainedRowSumVector(maybeStates, statesWithProbability1);

2
src/storm/modelchecker/prctl/helper/SymbolicDtmcPrctlHelper.cpp

@ -166,7 +166,7 @@ namespace storm {
storm::dd::Add<DdType, ValueType> submatrix = transitionMatrix * maybeStatesAdd; storm::dd::Add<DdType, ValueType> submatrix = transitionMatrix * maybeStatesAdd;
// Then compute the state reward vector to use in the computation. // Then compute the state reward vector to use in the computation.
storm::dd::Add<DdType, ValueType> subvector = rewardModel.getTotalRewardVector(submatrix, model.getColumnVariables());
storm::dd::Add<DdType, ValueType> subvector = rewardModel.getTotalRewardVector(maybeStatesAdd, submatrix, model.getColumnVariables());
// Finally cut away all columns targeting non-maybe states and convert the matrix into the matrix needed // Finally cut away all columns targeting non-maybe states and convert the matrix into the matrix needed
// for solving the equation system (i.e. compute (I-A)). // for solving the equation system (i.e. compute (I-A)).

1
src/storm/modelchecker/results/HybridQuantitativeCheckResult.cpp

@ -106,6 +106,7 @@ namespace storm {
if (!this->symbolicStates.isZero()) { if (!this->symbolicStates.isZero()) {
if (this->symbolicValues.isZero()) { if (this->symbolicValues.isZero()) {
out << "0"; out << "0";
first = false;
} else { } else {
for (auto valuationValuePair : this->symbolicValues) { for (auto valuationValuePair : this->symbolicValues) {
if (!first) { if (!first) {

6
src/storm/solver/SymbolicMinMaxLinearEquationSolver.cpp

@ -54,15 +54,15 @@ namespace storm {
xCopy = tmp; xCopy = tmp;
++iterations;
}
if (converged) { if (converged) {
STORM_LOG_TRACE("Iterative solver converged in " << iterations << " iterations."); STORM_LOG_TRACE("Iterative solver converged in " << iterations << " iterations.");
} else { } else {
STORM_LOG_WARN("Iterative solver did not converge in " << iterations << " iterstions."); STORM_LOG_WARN("Iterative solver did not converge in " << iterations << " iterstions.");
} }
++iterations;
}
return xCopy; return xCopy;
} }

Loading…
Cancel
Save