18 STORM_LOG_THROW(inputModel, storm::exceptions::IllegalArgumentTypeException,
"Cannot transform a null model.");
20 convertedComponents.
transitionMatrix = inputModel->getTransitionMatrix().toValueType<
double>();
23 for (uint64_t row = 0; row < convertedComponents.
transitionMatrix.getRowCount(); ++row) {
27 entry.setValue(entry.getValue() / rowSum);
32 convertedComponents.
choiceLabeling = inputModel->getOptionalChoiceLabeling();
33 convertedComponents.
stateLabeling = inputModel->getStateLabeling();
34 convertedComponents.
stateValuations = inputModel->getOptionalStateValuations();
35 convertedComponents.
choiceOrigins = inputModel->getOptionalChoiceOrigins();
36 for (
auto const& [rewardModelName, rewardModel] : inputModel->getRewardModels()) {
38 std::optional<std::vector<double>> optionalStateRewardVector = std::nullopt;
39 std::optional<std::vector<double>> optionalStateActionRewardVector = std::nullopt;
40 std::optional<storm::storage::SparseMatrix<double>> optionalTransitionRewardMatrix = std::nullopt;
41 if (rewardModel.hasStateRewards()) {
44 if (rewardModel.hasStateActionRewards()) {
47 if (rewardModel.hasTransitionRewards()) {
48 optionalTransitionRewardMatrix = rewardModel.getTransitionRewardMatrix().toValueType<
double>();
52 std::move(optionalStateRewardVector), std::move(optionalStateActionRewardVector), std::move(optionalTransitionRewardMatrix)));
56 switch (inputModel->getType()) {
68 std::vector<double> resultVector;
69 resultVector.reserve(ma->getExitRates().size());
70 for (
auto const& oldValue : ma->getExitRates()) {
73 convertedComponents.
exitRates = resultVector;
98 "Transformation to double is not supported for models of type " << inputModel->getType() <<
".");