|
|
@ -89,20 +89,22 @@ namespace storm { |
|
|
|
// Check, if the state was already registered.
|
|
|
|
std::pair<StateType, std::size_t> actualIndexBucketPair = stateStorage.stateToId.findOrAddAndGetBucket(state, newIndex); |
|
|
|
|
|
|
|
if (actualIndexBucketPair.first == newIndex) { |
|
|
|
StateType actualIndex = actualIndexBucketPair.first; |
|
|
|
|
|
|
|
if (actualIndex == newIndex) { |
|
|
|
if (options.explorationOrder == ExplorationOrder::Dfs) { |
|
|
|
statesToExplore.emplace_front(state, actualIndexBucketPair.first); |
|
|
|
statesToExplore.emplace_front(state, actualIndex); |
|
|
|
|
|
|
|
// Reserve one slot for the new state in the remapping.
|
|
|
|
stateRemapping.get().push_back(storm::utility::zero<StateType>()); |
|
|
|
} else if (options.explorationOrder == ExplorationOrder::Bfs) { |
|
|
|
statesToExplore.emplace_back(state, actualIndexBucketPair.first); |
|
|
|
statesToExplore.emplace_back(state, actualIndex); |
|
|
|
} else { |
|
|
|
STORM_LOG_ASSERT(false, "Invalid exploration order."); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return actualIndexBucketPair.first; |
|
|
|
return actualIndex; |
|
|
|
} |
|
|
|
|
|
|
|
template <typename ValueType, typename RewardModelType, typename StateType> |
|
|
@ -306,7 +308,7 @@ namespace storm { |
|
|
|
|
|
|
|
buildMatrices(transitionMatrixBuilder, rewardModelBuilders, choiceInformationBuilder, markovianStates); |
|
|
|
|
|
|
|
// initialize the model components with the obtained information.
|
|
|
|
// Initialize the model components with the obtained information.
|
|
|
|
storm::storage::sparse::ModelComponents<ValueType, RewardModelType> modelComponents(transitionMatrixBuilder.build(), buildStateLabeling(), std::unordered_map<std::string, RewardModelType>(), !generator->isDiscreteTimeModel(), std::move(markovianStates)); |
|
|
|
|
|
|
|
// Now finalize all reward models.
|
|
|
@ -316,7 +318,7 @@ namespace storm { |
|
|
|
// Build the choice labeling
|
|
|
|
modelComponents.choiceLabeling = choiceInformationBuilder.buildChoiceLabeling(modelComponents.transitionMatrix.getRowCount()); |
|
|
|
|
|
|
|
// if requested, build the state valuations and choice origins
|
|
|
|
// If requested, build the state valuations and choice origins
|
|
|
|
if (generator->getOptions().isBuildStateValuationsSet()) { |
|
|
|
std::vector<storm::expressions::SimpleValuation> valuations(modelComponents.transitionMatrix.getRowGroupCount()); |
|
|
|
for (auto const& bitVectorIndexPair : stateStorage.stateToId) { |
|
|
@ -334,7 +336,7 @@ namespace storm { |
|
|
|
|
|
|
|
template <typename ValueType, typename RewardModelType, typename StateType> |
|
|
|
storm::models::sparse::StateLabeling ExplicitModelBuilder<ValueType, RewardModelType, StateType>::buildStateLabeling() { |
|
|
|
return generator->label(stateStorage.stateToId, stateStorage.initialStateIndices, stateStorage.deadlockStateIndices); |
|
|
|
return generator->label(stateStorage, stateStorage.initialStateIndices, stateStorage.deadlockStateIndices); |
|
|
|
} |
|
|
|
|
|
|
|
// Explicitly instantiate the class.
|
|
|
|