@ -13,6 +13,7 @@
# include "storm-dft/api/storm-dft.h"
# include "storm-dft/api/storm-dft.h"
# include "storm-dft/builder/ExplicitDFTModelBuilder.h"
# include "storm-dft/builder/ExplicitDFTModelBuilder.h"
# include "storm-dft/storage/dft/DFTIsomorphism.h"
# include "storm-dft/storage/dft/DFTIsomorphism.h"
# include "storm-dft/settings/modules/DftIOSettings.h"
# include "storm-dft/settings/modules/FaultTreeSettings.h"
# include "storm-dft/settings/modules/FaultTreeSettings.h"
@ -305,6 +306,8 @@ namespace storm {
storm : : builder : : ApproximationHeuristic approximationHeuristic ,
storm : : builder : : ApproximationHeuristic approximationHeuristic ,
bool eliminateChains , storm : : transformer : : EliminationLabelBehavior labelBehavior ) {
bool eliminateChains , storm : : transformer : : EliminationLabelBehavior labelBehavior ) {
explorationTimer . start ( ) ;
explorationTimer . start ( ) ;
auto ioSettings = storm : : settings : : getModule < storm : : settings : : modules : : IOSettings > ( ) ;
auto dftIOSettings = storm : : settings : : getModule < storm : : settings : : modules : : DftIOSettings > ( ) ;
// Find symmetries
// Find symmetries
std : : map < size_t , std : : vector < std : : vector < size_t > > > emptySymmetry ;
std : : map < size_t , std : : vector < std : : vector < size_t > > > emptySymmetry ;
@ -355,12 +358,12 @@ namespace storm {
STORM_LOG_DEBUG ( " Getting model for lower bound... " ) ;
STORM_LOG_DEBUG ( " Getting model for lower bound... " ) ;
model = builder . getModelApproximation ( true , ! probabilityFormula ) ;
model = builder . getModelApproximation ( true , ! probabilityFormula ) ;
// We only output the info from the lower bound as the info for the upper bound is the same
// We only output the info from the lower bound as the info for the upper bound is the same
if ( printInfo ) {
if ( printInfo & & dftIOSettings . isShowDftStatisticsSet ( ) ) {
std : : cout < < " Model in iteration " < < ( iteration + 1 ) < < " : " < < std : : endl ;
model - > printModelInformationToStream ( std : : cout ) ;
model - > printModelInformationToStream ( std : : cout ) ;
}
}
buildingTimer . stop ( ) ;
buildingTimer . stop ( ) ;
auto ioSettings = storm : : settings : : getModule < storm : : settings : : modules : : IOSettings > ( ) ;
if ( ioSettings . isExportExplicitSet ( ) ) {
if ( ioSettings . isExportExplicitSet ( ) ) {
std : : vector < std : : string > parameterNames ;
std : : vector < std : : string > parameterNames ;
// TODO fill parameter names
// TODO fill parameter names
@ -388,24 +391,33 @@ namespace storm {
< < approxResult . second ) ;
< < approxResult . second ) ;
approxResult . second = newResult [ 0 ] ;
approxResult . second = newResult [ 0 ] ;
+ + iteration ;
STORM_LOG_ASSERT ( comparator . isLess ( approxResult . first , approxResult . second ) | |
STORM_LOG_ASSERT ( comparator . isLess ( approxResult . first , approxResult . second ) | |
comparator . isEqual ( approxResult . first , approxResult . second ) ,
comparator . isEqual ( approxResult . first , approxResult . second ) ,
" Under-approximation " < < approxResult . first
" Under-approximation " < < approxResult . first
< < " is greater than over-approximation "
< < " is greater than over-approximation "
< < approxResult . second ) ;
< < approxResult . second ) ;
STORM_LOG_DEBUG ( " Result after iteration " < < iteration < < " : ( " < < std : : setprecision ( 10 ) < < approxResult . first < < " , " < < approxResult . second < < " ) " ) ;
totalTimer . stop ( ) ;
totalTimer . stop ( ) ;
printTimings ( ) ;
if ( printInfo & & dftIOSettings . isShowDftStatisticsSet ( ) ) {
std : : cout < < " Result after iteration " < < ( iteration + 1 ) < < " : ( " < < std : : setprecision ( 10 ) < < approxResult . first < < " , " < < approxResult . second < < " ) " < < std : : endl ;
printTimings ( ) ;
std : : cout < < std : : endl ;
} else {
STORM_LOG_DEBUG ( " Result after iteration " < < ( iteration + 1 ) < < " : ( " < < std : : setprecision ( 10 ) < < approxResult . first < < " , " < < approxResult . second < < " ) " ) ;
}
totalTimer . start ( ) ;
totalTimer . start ( ) ;
STORM_LOG_THROW ( ! storm : : utility : : isInfinity < ValueType > ( approxResult . first ) & &
STORM_LOG_THROW ( ! storm : : utility : : isInfinity < ValueType > ( approxResult . first ) & &
! storm : : utility : : isInfinity < ValueType > ( approxResult . second ) ,
! storm : : utility : : isInfinity < ValueType > ( approxResult . second ) ,
storm : : exceptions : : NotSupportedException ,
storm : : exceptions : : NotSupportedException ,
" Approximation does not work if result might be infinity. " ) ;
" Approximation does not work if result might be infinity. " ) ;
+ + iteration ;
} while ( ! isApproximationSufficient ( approxResult . first , approxResult . second , approximationError ,
} while ( ! isApproximationSufficient ( approxResult . first , approxResult . second , approximationError ,
probabilityFormula ) ) ;
probabilityFormula ) ) ;
//STORM_LOG_INFO("Finished approximation after " << iteration << " iteration" << (iteration > 1 ? "s." : "."));
//STORM_LOG_INFO("Finished approximation after " << iteration << " iteration" << (iteration > 1 ? "s." : "."));
if ( printInfo ) {
model - > printModelInformationToStream ( std : : cout ) ;
}
dft_results results ;
dft_results results ;
results . push_back ( approxResult ) ;
results . push_back ( approxResult ) ;
return results ;
return results ;