@@ -100,7 +100,7 @@ void DeterministicModelBisimulationDecomposition<ModelType>::initializeSilentPro
100100 Block<BlockDataType> const * currentBlockPtr = &this ->partition .getBlock (state);
101101 for (auto const & successorEntry : this ->model .getTransitionMatrix ().getRowGroup (state)) {
102102 if (&this ->partition .getBlock (successorEntry.getColumn ()) == currentBlockPtr) {
103- silentProbabilities[state] += successorEntry. getValue ( );
103+ silentProbabilities[state] += getTransitionValue (successorEntry, state );
104104 }
105105 }
106106 }
@@ -315,7 +315,7 @@ void DeterministicModelBisimulationDecomposition<ModelType>::exploreRemainingSta
315315 }
316316
317317 // We keep track of the probability of the predecessor moving to the splitter.
318- increaseProbabilityToSplitter (predecessor, predecessorBlock, predecessorEntry. getValue ( ));
318+ increaseProbabilityToSplitter (predecessor, predecessorBlock, getTransitionValue (predecessorEntry, predecessor ));
319319
320320 // Only move the state if it has not been seen as a predecessor before.
321321 storm::storage::sparse::state_type predecessorPosition = this ->partition .getPosition (predecessor);
@@ -354,7 +354,7 @@ void DeterministicModelBisimulationDecomposition<ModelType>::updateSilentProbabi
354354 ValueType newSilentProbability = storm::utility::zero<ValueType>();
355355 for (auto const & successorEntry : this ->model .getTransitionMatrix ().getRow (*stateIt)) {
356356 if (this ->partition .getBlock (successorEntry.getColumn ()) == block) {
357- newSilentProbability += successorEntry. getValue ( );
357+ newSilentProbability += getTransitionValue (successorEntry, *stateIt );
358358 }
359359 }
360360 silentProbabilities[*stateIt] = newSilentProbability;
@@ -541,7 +541,7 @@ void DeterministicModelBisimulationDecomposition<ModelType>::refinePartitionBase
541541 }
542542
543543 // We keep track of the probability of the predecessor moving to the splitter.
544- increaseProbabilityToSplitter (predecessor, predecessorBlock, predecessorEntry. getValue ( ));
544+ increaseProbabilityToSplitter (predecessor, predecessorBlock, getTransitionValue (predecessorEntry, predecessor ));
545545
546546 // We only need to move the predecessor if it is not already known as a predecessor already.
547547 if (predecessorPosition >= predecessorBlock.data ().marker1 ()) {
@@ -660,9 +660,10 @@ void DeterministicModelBisimulationDecomposition<ModelType>::buildQuotient() {
660660
661661 auto probIterator = blockProbability.find (targetBlock);
662662 if (probIterator != blockProbability.end ()) {
663- probIterator->second += entry. getValue ( );
663+ probIterator->second += getTransitionValue (entry, representativeState );
664664 } else {
665- blockProbability[targetBlock] = entry.getValue ();
665+ blockProbability[targetBlock] = getTransitionValue (entry, representativeState);
666+ ;
666667 }
667668 }
668669
@@ -718,6 +719,44 @@ void DeterministicModelBisimulationDecomposition<ModelType>::buildQuotient() {
718719 this ->quotient = std::make_shared<ModelType>(builder.build (), std::move (newLabeling), std::move (rewardModels));
719720}
720721
722+ template <typename ModelType>
723+ DeterministicModelBisimulationDecomposition<ModelType>::ValueType DeterministicModelBisimulationDecomposition<ModelType>::getTransitionValue(
724+ storm::storage::MatrixEntry<storm::storage::sparse::state_type, ValueType> const & matrixEntry, storm::storage::sparse::state_type state) const {
725+ return matrixEntry.getValue ();
726+ }
727+
728+ // Need to specialize for all ValueType
729+ template <>
730+ double DeterministicModelBisimulationDecomposition<storm::models::sparse::Ctmc<double >>::getTransitionValue(
731+ storm::storage::MatrixEntry<storm::storage::sparse::state_type, double > const & matrixEntry, storm::storage::sparse::state_type state) const {
732+ double transitionValue = matrixEntry.getValue ();
733+ // Currently not needed as CTMCs are stored as rate matrix
734+ // TODO: enable when removing CTMC rate matrix
735+ // transitionValue *= this->model.getExitRateVector().at(state);
736+ return transitionValue;
737+ }
738+
739+ template <>
740+ storm::RationalNumber DeterministicModelBisimulationDecomposition<storm::models::sparse::Ctmc<storm::RationalNumber>>::getTransitionValue(
741+ storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::RationalNumber> const & matrixEntry, storm::storage::sparse::state_type state) const {
742+ storm::RationalNumber transitionValue = matrixEntry.getValue ();
743+ // Currently not needed as CTMCs are stored as rate matrix
744+ // TODO: enable when removing CTMC rate matrix
745+ // transitionValue *= this->model.getExitRateVector().at(state);
746+ return transitionValue;
747+ }
748+
749+ template <>
750+ storm::RationalFunction DeterministicModelBisimulationDecomposition<storm::models::sparse::Ctmc<storm::RationalFunction>>::getTransitionValue(
751+ storm::storage::MatrixEntry<storm::storage::sparse::state_type, storm::RationalFunction> const & matrixEntry,
752+ storm::storage::sparse::state_type state) const {
753+ storm::RationalFunction transitionValue = matrixEntry.getValue ();
754+ // Currently not needed as CTMCs are stored as rate matrix
755+ // TODO: enable when removing CTMC rate matrix
756+ // transitionValue *= this->model.getExitRateVector().at(state);
757+ return transitionValue;
758+ }
759+
721760template class DeterministicModelBisimulationDecomposition <storm::models::sparse::Dtmc<double >>;
722761template class DeterministicModelBisimulationDecomposition <storm::models::sparse::Ctmc<double >>;
723762
0 commit comments