Browse Source
Bounds & co for pgcl.
Bounds & co for pgcl.
Former-commit-id:tempestpy_adaptions24797ada48
[formerly8ec467baf1
] Former-commit-id:75260b0b73
sjunges
8 years ago
7 changed files with 127 additions and 44 deletions
-
48src/builder/JaniProgramGraphBuilder.cpp
-
59src/builder/JaniProgramGraphBuilder.h
-
2src/settings/modules/PGCLSettings.cpp
-
28src/storage/IntegerInterval.cpp
-
1src/storage/IntegerInterval.h
-
28src/storage/ppg/ProgramGraph.h
-
5src/storm-pgcl.cpp
@ -1,2 +1,30 @@ |
|||
#include "IntegerInterval.h"
|
|||
|
|||
#include <iostream>
|
|||
#include <string>
|
|||
|
|||
#include "src/utility/macros.h"
|
|||
#include "src/exceptions/InvalidArgumentException.h"
|
|||
|
|||
bool starts_with(const std::string& s1, const std::string& s2) { |
|||
return s2.size() <= s1.size() && s1.compare(0, s2.size(), s2) == 0; |
|||
} |
|||
|
|||
namespace storm { |
|||
namespace storage { |
|||
IntegerInterval parseIntegerInterval(std::string const& stringRepr) { |
|||
|
|||
|
|||
if(starts_with(stringRepr, "[") && stringRepr.at(stringRepr.size()-1) == ']') { |
|||
auto split = stringRepr.find(","); |
|||
std::string first = stringRepr.substr(1,split-1); |
|||
|
|||
std::string second = stringRepr.substr(split+1, stringRepr.size() - split - 2); |
|||
return IntegerInterval(stoi(first), stoi(second)); |
|||
|
|||
} else { |
|||
STORM_LOG_THROW(false, storm::exceptions::InvalidArgumentException, "Cannot parse " << stringRepr << " as integer interval"); |
|||
} |
|||
} |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue