#include "src/generator/Choice.h" #include "src/adapters/CarlAdapter.h" #include "src/utility/constants.h" namespace storm { namespace generator { template Choice::Choice(uint_fast64_t actionIndex, bool markovian) : markovian(markovian), actionIndex(actionIndex), distribution(), totalMass(storm::utility::zero()), rewards(), labels() { // Intentionally left empty. } template typename storm::storage::Distribution::iterator Choice::begin() { return distribution.begin(); } template typename storm::storage::Distribution::const_iterator Choice::begin() const { return distribution.cbegin(); } template typename storm::storage::Distribution::iterator Choice::end() { return distribution.end(); } template typename storm::storage::Distribution::const_iterator Choice::end() const { return distribution.cend(); } template void Choice::addLabel(uint_fast64_t label) { if (!labels) { labels = LabelSet(); } labels->insert(label); } template void Choice::addLabels(LabelSet const& labelSet) { if (!labels) { labels = LabelSet(); } labels->insert(labelSet.begin(), labelSet.end()); } template boost::container::flat_set const& Choice::getLabels() const { return *labels; } template uint_fast64_t Choice::getActionIndex() const { return actionIndex; } template ValueType Choice::getTotalMass() const { return totalMass; } template void Choice::addProbability(StateType const& state, ValueType const& value) { totalMass += value; distribution.addProbability(state, value); } template void Choice::addReward(ValueType const& value) { rewards.push_back(value); } template void Choice::addRewards(std::vector&& values) { this->rewards = std::move(values); } template std::vector const& Choice::getRewards() const { return rewards; } template bool Choice::isMarkovian() const { return markovian; } template std::size_t Choice::size() const { return distribution.size(); } template std::ostream& operator<<(std::ostream& out, Choice const& choice) { out << "<"; for (auto const& stateProbabilityPair : choice) { out << stateProbabilityPair.first << " : " << stateProbabilityPair.second << ", "; } out << ">"; return out; } template class Choice; #ifdef STORM_HAVE_CARL template class Choice; template class Choice; #endif } }