You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

78 lines
3.8 KiB

#ifndef STORM_MODELS_SPARSE_NONDETERMINISTICMODEL_H_
#define STORM_MODELS_SPARSE_NONDETERMINISTICMODEL_H_
#include "storm/models/sparse/Model.h"
#include "storm/storage/StateActionPair.h"
namespace storm {
// Forward declare Scheduler class.
namespace storage {
template <typename ValueType>
class Scheduler;
}
namespace models {
namespace sparse {
/*!
* The base class of sparse nondeterministic models.
*/
template<class ValueType, typename RewardModelType = StandardRewardModel<ValueType>>
class NondeterministicModel: public Model<ValueType, RewardModelType> {
public:
/*!
* Constructs a model from the given data.
*
* @param modelType the type of this model
* @param components The components for this model.
*/
NondeterministicModel(ModelType modelType, storm::storage::sparse::ModelComponents<ValueType, RewardModelType> const& components);
NondeterministicModel(ModelType modelType, storm::storage::sparse::ModelComponents<ValueType, RewardModelType>&& components);
/*!
* Retrieves the number of (nondeterministic) choices in the model.
*
* @return The number of (nondeterministic) choices in the model.
*/
uint_fast64_t getNumberOfChoices() const;
/*!
* Retrieves the vector indicating which matrix rows represent non-deterministic choices of a certain state.
*
* @return The vector indicating which matrix rows represent non-deterministic choices of a certain state.
*/
std::vector<uint_fast64_t> const& getNondeterministicChoiceIndices() const;
/*!
* @param state State for which we want to know how many choices it has
*
* @return The number of non-deterministic choices for the given state
*/
uint_fast64_t getNumberOfChoices(uint_fast64_t state) const;
virtual void reduceToStateBasedRewards() override;
/*!
* For a state/action pair, get the choice index referring to the state-action pair.
*/
uint_fast64_t getChoiceIndex(storm::storage::StateActionPair const& stateactPair) const;
/*!
* Applies the given scheduler to this model.
* @param scheduler the considered scheduler.
* @param dropUnreachableStates if set, the resulting model only considers the states that are reachable from an initial state
*/
std::shared_ptr<storm::models::sparse::Model<ValueType, RewardModelType>> applyScheduler(storm::storage::Scheduler<ValueType> const& scheduler, bool dropUnreachableStates = true);
virtual void printModelInformationToStream(std::ostream& out) const override;
virtual void writeDotToStream(std::ostream& outStream, bool includeLabeling = true, storm::storage::BitVector const* subsystem = nullptr, std::vector<ValueType> const* firstValue = nullptr, std::vector<ValueType> const* secondValue = nullptr, std::vector<uint_fast64_t> const* stateColoring = nullptr, std::vector<std::string> const* colors = nullptr, std::vector<uint_fast64_t>* scheduler = nullptr, bool finalizeOutput = true) const override;
};
} // namespace sparse
} // namespace models
} // namespace storm
#endif /* STORM_MODELS_SPARSE_NONDETERMINISTICMODEL_H_ */