@ -482,6 +482,9 @@ namespace storm {
bool hasOneEnabledCommand = false ;
bool hasOneEnabledCommand = false ;
for ( auto commandIndexIt = commandIndices . begin ( ) , commandIndexIte = commandIndices . end ( ) ; commandIndexIt ! = commandIndexIte ; + + commandIndexIt ) {
for ( auto commandIndexIt = commandIndices . begin ( ) , commandIndexIte = commandIndices . end ( ) ; commandIndexIt ! = commandIndexIte ; + + commandIndexIt ) {
storm : : prism : : Command const & command = module . getCommand ( * commandIndexIt ) ;
storm : : prism : : Command const & command = module . getCommand ( * commandIndexIt ) ;
if ( ! isCommandPotentiallySynchronizing ( command ) ) {
continue ;
}
if ( commandFilter ! = CommandFilter : : All ) {
if ( commandFilter ! = CommandFilter : : All ) {
STORM_LOG_ASSERT ( commandFilter = = CommandFilter : : Markovian | | commandFilter = = CommandFilter : : Probabilistic , " Unexpected command filter. " ) ;
STORM_LOG_ASSERT ( commandFilter = = CommandFilter : : Markovian | | commandFilter = = CommandFilter : : Probabilistic , " Unexpected command filter. " ) ;
if ( ( commandFilter = = CommandFilter : : Markovian ) ! = command . isMarkovian ( ) ) {
if ( ( commandFilter = = CommandFilter : : Markovian ) ! = command . isMarkovian ( ) ) {
@ -546,8 +549,8 @@ namespace storm {
for ( uint_fast64_t j = 0 ; j < module . getNumberOfCommands ( ) ; + + j ) {
for ( uint_fast64_t j = 0 ; j < module . getNumberOfCommands ( ) ; + + j ) {
storm : : prism : : Command const & command = module . getCommand ( j ) ;
storm : : prism : : Command const & command = module . getCommand ( j ) ;
// Only consider unlabeled commands.
if ( command . isLabeled ( ) ) continue ;
// Only consider commands that are not possibly synchronizing .
if ( isCommandPotentiallySynchronizing ( command ) ) continue ;
if ( commandFilter ! = CommandFilter : : All ) {
if ( commandFilter ! = CommandFilter : : All ) {
STORM_LOG_ASSERT ( commandFilter = = CommandFilter : : Markovian | | commandFilter = = CommandFilter : : Probabilistic , " Unexpected command filter. " ) ;
STORM_LOG_ASSERT ( commandFilter = = CommandFilter : : Markovian | | commandFilter = = CommandFilter : : Probabilistic , " Unexpected command filter. " ) ;
@ -607,6 +610,10 @@ namespace storm {
choice . addReward ( stateActionRewardValue ) ;
choice . addReward ( stateActionRewardValue ) ;
}
}
if ( this - > options . isBuildChoiceLabelsSet ( ) & & command . isLabeled ( ) ) {
choice . addLabel ( program . getActionName ( command . getActionIndex ( ) ) ) ;
}
if ( program . getModelType ( ) = = storm : : prism : : Program : : ModelType : : SMG ) {
if ( program . getModelType ( ) = = storm : : prism : : Program : : ModelType : : SMG ) {
storm : : storage : : PlayerIndex const & playerOfModule = moduleIndexToPlayerIndexMap . at ( i ) ;
storm : : storage : : PlayerIndex const & playerOfModule = moduleIndexToPlayerIndexMap . at ( i ) ;
STORM_LOG_THROW ( playerOfModule ! = storm : : storage : : INVALID_PLAYER_INDEX , storm : : exceptions : : WrongFormatException , " Module " < < module . getName ( ) < < " is not owned by any player but has at least one enabled, unlabeled command. " ) ;
STORM_LOG_THROW ( playerOfModule ! = storm : : storage : : INVALID_PLAYER_INDEX , storm : : exceptions : : WrongFormatException , " Module " < < module . getName ( ) < < " is not owned by any player but has at least one enabled, unlabeled command. " ) ;
@ -838,6 +845,11 @@ namespace storm {
return std : : make_shared < storm : : storage : : sparse : : PrismChoiceOrigins > ( std : : make_shared < storm : : prism : : Program > ( program ) , std : : move ( identifiers ) , std : : move ( identifierToCommandSetMapping ) ) ;
return std : : make_shared < storm : : storage : : sparse : : PrismChoiceOrigins > ( std : : make_shared < storm : : prism : : Program > ( program ) , std : : move ( identifiers ) , std : : move ( identifierToCommandSetMapping ) ) ;
}
}
template < typename ValueType , typename StateType >
bool PrismNextStateGenerator < ValueType , StateType > : : isCommandPotentiallySynchronizing ( const prism : : Command & command ) const {
return program . getPossiblySynchronizingCommands ( ) . get ( command . getGlobalIndex ( ) ) ;
}
template class PrismNextStateGenerator < double > ;
template class PrismNextStateGenerator < double > ;