3#include <boost/algorithm/string.hpp>
26 gspn.writeDotToStream(fs);
52 std::cout <<
"============GSPN Statistics==============\n";
53 gspn.writeStatsToStream(std::cout);
54 std::cout <<
"=========================================\n";
60 gspn.writeStatsToStream(fs);
71 auto properties = janiProperyGetter(
builder);
73 auto deadlockProperties =
builder.getDeadlockProperties(model);
74 properties.insert(properties.end(), deadlockProperties.begin(), deadlockProperties.end());
86 std::unordered_map<std::string, storm::expressions::Expression> identifierMapping;
87 for (
auto const& var :
gspn.getExpressionManager()->getVariables()) {
88 identifierMapping.emplace(var.getName(), var.getExpression());
93 std::unordered_map<std::string, uint64_t> map;
100 std::vector<std::string> strs;
101 boost::split(strs, line, boost::is_any_of(
"\t "));
102 STORM_LOG_THROW(strs.size() == 2, storm::exceptions::WrongFormatException,
"Expect key value pairs");
104 if (!
gspn.getConstantsSubstitution().empty()) {
108 "The capacity expression '" << strs[1] <<
"' still contains undefined constants.");
int_fast64_t evaluateAsInt(Valuation const *valuation=nullptr) const
Evaluates the expression under the valuation of variables given by the valuation and returns the resu...
bool containsVariables() const
Retrieves whether the expression contains a variable.
Expression substitute(std::map< Variable, Expression > const &variableToExpressionMap) const
Substitutes all occurrences of the variables according to the given map.
storm::expressions::Expression parseFromString(std::string const &expressionString, bool ignoreError=false) const
Parses an expression from the given string.
void setIdentifierMapping(qi::symbols< char, storm::expressions::Expression > const *identifiers_)
Sets an identifier mapping that is used to determine valid variables in the expression.
void setAcceptDoubleLiterals(bool flag)
Sets whether double literals are to be accepted or not.
bool isWriteToPnmlSet() const
bool isDisplayStatsSet() const
bool isWriteToPnproSet() const
std::string getWriteToPnmlFilename() const
std::string getWriteToJsonFilename() const
bool isWriteToJaniSet() const
std::string getWriteToPnproFilename() const
bool isAddJaniPropertiesSet() const
Returns whether a set of standard properties is to be added when exporting to jani.
std::string getWriteToDotFilename() const
Retrieves the dot file name.
bool isWriteToDotSet() const
Retrieve whether the to dot option was set.
bool isWriteToJsonSet() const
std::string getWriteStatsFilename() const
bool isWriteStatsToFileSet() const
std::string getWriteToJaniFilename() const
#define STORM_LOG_THROW(cond, exception, message)
void exportJaniToFile(storm::jani::Model const &model, std::vector< storm::jani::Property > const &properties, std::string const &filename, bool compact)
void handleGSPNExportSettings(storm::gspn::GSPN const &gspn, std::function< std::vector< storm::jani::Property >(storm::builder::JaniGSPNBuilder const &)> const &janiProperyGetter)
void transformJani(storm::jani::Model &janiModel, std::vector< storm::jani::Property > &properties, storm::converter::JaniConversionOptions const &options)
storm::jani::Model * buildJani(storm::gspn::GSPN const &gspn)
Builds JANI model from GSPN.
std::unordered_map< std::string, uint64_t > parseCapacitiesList(std::string const &filename, storm::gspn::GSPN const &gspn)
std::basic_istream< CharT, Traits > & getline(std::basic_istream< CharT, Traits > &input, std::basic_string< CharT, Traits, Allocator > &str)
Overloaded getline function which handles different types of newline ( and \r).
void closeFile(std::ofstream &stream)
Close the given file after writing.
void openFile(std::string const &filepath, std::ofstream &filestream, bool append=false, bool silent=false)
Open the given file for writing.
SettingsType const & getModule()
Get module.