Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Player.cpp
Go to the documentation of this file.
2#include <ostream>
3
4namespace storm {
5namespace prism {
6Player::Player(std::string const& playerName, std::unordered_set<std::string> const& controlledModules,
7 std::unordered_set<std::string> const& controlledActions, std::string const& filename, uint_fast32_t lineNumber)
8 : LocatedInformation(filename, lineNumber), playerName(playerName), controlledModules(controlledModules), controlledActions(controlledActions) {
9 // Nothing to do here.
10}
11
12std::string const& Player::getName() const {
13 return this->playerName;
14}
15
16std::unordered_set<std::string> const& Player::getModules() const {
17 return this->controlledModules;
18}
19
20std::unordered_set<std::string> const& Player::getActions() const {
21 return this->controlledActions;
22}
23
24std::ostream& operator<<(std::ostream& stream, Player const& player) {
25 stream << "player";
26 if (player.getName() != "") {
27 stream << " " << player.getName();
28 }
29 bool firstElement = true;
30 for (auto const& module : player.getModules()) {
31 if (firstElement) {
32 firstElement = false;
33 } else {
34 stream << ",";
35 }
36 stream << "\n\t" << module;
37 }
38 for (auto const& action : player.getActions()) {
39 if (firstElement) {
40 firstElement = false;
41 } else {
42 stream << ",";
43 }
44 stream << "\n\t[" << action << "]";
45 }
46 stream << "\nendplayer\n";
47 return stream;
48}
49} // namespace prism
50} // namespace storm
std::unordered_set< std::string > const & getModules() const
Retrieves all controlled Modules of the player.
Definition Player.cpp:16
std::unordered_set< std::string > const & getActions() const
Retrieves all controlled Actions of the player.
Definition Player.cpp:20
std::string const & getName() const
Retrieves the name of the player.
Definition Player.cpp:12
std::ostream & operator<<(std::ostream &stream, Assignment const &assignment)
LabParser.cpp.
Definition cli.cpp:18