-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
352 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "ImportanceFunction.h" | ||
|
||
namespace storm::dft { | ||
namespace simulator { | ||
|
||
template<typename ValueType> | ||
ImportanceFunction<ValueType>::ImportanceFunction(storm::dft::storage::DFT<ValueType> const& dft) : dft(dft) {} | ||
|
||
template<typename ValueType> | ||
BECountImportanceFunction<ValueType>::BECountImportanceFunction(storm::dft::storage::DFT<ValueType> const& dft) : ImportanceFunction<ValueType>(dft) {} | ||
|
||
template<typename ValueType> | ||
double BECountImportanceFunction<ValueType>::getImportance(typename ImportanceFunction<ValueType>::DFTStatePointer state) const { | ||
size_t count = 0; | ||
for (auto be : this->dft.getBasicElements()) { | ||
if (state->hasFailed(be->id())) { | ||
++count; | ||
} | ||
} | ||
return count; | ||
} | ||
|
||
template<typename ValueType> | ||
std::pair<double, double> BECountImportanceFunction<ValueType>::getImportanceRange() const { | ||
return std::make_pair(0, this->dft.nrBasicElements()); | ||
} | ||
|
||
template class BECountImportanceFunction<double>; | ||
template class BECountImportanceFunction<storm::RationalFunction>; | ||
|
||
} // namespace simulator | ||
} // namespace storm::dft |
Oops, something went wrong.