@ -5,6 +5,7 @@
# include "storm/storage/Scheduler.h"
# include "storm/storage/Scheduler.h"
# include "storm/storage/memorystructure/MemoryStructureBuilder.h"
# include "storm/storage/memorystructure/MemoryStructureBuilder.h"
# include "storm/storage/memorystructure/SparseModelMemoryProduct.h"
# include "storm/storage/memorystructure/SparseModelMemoryProduct.h"
# include "storm/transformer/SubsystemBuilder.h"
# include "storm/adapters/RationalFunctionAdapter.h"
# include "storm/adapters/RationalFunctionAdapter.h"
@ -46,6 +47,13 @@ namespace storm {
template < typename ValueType , typename RewardModelType >
template < typename ValueType , typename RewardModelType >
std : : shared_ptr < storm : : models : : sparse : : Model < ValueType , RewardModelType > > NondeterministicModel < ValueType , RewardModelType > : : applyScheduler ( storm : : storage : : Scheduler < ValueType > const & scheduler , bool dropUnreachableStates ) const {
std : : shared_ptr < storm : : models : : sparse : : Model < ValueType , RewardModelType > > NondeterministicModel < ValueType , RewardModelType > : : applyScheduler ( storm : : storage : : Scheduler < ValueType > const & scheduler , bool dropUnreachableStates ) const {
if ( scheduler . isMemorylessScheduler ( ) & & scheduler . isDeterministicScheduler ( ) & & ! scheduler . isPartialScheduler ( ) ) {
// Special case with improved handling.
storm : : storage : : BitVector actionSelection = scheduler . computeActionSupport ( getNondeterministicChoiceIndices ( ) ) ;
storm : : storage : : BitVector allStates ( this - > getNumberOfStates ( ) , true ) ;
auto res = storm : : transformer : : buildSubsystem ( * this , allStates , actionSelection , ! dropUnreachableStates ) ;
return res . model ;
} else {
storm : : storage : : SparseModelMemoryProduct < ValueType , RewardModelType > memoryProduct ( * this , scheduler ) ;
storm : : storage : : SparseModelMemoryProduct < ValueType , RewardModelType > memoryProduct ( * this , scheduler ) ;
if ( ! dropUnreachableStates ) {
if ( ! dropUnreachableStates ) {
memoryProduct . setBuildFullProduct ( ) ;
memoryProduct . setBuildFullProduct ( ) ;
@ -53,6 +61,9 @@ namespace storm {
return memoryProduct . build ( ) ;
return memoryProduct . build ( ) ;
}
}
}
template < typename ValueType , typename RewardModelType >
template < typename ValueType , typename RewardModelType >
void NondeterministicModel < ValueType , RewardModelType > : : printModelInformationToStream ( std : : ostream & out ) const {
void NondeterministicModel < ValueType , RewardModelType > : : printModelInformationToStream ( std : : ostream & out ) const {
this - > printModelInformationHeaderToStream ( out ) ;
this - > printModelInformationHeaderToStream ( out ) ;