Browse Source
fix in getPlace; add capacities, GSPN settings and main file updated
fix in getPlace; add capacities, GSPN settings and main file updated
Former-commit-id: 375172b3075605a2c732fde6ca1346675cbb8a40 [formerly b8c1466633712c2afef4c5bbcbec3eb59142ac4a] Former-commit-id: efaeb8b23872d710d16b6ec12637c8e3ffafc093tempestpy_adaptions
sjunges
8 years ago
11 changed files with 289 additions and 146 deletions
-
5src/builder/JaniGSPNBuilder.h
-
12src/parser/GspnParser.cpp
-
68src/settings/modules/GSPNSettings.cpp
-
59src/settings/modules/GSPNSettings.h
-
45src/storage/gspn/GSPN.cpp
-
21src/storage/gspn/GSPN.h
-
6src/storage/gspn/GspnBuilder.cpp
-
14src/storage/gspn/Place.cpp
-
14src/storage/gspn/Place.h
-
2src/storage/gspn/Transition.cpp
-
189src/storm-gspn.cpp
@ -0,0 +1,68 @@ |
|||
#include "GSPNSettings.h"
|
|||
|
|||
#include "src/settings/SettingsManager.h"
|
|||
#include "src/settings/SettingMemento.h"
|
|||
#include "src/settings/Option.h"
|
|||
#include "src/settings/OptionBuilder.h"
|
|||
#include "src/settings/ArgumentBuilder.h"
|
|||
#include "src/settings/Argument.h"
|
|||
|
|||
#include "src/exceptions/InvalidSettingsException.h"
|
|||
|
|||
namespace storm { |
|||
namespace settings { |
|||
namespace modules { |
|||
const std::string GSPNSettings::moduleName = "gspn"; |
|||
|
|||
const std::string GSPNSettings::gspnFileOptionName = "gspnfile"; |
|||
const std::string GSPNSettings::gspnFileOptionShortName = "gspn"; |
|||
const std::string GSPNSettings::gspnToJaniOptionName = "to-jani"; |
|||
const std::string GSPNSettings::gspnToJaniOptionShortName = "tj"; |
|||
const std::string GSPNSettings::capacitiesFileOptionName = "capacitiesfile"; |
|||
const std::string GSPNSettings::capacitiesFileOptionShortName = "capacities"; |
|||
|
|||
|
|||
GSPNSettings::GSPNSettings() : ModuleSettings(moduleName) { |
|||
this->addOption(storm::settings::OptionBuilder(moduleName, gspnFileOptionName, false, "Parses the pgcl program.").setShortName(gspnFileOptionShortName).addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "path to file").addValidationFunctionString(storm::settings::ArgumentValidators::existingReadableFileValidator()).build()).build()); |
|||
this->addOption(storm::settings::OptionBuilder(moduleName, gspnToJaniOptionName, false, "Transform to JANI.").setShortName(gspnToJaniOptionShortName).build()); |
|||
this->addOption(storm::settings::OptionBuilder(moduleName, capacitiesFileOptionName, false, "Restrictions of program variables").setShortName(capacitiesFileOptionShortName).addArgument(storm::settings::ArgumentBuilder::createStringArgument("filename", "path to file").addValidationFunctionString(storm::settings::ArgumentValidators::existingReadableFileValidator()).build()).build()); |
|||
} |
|||
|
|||
bool GSPNSettings::isGspnFileSet() const { |
|||
return this->getOption(gspnFileOptionName).getHasOptionBeenSet(); |
|||
} |
|||
|
|||
std::string GSPNSettings::getGspnFilename() const { |
|||
return this->getOption(gspnFileOptionName).getArgumentByName("filename").getValueAsString(); |
|||
} |
|||
|
|||
bool GSPNSettings::isToJaniSet() const { |
|||
return this->getOption(gspnToJaniOptionName).getHasOptionBeenSet(); |
|||
} |
|||
|
|||
bool GSPNSettings::isCapacitiesFileSet() const { |
|||
return this->getOption(capacitiesFileOptionName).getHasOptionBeenSet(); |
|||
} |
|||
|
|||
std::string GSPNSettings::getCapacitiesFilename() const { |
|||
return this->getOption(capacitiesFileOptionName).getArgumentByName("filename").getValueAsString(); |
|||
} |
|||
|
|||
void GSPNSettings::finalize() { |
|||
|
|||
} |
|||
|
|||
bool GSPNSettings::check() const { |
|||
if(!isGspnFileSet()) { |
|||
if(isToJaniSet()) { |
|||
return false; |
|||
} |
|||
if(isCapacitiesFileSet()) { |
|||
return false; |
|||
} |
|||
} |
|||
return true; |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,59 @@ |
|||
#pragma once |
|||
|
|||
#include "storm-config.h" |
|||
#include "src/settings/modules/ModuleSettings.h" |
|||
|
|||
|
|||
namespace storm { |
|||
namespace settings { |
|||
namespace modules { |
|||
class GSPNSettings : public ModuleSettings { |
|||
public: |
|||
/*! |
|||
* Creates a new PGCL setting |
|||
*/ |
|||
GSPNSettings(); |
|||
|
|||
/** |
|||
* Retrievew whether the pgcl file option was set |
|||
*/ |
|||
bool isGspnFileSet() const; |
|||
|
|||
/** |
|||
* Retrieves the gspn file name |
|||
*/ |
|||
std::string getGspnFilename() const; |
|||
|
|||
/** |
|||
* Whether the gspn should be transformed to Jani |
|||
*/ |
|||
bool isToJaniSet() const; |
|||
|
|||
/** |
|||
* Retrievew whether the pgcl file option was set |
|||
*/ |
|||
bool isCapacitiesFileSet() const; |
|||
|
|||
/** |
|||
* Retrieves the gspn file name |
|||
*/ |
|||
std::string getCapacitiesFilename() const; |
|||
|
|||
|
|||
bool check() const override; |
|||
void finalize() override; |
|||
|
|||
static const std::string moduleName; |
|||
|
|||
private: |
|||
static const std::string gspnFileOptionName; |
|||
static const std::string gspnFileOptionShortName; |
|||
static const std::string gspnToJaniOptionName; |
|||
static const std::string gspnToJaniOptionShortName; |
|||
static const std::string capacitiesFileOptionName; |
|||
static const std::string capacitiesFileOptionShortName; |
|||
|
|||
}; |
|||
} |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue