@ -17,23 +17,11 @@ namespace storm {
this - > setUses ( spareId , elem - > children ( ) [ 0 ] - > id ( ) ) ;
}
for ( auto elem : mDft . getBasicElements ( ) ) {
if ( ! storm : : utility : : isZero ( elem - > activeFailureRate ( ) ) ) {
mCurrentlyNotFailableBE . push_back ( elem - > id ( ) ) ;
}
}
// Initialize activation
propagateActivation ( mDft . getTopLevelIndex ( ) ) ;
std : : vector < size_t > alwaysActiveBEs = mDft . nonColdBEs ( ) ;
mCurrentlyFailableBE . insert ( mCurrentlyFailableBE . end ( ) , alwaysActiveBEs . begin ( ) , alwaysActiveBEs . end ( ) ) ;
// Remove always active BEs from currently not failable BEs
for ( size_t id : alwaysActiveBEs ) {
auto it = std : : find ( mCurrentlyNotFailableBE . begin ( ) , mCurrentlyNotFailableBE . end ( ) , id ) ;
STORM_LOG_ASSERT ( it ! = mCurrentlyNotFailableBE . end ( ) , " Id not found. " ) ;
mCurrentlyNotFailableBE . erase ( it ) ;
}
}
template < typename ValueType >
@ -46,7 +34,6 @@ namespace storm {
STORM_LOG_TRACE ( " Construct concrete state from pseudo state " < < mDft . getStateString ( mStatus , mStateGenerationInfo , mId ) ) ;
// Clear information from pseudo state
mCurrentlyFailableBE . clear ( ) ;
mCurrentlyNotFailableBE . clear ( ) ;
mFailableDependencies . clear ( ) ;
mUsedRepresentants . clear ( ) ;
STORM_LOG_ASSERT ( mPseudoState , " Only pseudo states can be constructed. " ) ;
@ -57,10 +44,6 @@ namespace storm {
if ( ( ! be - > isColdBasicElement ( ) & & be - > canFail ( ) ) | | ! mDft . hasRepresentant ( index ) | | isActive ( mDft . getRepresentant ( index ) ) ) {
mCurrentlyFailableBE . push_back ( index ) ;
STORM_LOG_TRACE ( " Currently failable: " < < mDft . getBasicElement ( index ) - > toString ( ) ) ;
} else {
// BE currently is not failable
mCurrentlyNotFailableBE . push_back ( index ) ;
STORM_LOG_TRACE ( " Currently not failable: " < < mDft . getBasicElement ( index ) - > toString ( ) ) ;
}
} else if ( mDft . getElement ( index ) - > isSpareGate ( ) ) {
// Initialize used representants
@ -204,11 +187,6 @@ namespace storm {
auto it = std : : find ( mCurrentlyFailableBE . begin ( ) , mCurrentlyFailableBE . end ( ) , id ) ;
if ( it ! = mCurrentlyFailableBE . end ( ) ) {
mCurrentlyFailableBE . erase ( it ) ;
} else {
it = std : : find ( mCurrentlyNotFailableBE . begin ( ) , mCurrentlyNotFailableBE . end ( ) , id ) ;
if ( it ! = mCurrentlyNotFailableBE . end ( ) ) {
mCurrentlyNotFailableBE . erase ( it ) ;
}
}
}
@ -241,35 +219,22 @@ namespace storm {
}
template < typename ValueType >
ValueType DFTState < ValueType > : : getBERate ( size_t id , bool avoidCold ) const {
ValueType DFTState < ValueType > : : getBERate ( size_t id ) const {
STORM_LOG_ASSERT ( mDft . isBasicElement ( id ) , " Element is no BE. " ) ;
if ( mDft . hasRepresentant ( id ) & & ! isActive ( mDft . getRepresentant ( id ) ) ) {
if ( avoidCold & & mDft . getBasicElement ( id ) - > isColdBasicElement ( ) ) {
// Return active failure rate instead of 0.
return mDft . getBasicElement ( id ) - > activeFailureRate ( ) ;
} else {
// Return passive failure rate
return mDft . getBasicElement ( id ) - > passiveFailureRate ( ) ;
}
// Return passive failure rate
return mDft . getBasicElement ( id ) - > passiveFailureRate ( ) ;
} else {
// Return active failure rate
return mDft . getBasicElement ( id ) - > activeFailureRate ( ) ;
}
// Return active failure rate
return mDft . getBasicElement ( id ) - > activeFailureRate ( ) ;
}
template < typename ValueType >
ValueType DFTState < ValueType > : : getFailableBERate ( size_t index ) const {
STORM_LOG_ASSERT ( index < nrFailableBEs ( ) , " Index invalid. " ) ;
return getBERate ( mCurrentlyFailableBE [ index ] , false ) ;
}
template < typename ValueType >
ValueType DFTState < ValueType > : : getNotFailableBERate ( size_t index ) const {
STORM_LOG_ASSERT ( index < nrNotFailableBEs ( ) , " Index invalid. " ) ;
STORM_LOG_ASSERT ( isPseudoState ( ) | | storm : : utility : : isZero < ValueType > ( mDft . getBasicElement ( mCurrentlyNotFailableBE [ index ] ) - > activeFailureRate ( ) ) | |
( mDft . hasRepresentant ( mCurrentlyNotFailableBE [ index ] ) & & ! isActive ( mDft . getRepresentant ( mCurrentlyNotFailableBE [ index ] ) ) ) , " BE " < < mCurrentlyNotFailableBE [ index ] < < " can fail in state: " < < mDft . getStateString ( mStatus , mStateGenerationInfo , mId ) ) ;
// Use active failure rate as passive failure rate is 0.
return getBERate ( mCurrentlyNotFailableBE [ index ] , true ) ;
return getBERate ( mCurrentlyFailableBE [ index ] ) ;
}
template < typename ValueType >
@ -326,10 +291,6 @@ namespace storm {
if ( be - > isColdBasicElement ( ) & & be - > canFail ( ) ) {
// Add to failable BEs
mCurrentlyFailableBE . push_back ( elem ) ;
// Remove from not failable BEs
auto it = std : : find ( mCurrentlyNotFailableBE . begin ( ) , mCurrentlyNotFailableBE . end ( ) , elem ) ;
STORM_LOG_ASSERT ( it ! = mCurrentlyNotFailableBE . end ( ) , " Element " < < elem < < " not found. " ) ;
mCurrentlyNotFailableBE . erase ( it ) ;
}
} else if ( mDft . getElement ( elem ) - > isSpareGate ( ) & & ! isActive ( uses ( elem ) ) ) {
propagateActivation ( uses ( elem ) ) ;