Browse Source

Set dependencies to dont care after dependent event has failed

Former-commit-id: 506f5c3107
tempestpy_adaptions
Mavo 9 years ago
parent
commit
bdad8aedd7
  1. 4
      examples/dft/pdep_symmetry.dft
  2. 1
      src/builder/ExplicitDFTModelBuilder.cpp
  3. 26
      src/storage/dft/DFTState.cpp
  4. 8
      src/storage/dft/DFTState.h

4
examples/dft/pdep_symmetry.dft

@ -2,8 +2,8 @@ toplevel "A";
"A" and "B" "B'"; "A" and "B" "B'";
"B" and "C" "D" "PDEP"; "B" and "C" "D" "PDEP";
"B'" and "C'" "D'" "PDEP'"; "B'" and "C'" "D'" "PDEP'";
"PDEP" pdep=0.6 "B" "C";
"PDEP'" pdep=0.6 "B'" "C'";
"PDEP" pdep=0.6 "C" "D";
"PDEP'" pdep=0.6 "C'" "D'";
"C" lambda=0.5 dorm=0; "C" lambda=0.5 dorm=0;
"D" lambda=0.5 dorm=0; "D" lambda=0.5 dorm=0;
"C'" lambda=0.5 dorm=0; "C'" lambda=0.5 dorm=0;

1
src/builder/ExplicitDFTModelBuilder.cpp

@ -227,6 +227,7 @@ namespace storm {
// Update failable dependencies // Update failable dependencies
if (!dftFailed) { if (!dftFailed) {
newState->updateFailableDependencies(nextBE->id()); newState->updateFailableDependencies(nextBE->id());
newState->updateDontCareDependencies(nextBE->id());
} }
uint_fast64_t newStateId; uint_fast64_t newStateId;

26
src/storage/dft/DFTState.cpp

@ -142,14 +142,21 @@ namespace storm {
template<typename ValueType> template<typename ValueType>
void DFTState<ValueType>::setDependencySuccessful(size_t id) { void DFTState<ValueType>::setDependencySuccessful(size_t id) {
// No distinction between successful dependency and no dependency at all
// => we do not set bit
//mStatus.set(mStateGenerationInfo.mIdToStateIndex(id));
// Only distinguish between passive and dont care dependencies
//mStatus.set(mStateGenerationInfo.getStateIndex(id));
setDependencyDontCare(id);
} }
template<typename ValueType> template<typename ValueType>
void DFTState<ValueType>::setDependencyUnsuccessful(size_t id) { void DFTState<ValueType>::setDependencyUnsuccessful(size_t id) {
mStatus.set(mStateGenerationInfo.getStateIndex(id)+1);
// Only distinguish between passive and dont care dependencies
//mStatus.set(mStateGenerationInfo.getStateIndex(id)+1);
setDependencyDontCare(id);
}
template<typename ValueType>
void DFTState<ValueType>::setDependencyDontCare(size_t id) {
mStatus.setFromInt(mStateGenerationInfo.getStateIndex(id), 2, static_cast<uint_fast64_t>(DFTDependencyState::DontCare));
} }
template<typename ValueType> template<typename ValueType>
@ -177,6 +184,17 @@ namespace storm {
return nrFailableDependencies() > 0; return nrFailableDependencies() > 0;
} }
template<typename ValueType>
void DFTState<ValueType>::updateDontCareDependencies(size_t id) {
assert(mDft.isBasicElement(id));
assert(hasFailed(id));
for (auto dependency : mDft.getBasicElement(id)->ingoingDependencies()) {
assert(dependency->dependentEvent()->id() == id);
setDependencyDontCare(dependency->id());
}
}
template<typename ValueType> template<typename ValueType>
std::pair<std::shared_ptr<DFTBE<ValueType> const>, bool> DFTState<ValueType>::letNextBEFail(size_t index) std::pair<std::shared_ptr<DFTBE<ValueType> const>, bool> DFTState<ValueType>::letNextBEFail(size_t index)
{ {

8
src/storage/dft/DFTState.h

@ -79,6 +79,8 @@ namespace storm {
void setDependencyUnsuccessful(size_t id); void setDependencyUnsuccessful(size_t id);
void setDependencyDontCare(size_t id);
void beNoLongerFailable(size_t id); void beNoLongerFailable(size_t id);
void activate(size_t repr); void activate(size_t repr);
@ -163,6 +165,12 @@ namespace storm {
*/ */
bool updateFailableDependencies(size_t id); bool updateFailableDependencies(size_t id);
/**
* Sets all dependencies dont care whose dependent event is the newly failed BE.
* @param id Id of the newly failed element
*/
void updateDontCareDependencies(size_t id);
/** /**
* Sets the next BE as failed * Sets the next BE as failed
* @param index Index in currentlyFailableBE of BE to fail * @param index Index in currentlyFailableBE of BE to fail

Loading…
Cancel
Save