Browse Source

Deterministic Building for DFTs

Former-commit-id: bb669a034e
tempestpy_adaptions
sjunges 9 years ago
parent
commit
ca77078a9c
  1. 4
      src/storage/dft/DFTBuilder.cpp
  2. 2
      src/storage/dft/DFTBuilder.h

4
src/storage/dft/DFTBuilder.cpp

@ -123,7 +123,7 @@ namespace storm {
}
template<typename ValueType>
void DFTBuilder<ValueType>::topoVisit(DFTElementPointer const& n, std::map<DFTElementPointer, topoSortColour>& visited, DFTElementVector& L) {
void DFTBuilder<ValueType>::topoVisit(DFTElementPointer const& n, std::map<DFTElementPointer, topoSortColour, OrderElementsById<ValueType>>& visited, DFTElementVector& L) {
if(visited[n] == topoSortColour::GREY) {
throw storm::exceptions::WrongFormatException("DFT is cyclic");
} else if(visited[n] == topoSortColour::WHITE) {
@ -141,7 +141,7 @@ namespace storm {
// TODO Matthias: use typedefs
template<typename ValueType>
std::vector<std::shared_ptr<DFTElement<ValueType>>> DFTBuilder<ValueType>::topoSort() {
std::map<DFTElementPointer, topoSortColour> visited;
std::map<DFTElementPointer, topoSortColour, OrderElementsById<ValueType>> visited;
for(auto const& e : mElements) {
visited.insert(std::make_pair(e.second, topoSortColour::WHITE));
}

2
src/storage/dft/DFTBuilder.h

@ -141,7 +141,7 @@ namespace storm {
enum class topoSortColour {WHITE, BLACK, GREY};
void topoVisit(DFTElementPointer const& n, std::map<DFTElementPointer, topoSortColour>& visited, DFTElementVector& L);
void topoVisit(DFTElementPointer const& n, std::map<DFTElementPointer, topoSortColour, OrderElementsById<ValueType>>& visited, DFTElementVector& L);
DFTElementVector topoSort();

Loading…
Cancel
Save