|
|
@ -114,22 +114,22 @@ namespace storm { |
|
|
|
} |
|
|
|
|
|
|
|
std::shared_ptr<storm::models::sparse::Model<ValueType>> model; |
|
|
|
// Turn the probabilities into rates by multiplying each row with the exit rate of the state.
|
|
|
|
// TODO Matthias: avoid transforming back and forth
|
|
|
|
storm::storage::SparseMatrix<ValueType> rateMatrix(modelComponents.transitionMatrix); |
|
|
|
for (uint_fast64_t row = 0; row < rateMatrix.getRowCount(); ++row) { |
|
|
|
assert(row < modelComponents.markovianStates.size()); |
|
|
|
if (modelComponents.markovianStates.get(row)) { |
|
|
|
for (auto& entry : rateMatrix.getRow(row)) { |
|
|
|
entry.setValue(entry.getValue() * modelComponents.exitRates[row]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (deterministic) { |
|
|
|
// Turn the probabilities into rates by multiplying each row with the exit rate of the state.
|
|
|
|
// TODO Matthias: avoid transforming back and forth
|
|
|
|
storm::storage::SparseMatrix<ValueType> rateMatrix(modelComponents.transitionMatrix); |
|
|
|
for (uint_fast64_t row = 0; row < rateMatrix.getRowCount(); ++row) { |
|
|
|
assert(row < modelComponents.markovianStates.size()); |
|
|
|
if (modelComponents.markovianStates.get(row)) { |
|
|
|
for (auto& entry : rateMatrix.getRow(row)) { |
|
|
|
entry.setValue(entry.getValue() * modelComponents.exitRates[row]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
model = std::make_shared<storm::models::sparse::Ctmc<ValueType>>(std::move(rateMatrix), std::move(modelComponents.stateLabeling)); |
|
|
|
} else { |
|
|
|
model = std::make_shared<storm::models::sparse::MarkovAutomaton<ValueType>>(std::move(rateMatrix), std::move(modelComponents.stateLabeling), std::move(modelComponents.markovianStates), std::move(modelComponents.exitRates)); |
|
|
|
model = std::make_shared<storm::models::sparse::MarkovAutomaton<ValueType>>(std::move(modelComponents.transitionMatrix), std::move(modelComponents.stateLabeling), std::move(modelComponents.markovianStates), std::move(modelComponents.exitRates), true); |
|
|
|
} |
|
|
|
|
|
|
|
model->printModelInformationToStream(std::cout); |
|
|
|