|
|
@ -16,9 +16,10 @@ namespace storm { |
|
|
|
} |
|
|
|
|
|
|
|
template<typename ValueType> |
|
|
|
void DftToGspnTransformator<ValueType>::transform(std::set<uint64_t> const& dontCareElements, bool smart) { |
|
|
|
void DftToGspnTransformator<ValueType>::transform(std::set<uint64_t> const &dontCareElements, bool smart, bool mergeDCFailed) { |
|
|
|
this->dontCareElements = dontCareElements; |
|
|
|
this->smart = smart; |
|
|
|
this->mergedDCFailed = mergeDCFailed; |
|
|
|
builder.setGspnName("DftToGspnTransformation"); |
|
|
|
|
|
|
|
// Translate all GSPN elements
|
|
|
@ -66,10 +67,12 @@ namespace storm { |
|
|
|
translateVOT(std::static_pointer_cast<storm::storage::DFTVot<ValueType> const>(dftElement)); |
|
|
|
break; |
|
|
|
case storm::storage::DFTElementType::PAND: |
|
|
|
translatePAND(std::static_pointer_cast<storm::storage::DFTPand<ValueType> const>(dftElement), std::static_pointer_cast<storm::storage::DFTPand<ValueType> const>(dftElement)->isInclusive()); |
|
|
|
translatePAND(std::static_pointer_cast<storm::storage::DFTPand<ValueType> const>(dftElement), |
|
|
|
std::static_pointer_cast<storm::storage::DFTPand<ValueType> const>(dftElement)->isInclusive()); |
|
|
|
break; |
|
|
|
case storm::storage::DFTElementType::POR: |
|
|
|
translatePOR(std::static_pointer_cast<storm::storage::DFTPor<ValueType> const>(dftElement), std::static_pointer_cast<storm::storage::DFTPor<ValueType> const>(dftElement)->isInclusive()); |
|
|
|
translatePOR(std::static_pointer_cast<storm::storage::DFTPor<ValueType> const>(dftElement), |
|
|
|
std::static_pointer_cast<storm::storage::DFTPor<ValueType> const>(dftElement)->isInclusive()); |
|
|
|
break; |
|
|
|
case storm::storage::DFTElementType::SPARE: |
|
|
|
translateSPARE(std::static_pointer_cast<storm::storage::DFTSpare<ValueType> const>(dftElement)); |
|
|
@ -542,7 +545,9 @@ namespace storm { |
|
|
|
} |
|
|
|
|
|
|
|
template<typename ValueType> |
|
|
|
uint64_t DftToGspnTransformator<ValueType>::addFailedPlace(std::shared_ptr<storm::storage::DFTElement<ValueType> const> dftElement, storm::gspn::LayoutInfo const& layoutInfo, bool initialFailed) { |
|
|
|
uint64_t |
|
|
|
DftToGspnTransformator<ValueType>::addFailedPlace(std::shared_ptr<storm::storage::DFTElement<ValueType> const> dftElement, storm::gspn::LayoutInfo const &layoutInfo, |
|
|
|
bool initialFailed) { |
|
|
|
uint64_t failedPlace = builder.addPlace(defaultCapacity, initialFailed ? 1 : 0, dftElement->name() + STR_FAILED); |
|
|
|
assert(failedPlaces.size() == dftElement->id()); |
|
|
|
failedPlaces.push_back(failedPlace); |
|
|
@ -552,7 +557,8 @@ namespace storm { |
|
|
|
|
|
|
|
|
|
|
|
template<typename ValueType> |
|
|
|
uint64_t DftToGspnTransformator<ValueType>::addUnavailablePlace(std::shared_ptr<storm::storage::DFTElement<ValueType> const> dftElement, storm::gspn::LayoutInfo const& layoutInfo, bool initialAvailable) { |
|
|
|
uint64_t DftToGspnTransformator<ValueType>::addUnavailablePlace(std::shared_ptr<storm::storage::DFTElement<ValueType> const> dftElement, |
|
|
|
storm::gspn::LayoutInfo const &layoutInfo, bool initialAvailable) { |
|
|
|
uint64_t unavailablePlace = builder.addPlace(defaultCapacity, initialAvailable ? 0 : 1, dftElement->name() + "_unavail"); |
|
|
|
unavailablePlaces.emplace(dftElement->id(), unavailablePlace); |
|
|
|
builder.setPlaceLayoutInfo(unavailablePlace, layoutInfo); |
|
|
@ -560,7 +566,8 @@ namespace storm { |
|
|
|
} |
|
|
|
|
|
|
|
template<typename ValueType> |
|
|
|
uint64_t DftToGspnTransformator<ValueType>::addDisabledPlace(std::shared_ptr<const storm::storage::DFTBE<ValueType> > dftBe, storm::gspn::LayoutInfo const& layoutInfo) { |
|
|
|
uint64_t |
|
|
|
DftToGspnTransformator<ValueType>::addDisabledPlace(std::shared_ptr<const storm::storage::DFTBE<ValueType> > dftBe, storm::gspn::LayoutInfo const &layoutInfo) { |
|
|
|
uint64_t disabledPlace = builder.addPlace(dftBe->nrRestrictions(), dftBe->nrRestrictions(), dftBe->name() + "_dabled"); |
|
|
|
disabledPlaces.emplace(dftBe->id(), disabledPlace); |
|
|
|
builder.setPlaceLayoutInfo(disabledPlace, layoutInfo); |
|
|
@ -574,8 +581,7 @@ namespace storm { |
|
|
|
} |
|
|
|
|
|
|
|
template<typename ValueType> |
|
|
|
uint64_t DftToGspnTransformator<ValueType>::getFailPriority(std::shared_ptr<storm::storage::DFTElement<ValueType> const> dftElement) |
|
|
|
{ |
|
|
|
uint64_t DftToGspnTransformator<ValueType>::getFailPriority(std::shared_ptr<storm::storage::DFTElement<ValueType> const> dftElement) { |
|
|
|
// Temporariliy use one priority for all
|
|
|
|
return defaultPriority; |
|
|
|
//return mDft.maxRank() - dftElement->rank() + 2;
|
|
|
@ -583,7 +589,8 @@ namespace storm { |
|
|
|
|
|
|
|
|
|
|
|
// Explicitly instantiate the class.
|
|
|
|
template class DftToGspnTransformator<double>; |
|
|
|
template |
|
|
|
class DftToGspnTransformator<double>; |
|
|
|
|
|
|
|
#ifdef STORM_HAVE_CARL
|
|
|
|
// template class DftToGspnTransformator<storm::RationalFunction>;
|
|
|
|