3#include <boost/algorithm/string.hpp>
17 return builder.
build();
52 std::cout <<
"============GSPN Statistics==============\n";
54 std::cout <<
"=========================================\n";
71 auto properties = janiProperyGetter(builder);
74 properties.insert(properties.end(), deadlockProperties.begin(), deadlockProperties.end());
86 std::unordered_map<std::string, storm::expressions::Expression> identifierMapping;
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");
108 "The capacity expression '" << strs[1] <<
"' still contains undefined constants.");
storm::jani::Model * build(std::string const &automatonName="gspn_automaton")
std::vector< storm::jani::Property > getDeadlockProperties(storm::jani::Model *model)
Get standard properties (reachability, time bounded reachability, expected time) for deadlocks.
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.
void toPnml(std::ostream &stream) const
void toJson(std::ostream &stream) const
Export GSPN in Json format.
std::map< storm::expressions::Variable, storm::expressions::Expression > const & getConstantsSubstitution() const
Gets an assignment of occurring constants of the GSPN to their value.
void writeStatsToStream(std::ostream &stream) const
void toPnpro(std::ostream &stream) const
std::shared_ptr< storm::expressions::ExpressionManager > const & getExpressionManager() const
Obtain the expression manager used for expressions over GSPNs.
void writeDotToStream(std::ostream &outStream) const
Write the gspn in a dot(graphviz) configuration.
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.