Browse Source

Merge pull request 'Fix Output of Player Coalitions' (#12) from fix_coalition_outstream into main

Reviewed-on: http://git.pranger.xyz/TEMPEST/tempest-devel/pulls/12
tempestpy_adaptions
Stefan Pranger 4 years ago
parent
commit
8901f9c88c
  1. 18
      src/storm/logic/PlayerCoalition.cpp

18
src/storm/logic/PlayerCoalition.cpp

@ -13,13 +13,17 @@ namespace storm {
return _playerIds; return _playerIds;
} }
std::ostream& operator<<(std::ostream& stream, PlayerCoalition const& coalition) {
//bool firstItem = true;
//for (auto const& id : coalition._playerIds) {
// //if(firstItem) { firstItem = false; } else { stream << ","; }
// stream << id;
//}
return stream;
std::ostream& operator<<(std::ostream& out, PlayerCoalition const& coalition) {
bool firstItem = true;
for (auto const& player : coalition._playerIds) {
if(firstItem) { firstItem = false; } else { out << ","; }
if (player.type() == typeid(std::string)) {
out << boost::get<std::string>(player);
} else {
out << boost::get<storm::storage::PlayerIndex>(player);
}
}
return out;
} }
} }
} }
Loading…
Cancel
Save