16 std::string
const& fileName, std::set<VariableType>
const& consideredVariables) {
18 std::ifstream inputFileStream;
21 std::set<VariableType> monotoneIncrVars;
22 std::set<VariableType> monotoneDecrVars;
26 std::string fileContent((std::istreambuf_iterator<char>(inputFileStream)), (std::istreambuf_iterator<char>()));
27 std::vector<std::string> fileSplitted;
29 boost::split(fileSplitted, fileContent, boost::is_any_of(
";"));
30 STORM_LOG_THROW(fileSplitted.size() == 2, storm::exceptions::WrongFormatException,
"Expecting content to contain \";\" between monotone variables");
31 std::vector<std::string> monotoneIncrVarsString;
32 boost::split(monotoneIncrVarsString, fileSplitted[0], boost::is_any_of(
" "));
33 std::vector<std::string> monotoneDecrVarsString;
34 boost::split(monotoneDecrVarsString, fileSplitted[0], boost::is_any_of(
" "));
36 for (
auto varString : monotoneIncrVarsString) {
38 for (
auto const& v : consideredVariables) {
39 std::stringstream stream;
41 if (varString == stream.str()) {
46 monotoneIncrVars.insert(var);
48 for (
auto varString : monotoneDecrVarsString) {
50 for (
auto const& v : consideredVariables) {
51 std::stringstream stream;
53 if (varString == stream.str()) {
58 monotoneDecrVars.insert(var);
61 }
catch (std::exception& e) {
69 return {std::move(monotoneIncrVars), std::move(monotoneDecrVars)};
void openFile(std::string const &filepath, std::ofstream &filestream, bool append=false, bool silent=false)
Open the given file for writing.