Browse Source

fixed a bug related to closing symbolic Markov automata

tempestpy_adaptions
dehnert 7 years ago
parent
commit
316412c5d3
  1. 2
      src/storm/builder/DdJaniModelBuilder.cpp
  2. 2
      src/storm/modelchecker/csl/helper/SparseMarkovAutomatonCslHelper.cpp
  3. 2
      src/storm/models/symbolic/MarkovAutomaton.cpp

2
src/storm/builder/DdJaniModelBuilder.cpp

@ -1830,7 +1830,7 @@ namespace storm {
// For DTMCs, we can simply add the identity of the global module for all deadlock states. // For DTMCs, we can simply add the identity of the global module for all deadlock states.
transitionMatrix += deadlockStatesAdd * globalIdentity; transitionMatrix += deadlockStatesAdd * globalIdentity;
} else if (modelType == storm::jani::ModelType::MDP || modelType == storm::jani::ModelType::LTS || modelType == storm::jani::ModelType::MA) { } else if (modelType == storm::jani::ModelType::MDP || modelType == storm::jani::ModelType::LTS || modelType == storm::jani::ModelType::MA) {
// For MDPs, however, we need to select an action associated with the self-loop, if we do not
// For nondeterministic models, however, we need to select an action associated with the self-loop, if we do not
// want to attach a lot of self-loops to the deadlock states. // want to attach a lot of self-loops to the deadlock states.
storm::dd::Add<Type, ValueType> action = encodeAction(boost::none, modelType == storm::jani::ModelType::MA ? boost::make_optional(true) : boost::none, variables); storm::dd::Add<Type, ValueType> action = encodeAction(boost::none, modelType == storm::jani::ModelType::MA ? boost::make_optional(true) : boost::none, variables);

2
src/storm/modelchecker/csl/helper/SparseMarkovAutomatonCslHelper.cpp

@ -261,6 +261,7 @@ namespace storm {
for (ValueType const& rate : exitRateVector) { for (ValueType const& rate : exitRateVector) {
lambda = std::max(rate, lambda); lambda = std::max(rate, lambda);
} }
STORM_LOG_TRACE("Initial lambda is " << lambda << ".");
uint64_t N; uint64_t N;
ValueType maxNorm = storm::utility::zero<ValueType>(); ValueType maxNorm = storm::utility::zero<ValueType>();
@ -369,6 +370,7 @@ namespace storm {
// (6) Double lambda. // (6) Double lambda.
lambda *= 2; lambda *= 2;
STORM_LOG_TRACE("Increased lambda to " << lambda << ", max diff is " << maxNorm << ".");
} while (maxNorm > epsilon * (1 - kappa)); } while (maxNorm > epsilon * (1 - kappa));

2
src/storm/models/symbolic/MarkovAutomaton.cpp

@ -105,7 +105,7 @@ namespace storm {
template<storm::dd::DdType Type, typename ValueType> template<storm::dd::DdType Type, typename ValueType>
MarkovAutomaton<Type, ValueType> MarkovAutomaton<Type, ValueType>::close() { MarkovAutomaton<Type, ValueType> MarkovAutomaton<Type, ValueType>::close() {
// Create the new transition matrix by deleting all Markovian transitions from probabilistic states. // Create the new transition matrix by deleting all Markovian transitions from probabilistic states.
storm::dd::Add<Type, ValueType> newTransitionMatrix = this->probabilisticStates.ite(this->getTransitionMatrix() * (!this->getMarkovianMarker()).template toAdd<ValueType>(), this->getTransitionMatrix());
storm::dd::Add<Type, ValueType> newTransitionMatrix = this->probabilisticStates.ite(this->getTransitionMatrix() * (!this->getMarkovianMarker()).template toAdd<ValueType>(), this->getTransitionMatrix() * this->getExitRateVector());
return MarkovAutomaton<Type, ValueType>(this->getManagerAsSharedPointer(), this->getMarkovianMarker(), this->getReachableStates(), this->getInitialStates(), this->getDeadlockStates(), newTransitionMatrix, this->getRowVariables(), this->getRowExpressionAdapter(), this->getColumnVariables(), this->getRowColumnMetaVariablePairs(), this->getNondeterminismVariables(), this->getLabelToExpressionMap(), this->getRewardModels()); return MarkovAutomaton<Type, ValueType>(this->getManagerAsSharedPointer(), this->getMarkovianMarker(), this->getReachableStates(), this->getInitialStates(), this->getDeadlockStates(), newTransitionMatrix, this->getRowVariables(), this->getRowExpressionAdapter(), this->getColumnVariables(), this->getRowColumnMetaVariablePairs(), this->getNondeterminismVariables(), this->getLabelToExpressionMap(), this->getRewardModels());
} }

Loading…
Cancel
Save