Browse Source

also store the reward choices in the epoch model

tempestpy_adaptions
TimQu 7 years ago
parent
commit
6334168fbe
  1. 8
      src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.cpp
  2. 1
      src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.h

8
src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.cpp

@ -202,7 +202,7 @@ namespace storm {
storm::storage::SparseMatrix<ValueType> const& allTransitions = modelMemoryProduct->getTransitionMatrix();
std::shared_ptr<EpochModel> result = std::make_shared<EpochModel>();
storm::storage::BitVector rewardChoices(allTransitions.getRowCount(), false);
result->rewardChoices = storm::storage::BitVector(allTransitions.getRowCount(), false);
result->epochSteps.resize(modelMemoryProduct->getNumberOfChoices());
for (uint64_t modelState = 0; modelState < model.getNumberOfStates(); ++modelState) {
uint64_t numChoices = model.getTransitionMatrix().getRowGroupSize(modelState);
@ -220,14 +220,14 @@ namespace storm {
uint64_t productChoice = allTransitions.getRowGroupIndices()[productState] + choiceOffset;
assert(productChoice < allTransitions.getRowGroupIndices()[productState + 1]);
result->epochSteps[productChoice] = step;
rewardChoices.set(productChoice, true);
result->rewardChoices.set(productChoice, true);
}
}
}
}
result->rewardTransitions = allTransitions.filterEntries(rewardChoices);
result->intermediateTransitions = allTransitions.filterEntries(~rewardChoices);
result->rewardTransitions = allTransitions.filterEntries(result->rewardChoices);
result->intermediateTransitions = allTransitions.filterEntries(~result->rewardChoices);
result->objectiveRewards = computeObjectiveRewardsForEpoch(epoch, modelMemoryProduct);

1
src/storm/modelchecker/multiobjective/rewardbounded/MultiDimensionalRewardUnfolding.h

@ -24,6 +24,7 @@ namespace storm {
struct EpochModel {
storm::storage::SparseMatrix<ValueType> rewardTransitions;
storm::storage::SparseMatrix<ValueType> intermediateTransitions;
storm::storage::BitVector rewardChoices;
std::vector<boost::optional<Epoch>> epochSteps;
std::vector<std::vector<ValueType>> objectiveRewards;
std::vector<storm::storage::BitVector> objectiveRewardFilter;

Loading…
Cancel
Save