|
@ -127,31 +127,36 @@ namespace storm { |
|
|
next->checkDontCareAnymore(newState, queues); |
|
|
next->checkDontCareAnymore(newState, queues); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
auto it = mStates.find(newState); |
|
|
|
|
|
if (it == mStates.end()) { |
|
|
|
|
|
|
|
|
auto itState = mStates.find(newState); |
|
|
|
|
|
if (itState == mStates.end()) { |
|
|
// New state
|
|
|
// New state
|
|
|
newState.setId(newIndex++); |
|
|
newState.setId(newIndex++); |
|
|
auto itInsert = mStates.insert(newState); |
|
|
auto itInsert = mStates.insert(newState); |
|
|
assert(itInsert.second); |
|
|
assert(itInsert.second); |
|
|
it = itInsert.first; |
|
|
|
|
|
|
|
|
itState = itInsert.first; |
|
|
STORM_LOG_TRACE("New state " << mDft.getStateString(newState)); |
|
|
STORM_LOG_TRACE("New state " << mDft.getStateString(newState)); |
|
|
|
|
|
|
|
|
// Add state to search
|
|
|
// Add state to search
|
|
|
stateQueue.push(newState); |
|
|
stateQueue.push(newState); |
|
|
} else { |
|
|
} else { |
|
|
// State already exists
|
|
|
// State already exists
|
|
|
STORM_LOG_TRACE("State " << mDft.getStateString(*it) << " already exists"); |
|
|
|
|
|
|
|
|
STORM_LOG_TRACE("State " << mDft.getStateString(*itState) << " already exists"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Set transition
|
|
|
|
|
|
ValueType rate = nextBE->activeFailureRate(); |
|
|
|
|
|
auto resultFind = outgoingTransitions.find(it->getId()); |
|
|
|
|
|
|
|
|
// Set failure rate according to usage
|
|
|
|
|
|
bool isUsed = true; |
|
|
|
|
|
if (mDft.hasRepresentant(nextBE->id())) { |
|
|
|
|
|
isUsed = newState.isUsed(nextBE->id()); |
|
|
|
|
|
} |
|
|
|
|
|
STORM_LOG_TRACE("BE " << nextBE->name() << " is " << (isUsed ? "used" : "not used")); |
|
|
|
|
|
ValueType rate = isUsed ? nextBE->activeFailureRate() : nextBE->passiveFailureRate(); |
|
|
|
|
|
auto resultFind = outgoingTransitions.find(itState->getId()); |
|
|
if (resultFind != outgoingTransitions.end()) { |
|
|
if (resultFind != outgoingTransitions.end()) { |
|
|
// Add to existing transition
|
|
|
// Add to existing transition
|
|
|
resultFind->second += rate; |
|
|
resultFind->second += rate; |
|
|
} else { |
|
|
} else { |
|
|
// Insert new transition
|
|
|
// Insert new transition
|
|
|
outgoingTransitions.insert(std::make_pair(it->getId(), rate)); |
|
|
|
|
|
|
|
|
outgoingTransitions.insert(std::make_pair(itState->getId(), rate)); |
|
|
} |
|
|
} |
|
|
sum += rate; |
|
|
sum += rate; |
|
|
} // end while failing BE
|
|
|
} // end while failing BE
|
|
|