Browse Source

gspn transformation related changes

tempestpy_adaptions
Sebastian Junges 8 years ago
parent
commit
b9e46cf8c1
  1. 7
      src/storm-dft-cli/storm-dyftee.cpp
  2. 20
      src/storm-dft/transformations/DftToGspnTransformator.cpp
  3. 8
      src/storm-dft/transformations/DftToGspnTransformator.h
  4. 2
      src/storm-gspn/storage/gspn/GspnBuilder.cpp

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

@ -77,11 +77,12 @@ void analyzeWithSMT(std::string filename) {
*
*/
template <typename ValueType>
storm::gspn::GSPN transformDFT(std::string filename) {
storm::gspn::GSPN* transformDFT(std::string filename) {
storm::parser::DFTGalileoParser<ValueType> parser;
storm::storage::DFT<ValueType> dft = parser.parseDFT(filename);
storm::transformations::dft::DftToGspnTransformator<ValueType> gspnTransformator(dft);
gspnTransformator.transform();
return gspnTransformator.obtainGSPN();
}
/*!
@ -138,9 +139,9 @@ int main(const int argc, const char** argv) {
}
if (dftSettings.isTransformToGspn()) {
// For now we only transform the DFT to a GSPN and then exit
transformDFT<double>(dftSettings.getDftFilename());
storm::gspn::GSPN* gspn = transformDFT<double>(dftSettings.getDftFilename());
delete gspn;
storm::utility::cleanUp();
return 0;
}

20
src/storm-dft/transformations/DftToGspnTransformator.cpp

@ -25,9 +25,6 @@ namespace storm {
// Draw restrictions into the GSPN (i.e. SEQ or MUTEX).
//drawGSPNRestrictions();
// Write GSPN to file.
writeGspn(true);
}
template <typename ValueType>
@ -457,21 +454,8 @@ namespace storm {
}
template <typename ValueType>
void DftToGspnTransformator<ValueType>::writeGspn(bool toFile) {
if (toFile) {
// Writing to file
std::ofstream file;
file.open("gspn.dot");
storm::gspn::GSPN* gspn = builder.buildGspn();
gspn->writeDotToStream(file);
delete gspn;
file.close();
} else {
// Writing to console
storm::gspn::GSPN* gspn = builder.buildGspn();
gspn->writeDotToStream(std::cout);
delete gspn;
}
gspn::GSPN* DftToGspnTransformator<ValueType>::obtainGSPN() {
return builder.buildGspn();
}
// Explicitly instantiate the class.

8
src/storm-dft/transformations/DftToGspnTransformator.h

@ -27,15 +27,13 @@ namespace storm {
*/
void transform();
private:
/*!
* Write Gspn to file or console.
* Extract Gspn by building
*
* @param toFile If true, the GSPN will be written to a file, otherwise it will
be written to the console.
*/
void writeGspn(bool toFile);
gspn::GSPN* obtainGSPN();
private:
/*
* Draw all elements of the GSPN.
*/

2
src/storm-gspn/storage/gspn/GspnBuilder.cpp

@ -35,7 +35,7 @@ namespace storm {
if(partitions.count(priority) == 0) {
TransitionPartition newPart;
newPart.priority = priority;
partitions.at(priority).push_back(newPart);
partitions[priority].push_back(newPart);
}
if(storm::utility::isZero(weight)) {

Loading…
Cancel
Save