Browse Source
store tuples of player name and index
store tuples of player name and index
Store this instead of only the index. Needed for easier parsing of the rpatl formulas (prism allows player indices and names!)tempestpy_adaptions
Stefan Pranger
4 years ago
6 changed files with 97 additions and 40 deletions
-
56src/storm/generator/Choice.cpp
-
18src/storm/generator/Choice.h
-
25src/storm/logic/Coalition.cpp
-
32src/storm/logic/Coalition.h
-
2src/storm/modelchecker/helper/infinitehorizon/SparseNondeterministicGameInfiniteHorizonHelper.cpp
-
4src/storm/modelchecker/helper/infinitehorizon/SparseNondeterministicGameInfiniteHorizonHelper.h
@ -0,0 +1,25 @@ |
|||
#include "storm/logic/Coalition.h"
|
|||
|
|||
namespace storm { |
|||
namespace logic { |
|||
|
|||
Coalition::Coalition(std::vector<boost::variant<std::string, uint_fast64_t>> playerIds) : playerIds(playerIds) { |
|||
// Intentionally left empty.
|
|||
} |
|||
|
|||
std::vector<boost::variant<std::string, uint_fast64_t>> Coalition::getPlayerIds() const { |
|||
return playerIds; |
|||
} |
|||
|
|||
std::ostream& operator<<(std::ostream& stream, Coalition const& coalition) { |
|||
bool firstItem = true; |
|||
stream << "<<"; |
|||
for (auto const& id : coalition.playerIds) { |
|||
if(firstItem) { firstItem = false; } else { stream << ","; } |
|||
stream << id; |
|||
} |
|||
stream << ">> "; |
|||
return stream; |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,32 @@ |
|||
#ifndef STORM_LOGIC_COALITION_H_ |
|||
#define STORM_LOGIC_COALITION_H_ |
|||
|
|||
#include <vector> |
|||
#include <string> |
|||
|
|||
#include <boost/optional.hpp> |
|||
#include <boost/variant.hpp> |
|||
#include "storm/storage/BoostTypes.h" |
|||
#include "storm/utility/OsDetection.h" |
|||
|
|||
namespace storm { |
|||
namespace logic { |
|||
|
|||
class Coalition { |
|||
public: |
|||
Coalition() = default; |
|||
Coalition(std::vector<boost::variant<std::string, uint_fast64_t>>); |
|||
Coalition(Coalition const& other) = default; |
|||
|
|||
std::vector<boost::variant<std::string, uint_fast64_t>> getPlayerIds() const; |
|||
|
|||
friend std::ostream& operator<<(std::ostream& stream, Coalition const& coalition); |
|||
|
|||
private: |
|||
std::vector<boost::variant<std::string, uint_fast64_t>> playerIds; |
|||
}; |
|||
} |
|||
} |
|||
|
|||
|
|||
#endif /* STORM_LOGIC_COALITION_H_ */ |
Write
Preview
Loading…
Cancel
Save
Reference in new issue