Browse Source

build n-ary pdeps for transformation

tempestpy_adaptions
Sebastian Junges 8 years ago
parent
commit
87b6182ea3
  1. 2
      src/storm-dft-cli/storm-dyftee.cpp
  2. 2
      src/storm-dft/parser/DFTGalileoParser.h
  3. 8
      src/storm-dft/storage/dft/DFTBuilder.cpp
  4. 7
      src/storm-dft/storage/dft/DFTBuilder.h
  5. 4
      src/storm-dft/storage/dft/elements/DFTDependency.h

2
src/storm-dft-cli/storm-dyftee.cpp

@ -136,7 +136,7 @@ int main(const int argc, const char** argv) {
storm::parser::DFTJsonParser<double> parser;
dft = std::make_shared<storm::storage::DFT<double>>(parser.parseJson(dftSettings.getDftJsonFilename()));
} else {
storm::parser::DFTGalileoParser<double> parser;
storm::parser::DFTGalileoParser<double> parser(true, false);
dft = std::make_shared<storm::storage::DFT<double>>(parser.parseDFT(dftSettings.getDftFilename()));
}
storm::transformations::dft::DftToGspnTransformator<double> gspnTransformator(*dft);

2
src/storm-dft/parser/DFTGalileoParser.h

@ -26,7 +26,7 @@ namespace storm {
std::unordered_map<std::string, storm::expressions::Expression> identifierMapping;
public:
DFTGalileoParser(bool defaultInclusive = true) : builder(defaultInclusive), manager(new storm::expressions::ExpressionManager()), parser(*manager), evaluator(*manager) {
DFTGalileoParser(bool defaultInclusive = true, bool binaryDependencies = true) : builder(defaultInclusive, binaryDependencies), manager(new storm::expressions::ExpressionManager()), parser(*manager), evaluator(*manager) {
}
storm::storage::DFT<ValueType> parseDFT(std::string const& filename);

8
src/storm-dft/storage/dft/DFTBuilder.cpp

@ -70,9 +70,11 @@ namespace storm {
if (binaryDependencies) {
assert(dependencies.size() == 1);
}
assert(binaryDependencies);
elem.first->setDependentEvent(dependencies[0]);
dependencies[0]->addIngoingDependency(elem.first);
elem.first->setDependentEvents(dependencies);
for (auto& dependency : dependencies) {
dependency->addIngoingDependency(elem.first);
}
}

7
src/storm-dft/storage/dft/DFTBuilder.h

@ -37,7 +37,7 @@ namespace storm {
std::unordered_map<std::string, DFTLayoutInfo> mLayoutInfo;
public:
DFTBuilder(bool defaultInclusive = true) : pandDefaultInclusive(defaultInclusive), porDefaultInclusive(defaultInclusive) {
DFTBuilder(bool defaultInclusive = true, bool binaryDependencies = true) : pandDefaultInclusive(defaultInclusive), porDefaultInclusive(defaultInclusive), binaryDependencies(binaryDependencies) {
}
@ -133,7 +133,10 @@ namespace storm {
mDependencies.push_back(element);
}
} else {
DFTDependencyPointer element = std::make_shared<DFTDependency<ValueType>>(mNextId++, name, probability);
mElements[element->name()] = element;
mDependencyChildNames[element] = children;
mDependencies.push_back(element);
}
return true;
}

4
src/storm-dft/storage/dft/elements/DFTDependency.h

@ -29,8 +29,8 @@ namespace storm {
}
void setDependentEvent(DFTBEPointer const& dependentEvent) {
mDependentEvents = { dependentEvent };
void setDependentEvents(std::vector<DFTBEPointer> const& dependentEvents) {
mDependentEvents = dependentEvents;
}

Loading…
Cancel
Save