Browse Source
Improved explicit model building:
Improved explicit model building:
- There is now an option to generate a choice labeling that corresponds to the specified action names. - The old choice labeling (where each choice was labeled with an index set representing the corresponding prism commands) is renamed to choiceOrigins and has been improved towards support of other input formats (such as Jani) and other applications such as scheduler synthesistempestpy_adaptions
TimQu
8 years ago
23 changed files with 695 additions and 99 deletions
-
11src/storm/builder/BuilderOptions.cpp
-
6src/storm/builder/BuilderOptions.h
-
34src/storm/builder/ChoiceInformationBuilder.cpp
-
41src/storm/builder/ChoiceInformationBuilder.h
-
59src/storm/builder/ExplicitModelBuilder.cpp
-
42src/storm/builder/ExplicitModelBuilder.h
-
73src/storm/builder/ExplicitModelBuilderResult.cpp
-
33src/storm/builder/ExplicitModelBuilderResult.h
-
77src/storm/generator/Choice.cpp
-
38src/storm/generator/Choice.h
-
4src/storm/generator/JaniNextStateGenerator.cpp
-
6src/storm/generator/NextStateGenerator.cpp
-
3src/storm/generator/NextStateGenerator.h
-
60src/storm/generator/PrismNextStateGenerator.cpp
-
7src/storm/generator/PrismNextStateGenerator.h
-
2src/storm/models/sparse/ChoiceLabeling.cpp
-
69src/storm/storage/sparse/ChoiceOrigins.cpp
-
65src/storm/storage/sparse/ChoiceOrigins.h
-
23src/storm/storage/sparse/JaniChoiceOrigins.cpp
-
40src/storm/storage/sparse/JaniChoiceOrigins.h
-
37src/storm/storage/sparse/PrismChoiceOrigins.cpp
-
62src/storm/storage/sparse/PrismChoiceOrigins.h
-
2src/storm/utility/storm.h
@ -0,0 +1,34 @@ |
|||
#include "storm/builder/ChoiceInformationBuilder.h"
|
|||
|
|||
namespace storm { |
|||
namespace builder { |
|||
|
|||
void ChoiceInformationBuilder::addLabel(std::string const& label, uint_fast64_t choiceIndex) { |
|||
storm::storage::BitVector& labeledChoices = labels[label]; |
|||
labeledChoices.grow(choiceIndex + 1); |
|||
labeledChoices.set(choiceIndex, true); |
|||
} |
|||
|
|||
void ChoiceInformationBuilder::addOriginData(boost::any const& originData, uint_fast64_t choiceIndex) { |
|||
if(dataOfOrigins.size() != choiceIndex) { |
|||
dataOfOrigins.resize(choiceIndex); |
|||
} |
|||
dataOfOrigins.push_back(originData); |
|||
} |
|||
|
|||
storm::models::sparse::ChoiceLabeling ChoiceInformationBuilder::buildChoiceLabeling(uint_fast64_t totalNumberOfChoices) { |
|||
storm::models::sparse::ChoiceLabeling result(totalNumberOfChoices); |
|||
for (auto& label : labels) { |
|||
label.second.resize(totalNumberOfChoices, false); |
|||
result.addLabel(label.first, std::move(label.second)); |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
std::vector<boost::any> ChoiceInformationBuilder::buildDataOfChoiceOrigins(uint_fast64_t totalNumberOfChoices) { |
|||
dataOfOrigins.resize(totalNumberOfChoices); |
|||
return std::move(dataOfOrigins); |
|||
} |
|||
|
|||
} |
|||
} |
@ -0,0 +1,41 @@ |
|||
#pragma once |
|||
|
|||
#include <memory> |
|||
#include <string> |
|||
#include <unordered_map> |
|||
#include <vector> |
|||
#include <boost/any.hpp> |
|||
|
|||
#include "storm/models/sparse/ChoiceLabeling.h" |
|||
#include "storm/storage/BitVector.h" |
|||
#include "storm/storage/sparse/PrismChoiceOrigins.h" |
|||
#include "storm/storage/prism/Program.h" |
|||
|
|||
|
|||
namespace storm { |
|||
namespace builder { |
|||
|
|||
/*! |
|||
* This class collects information regarding the choices |
|||
*/ |
|||
class ChoiceInformationBuilder { |
|||
public: |
|||
|
|||
ChoiceInformationBuilder() = default; |
|||
|
|||
void addLabel(std::string const& label, uint_fast64_t choiceIndex); |
|||
|
|||
void addOriginData(boost::any const& originData, uint_fast64_t choiceIndex); |
|||
|
|||
storm::models::sparse::ChoiceLabeling buildChoiceLabeling(uint_fast64_t totalNumberOfChoices); |
|||
|
|||
std::vector<boost::any> buildDataOfChoiceOrigins(uint_fast64_t totalNumberOfChoices); |
|||
|
|||
|
|||
private: |
|||
std::unordered_map<std::string, storm::storage::BitVector> labels; |
|||
std::vector<boost::any> dataOfOrigins; |
|||
}; |
|||
} |
|||
} |
|||
|
@ -0,0 +1,73 @@ |
|||
#include "storm/builder/ExplicitModelBuilderResult.h"
|
|||
|
|||
#include "storm/utility/macros.h"
|
|||
#include "storm/exceptions/InvalidOperationException.h"
|
|||
|
|||
#include "storm/adapters/CarlAdapter.h"
|
|||
#include "storm/models/sparse/StandardRewardModel.h"
|
|||
|
|||
namespace storm { |
|||
namespace builder { |
|||
|
|||
template <typename ValueType, typename RewardModelType> |
|||
ExplicitModelBuilderResult<ValueType, RewardModelType>::ExplicitModelBuilderResult(std::shared_ptr<storm::models::sparse::Model<ValueType, RewardModelType>> model, std::shared_ptr<storm::storage::sparse::StateValuations> stateValuations,std::shared_ptr<storm::storage::sparse::ChoiceOrigins> choiceOrigins) : model(model), stateValuations(stateValuations), choiceOrigins(choiceOrigins) { |
|||
// Intentionally left empty
|
|||
} |
|||
|
|||
template <typename ValueType, typename RewardModelType> |
|||
std::shared_ptr<storm::models::sparse::Model<ValueType, RewardModelType>>& ExplicitModelBuilderResult<ValueType, RewardModelType>::getModel() { |
|||
STORM_LOG_THROW(model, storm::exceptions::InvalidOperationException, "Retrieving the model failed since it is not set."); |
|||
return model; |
|||
} |
|||
|
|||
template <typename ValueType, typename RewardModelType> |
|||
std::shared_ptr<storm::models::sparse::Model<ValueType, RewardModelType>> const& ExplicitModelBuilderResult<ValueType, RewardModelType>::getModel() const { |
|||
STORM_LOG_THROW(model, storm::exceptions::InvalidOperationException, "Retrieving the model failed since it is not set."); |
|||
return model; |
|||
} |
|||
|
|||
template <typename ValueType, typename RewardModelType> |
|||
bool ExplicitModelBuilderResult<ValueType, RewardModelType>::hasStateValuations() { |
|||
return static_cast<bool>(stateValuations); |
|||
} |
|||
|
|||
template <typename ValueType, typename RewardModelType> |
|||
std::shared_ptr<storm::storage::sparse::StateValuations>& ExplicitModelBuilderResult<ValueType, RewardModelType>::getStateValuations() { |
|||
STORM_LOG_THROW(stateValuations, storm::exceptions::InvalidOperationException, "Retrieving the state valuations failed since they are not set."); |
|||
return stateValuations; |
|||
} |
|||
|
|||
template <typename ValueType, typename RewardModelType> |
|||
std::shared_ptr<storm::storage::sparse::StateValuations> const& ExplicitModelBuilderResult<ValueType, RewardModelType>::getStateValuations() const { |
|||
STORM_LOG_THROW(stateValuations, storm::exceptions::InvalidOperationException, "Retrieving the state valuations failed since they are not set."); |
|||
return stateValuations; |
|||
} |
|||
|
|||
template <typename ValueType, typename RewardModelType> |
|||
bool ExplicitModelBuilderResult<ValueType, RewardModelType>::hasChoiceOrigins() { |
|||
return static_cast<bool>(choiceOrigins); |
|||
} |
|||
|
|||
template <typename ValueType, typename RewardModelType> |
|||
std::shared_ptr<storm::storage::sparse::ChoiceOrigins>& ExplicitModelBuilderResult<ValueType, RewardModelType>::getChoiceOrigins() { |
|||
STORM_LOG_THROW(choiceOrigins, storm::exceptions::InvalidOperationException, "Retrieving the choice origins failed since they are not set."); |
|||
return choiceOrigins; |
|||
} |
|||
|
|||
template <typename ValueType, typename RewardModelType> |
|||
std::shared_ptr<storm::storage::sparse::ChoiceOrigins> const& ExplicitModelBuilderResult<ValueType, RewardModelType>::getChoiceOrigins() const { |
|||
STORM_LOG_THROW(choiceOrigins, storm::exceptions::InvalidOperationException, "Retrieving the choice origins failed since they are not set."); |
|||
return choiceOrigins; |
|||
} |
|||
|
|||
// Explicitly instantiate the class.
|
|||
template class ExplicitModelBuilderResult<double, storm::models::sparse::StandardRewardModel<double>>; |
|||
|
|||
#ifdef STORM_HAVE_CARL
|
|||
template class ExplicitModelBuilderResult<RationalNumber, storm::models::sparse::StandardRewardModel<RationalNumber>>; |
|||
template class ExplicitModelBuilderResult<RationalFunction, storm::models::sparse::StandardRewardModel<RationalFunction>>; |
|||
template class ExplicitModelBuilderResult<double, storm::models::sparse::StandardRewardModel<storm::Interval>>; |
|||
#endif
|
|||
|
|||
} |
|||
} |
@ -0,0 +1,33 @@ |
|||
#pragma once |
|||
|
|||
#include <memory> |
|||
#include "storm/models/sparse/Model.h" |
|||
#include "storm/storage/sparse/StateValuations.h" |
|||
#include "storm/storage/sparse/ChoiceOrigins.h" |
|||
|
|||
namespace storm { |
|||
namespace builder { |
|||
|
|||
template<typename ValueType, typename RewardModelType = storm::models::sparse::StandardRewardModel<ValueType>> |
|||
class ExplicitModelBuilderResult { |
|||
public: |
|||
ExplicitModelBuilderResult(std::shared_ptr<storm::models::sparse::Model<ValueType, RewardModelType>> model, std::shared_ptr<storm::storage::sparse::StateValuations> stateValuations,std::shared_ptr<storm::storage::sparse::ChoiceOrigins> choiceOrigins); |
|||
|
|||
std::shared_ptr<storm::models::sparse::Model<ValueType, RewardModelType>>& getModel(); |
|||
std::shared_ptr<storm::models::sparse::Model<ValueType, RewardModelType>> const& getModel() const; |
|||
|
|||
bool hasStateValuations(); |
|||
std::shared_ptr<storm::storage::sparse::StateValuations>& getStateValuations(); |
|||
std::shared_ptr<storm::storage::sparse::StateValuations> const& getStateValuations() const; |
|||
|
|||
bool hasChoiceOrigins(); |
|||
std::shared_ptr<storm::storage::sparse::ChoiceOrigins>& getChoiceOrigins(); |
|||
std::shared_ptr<storm::storage::sparse::ChoiceOrigins> const& getChoiceOrigins() const; |
|||
|
|||
private: |
|||
std::shared_ptr<storm::models::sparse::Model<ValueType, RewardModelType>> model; |
|||
std::shared_ptr<storm::storage::sparse::StateValuations> stateValuations; |
|||
std::shared_ptr<storm::storage::sparse::ChoiceOrigins> choiceOrigins; |
|||
}; |
|||
} |
|||
} |
@ -0,0 +1,69 @@ |
|||
#include "storm/storage/sparse/ChoiceOrigins.h"
|
|||
|
|||
#include "storm/storage/sparse/PrismChoiceOrigins.h"
|
|||
#include "storm/storage/sparse/JaniChoiceOrigins.h"
|
|||
#include "storm/utility/vector.h"
|
|||
|
|||
|
|||
namespace storm { |
|||
namespace storage { |
|||
namespace sparse { |
|||
|
|||
ChoiceOrigins::ChoiceOrigins(std::vector<uint_fast64_t> const& indexToIdentifierMapping, std::vector<std::string> const& identifierToInfoMapping) : indexToIdentifier(indexToIdentifierMapping), identifierToInfo(identifierToInfoMapping) { |
|||
// Intentionally left empty
|
|||
} |
|||
|
|||
ChoiceOrigins::ChoiceOrigins(std::vector<uint_fast64_t>&& indexToIdentifierMapping, std::vector<std::string>&& identifierToInfoMapping) : indexToIdentifier(std::move(indexToIdentifierMapping)), identifierToInfo(std::move(identifierToInfoMapping)) { |
|||
// Intentionally left empty
|
|||
} |
|||
|
|||
bool ChoiceOrigins::isPrismChoiceOrigins() const { |
|||
return false; |
|||
} |
|||
|
|||
bool ChoiceOrigins::isJaniChoiceOrigins() const { |
|||
return false; |
|||
} |
|||
|
|||
PrismChoiceOrigins& ChoiceOrigins::asPrismChoiceOrigins() { |
|||
return dynamic_cast<PrismChoiceOrigins&>(*this); |
|||
} |
|||
|
|||
PrismChoiceOrigins const& ChoiceOrigins::asPrismChoiceOrigins() const { |
|||
return dynamic_cast<PrismChoiceOrigins const&>(*this); |
|||
} |
|||
|
|||
JaniChoiceOrigins& ChoiceOrigins::asJaniChoiceOrigins() { |
|||
return dynamic_cast<JaniChoiceOrigins&>(*this); |
|||
} |
|||
|
|||
JaniChoiceOrigins const& ChoiceOrigins::asJaniChoiceOrigins() const { |
|||
return dynamic_cast<JaniChoiceOrigins const&>(*this); |
|||
} |
|||
|
|||
uint_fast64_t ChoiceOrigins::getIdentifier(uint_fast64_t choiceIndex) const { |
|||
return indexToIdentifier[choiceIndex]; |
|||
} |
|||
|
|||
std::string const& ChoiceOrigins::getIdentifierInfo(uint_fast64_t identifier) const { |
|||
return identifierToInfo[identifier]; |
|||
} |
|||
|
|||
std::string const& ChoiceOrigins::getChoiceInfo(uint_fast64_t choiceIndex) const { |
|||
return getIdentifierInfo(getIdentifier(choiceIndex)); |
|||
} |
|||
|
|||
std::shared_ptr<ChoiceOrigins> ChoiceOrigins::selectChoices(storm::storage::BitVector const& selectedChoices) const { |
|||
std::vector<uint_fast64_t> indexToIdentifierMapping(selectedChoices.getNumberOfSetBits()); |
|||
storm::utility::vector::selectVectorValues(indexToIdentifierMapping, selectedChoices, indexToIdentifier); |
|||
return cloneWithNewIndexToIdentifierMapping(std::move(indexToIdentifierMapping)); |
|||
} |
|||
|
|||
std::shared_ptr<ChoiceOrigins> ChoiceOrigins::selectChoices(std::vector<uint_fast64_t> const& selectedChoices) const { |
|||
std::vector<uint_fast64_t> indexToIdentifierMapping(selectedChoices.size()); |
|||
storm::utility::vector::selectVectorValues(indexToIdentifierMapping, selectedChoices, indexToIdentifier); |
|||
return cloneWithNewIndexToIdentifierMapping(std::move(indexToIdentifierMapping)); |
|||
} |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,65 @@ |
|||
#pragma once |
|||
|
|||
#include <vector> |
|||
#include <string> |
|||
#include "storm/storage/BitVector.h" |
|||
|
|||
namespace storm { |
|||
namespace storage { |
|||
namespace sparse { |
|||
|
|||
class PrismChoiceOrigins; |
|||
class JaniChoiceOrigins; |
|||
|
|||
/*! |
|||
* This class represents the origin of the choices of a model in terms of the input model specification |
|||
* (e.g., the Prism commands that induced the choice). |
|||
*/ |
|||
class ChoiceOrigins { |
|||
public: |
|||
|
|||
virtual ~ChoiceOrigins() = default; |
|||
|
|||
virtual bool isPrismChoiceOrigins() const; |
|||
virtual bool isJaniChoiceOrigins() const; |
|||
|
|||
PrismChoiceOrigins& asPrismChoiceOrigins(); |
|||
PrismChoiceOrigins const& asPrismChoiceOrigins() const; |
|||
|
|||
JaniChoiceOrigins& asJaniChoiceOrigins(); |
|||
JaniChoiceOrigins const& asJaniChoiceOrigins() const; |
|||
|
|||
/* |
|||
* Returns a unique identifier of the origin of the given choice which can be used to e.g. check whether two choices have the same origin |
|||
*/ |
|||
uint_fast64_t getIdentifier(uint_fast64_t choiceIndex) const; |
|||
|
|||
/* |
|||
* Returns the information for the given choice origin identifier as a (human readable) string |
|||
*/ |
|||
std::string const& getIdentifierInfo(uint_fast64_t identifier) const; |
|||
|
|||
/* |
|||
* Returns the choice origin information as a (human readable) string. |
|||
*/ |
|||
std::string const& getChoiceInfo(uint_fast64_t choiceIndex) const; |
|||
|
|||
|
|||
std::shared_ptr<ChoiceOrigins> selectChoices(storm::storage::BitVector const& selectedChoices) const; |
|||
std::shared_ptr<ChoiceOrigins> selectChoices(std::vector<uint_fast64_t> const& selectedChoiceIndices) const; |
|||
|
|||
protected: |
|||
ChoiceOrigins(std::vector<uint_fast64_t> const& indexToIdentifierMapping, std::vector<std::string> const& identifierToInfoMapping); |
|||
ChoiceOrigins(std::vector<uint_fast64_t>&& indexToIdentifierMapping, std::vector<std::string>&& identifierToInfoMapping); |
|||
|
|||
/* |
|||
* Returns a copy of this object where the mapping of choice indices to origin identifiers is replaced by the given one. |
|||
*/ |
|||
virtual std::shared_ptr<ChoiceOrigins> cloneWithNewIndexToIdentifierMapping(std::vector<uint_fast64_t>&& indexToIdentifierMapping) const = 0; |
|||
|
|||
std::vector<uint_fast64_t> indexToIdentifier; |
|||
std::vector<std::string> identifierToInfo; |
|||
}; |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,23 @@ |
|||
#include "storm/storage/sparse/JaniChoiceOrigins.h"
|
|||
|
|||
|
|||
namespace storm { |
|||
namespace storage { |
|||
namespace sparse { |
|||
|
|||
JaniChoiceOrigins::JaniChoiceOrigins(std::vector<uint_fast64_t> const& indexToIdentifierMapping, std::vector<std::string> const& identifierToInfoMapping) : ChoiceOrigins(indexToIdentifierMapping, identifierToInfoMapping) { |
|||
// Intentionally left empty
|
|||
} |
|||
|
|||
bool JaniChoiceOrigins::isJaniChoiceOrigins() const { |
|||
return true; |
|||
} |
|||
|
|||
std::shared_ptr<ChoiceOrigins> JaniChoiceOrigins::cloneWithNewIndexToIdentifierMapping(std::vector<uint_fast64_t>&& indexToIdentifierMapping) const { |
|||
std::vector<std::string> identifierToInfoMapping = this->identifierToInfo; |
|||
return std::make_shared<JaniChoiceOrigins>(std::move(indexToIdentifierMapping), std::move(identifierToInfoMapping)); |
|||
} |
|||
|
|||
} |
|||
} |
|||
} |
@ -0,0 +1,40 @@ |
|||
#pragma once |
|||
|
|||
#include <memory> |
|||
#include <string> |
|||
|
|||
#include "storm/storage/sparse/ChoiceOrigins.h" |
|||
|
|||
|
|||
namespace storm { |
|||
namespace storage { |
|||
namespace sparse { |
|||
|
|||
|
|||
/*! |
|||
* This class represents for each choice the origin in the jani specification |
|||
*/ |
|||
class JaniChoiceOrigins : public ChoiceOrigins { |
|||
public: |
|||
|
|||
/*! |
|||
* Creates a new representation of the choice indices to their origin in the Jani specification |
|||
* // TODO complete this |
|||
*/ |
|||
JaniChoiceOrigins(std::vector<uint_fast64_t> const& indexToIdentifierMapping, std::vector<std::string> const& identifierToInfoMapping); |
|||
|
|||
virtual ~JaniChoiceOrigins() = default; |
|||
|
|||
virtual bool isJaniChoiceOrigins() const override ; |
|||
|
|||
/* |
|||
* Returns a copy of this object where the mapping of choice indices to origin identifiers is replaced by the given one. |
|||
*/ |
|||
virtual std::shared_ptr<ChoiceOrigins> cloneWithNewIndexToIdentifierMapping(std::vector<uint_fast64_t>&& indexToIdentifierMapping) const override; |
|||
|
|||
private: |
|||
|
|||
}; |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,37 @@ |
|||
#include "storm/storage/sparse/PrismChoiceOrigins.h"
|
|||
|
|||
|
|||
namespace storm { |
|||
namespace storage { |
|||
namespace sparse { |
|||
|
|||
PrismChoiceOrigins::PrismChoiceOrigins(std::shared_ptr<storm::prism::Program const> const& prismProgram, std::vector<uint_fast64_t> const& indexToIdentifierMapping, std::vector<std::string> const& identifierToInfoMapping, std::vector<CommandSet> const& identifierToCommandSetMapping) : ChoiceOrigins(indexToIdentifierMapping, identifierToInfoMapping), program(prismProgram), identifierToCommandSet(identifierToCommandSetMapping) { |
|||
// Intentionally left empty
|
|||
} |
|||
|
|||
PrismChoiceOrigins::PrismChoiceOrigins(std::shared_ptr<storm::prism::Program const> const& prismProgram, std::vector<uint_fast64_t>&& indexToIdentifierMapping, std::vector<std::string>&& identifierToInfoMapping, std::vector<CommandSet>&& identifierToCommandSetMapping) : ChoiceOrigins(std::move(indexToIdentifierMapping), std::move(identifierToInfoMapping)), program(prismProgram), identifierToCommandSet(std::move(identifierToCommandSetMapping)) { |
|||
// Intentionally left empty
|
|||
} |
|||
|
|||
bool PrismChoiceOrigins::isPrismChoiceOrigins() const { |
|||
return true; |
|||
} |
|||
|
|||
storm::prism::Program const& PrismChoiceOrigins::getProgram() const { |
|||
return *program; |
|||
} |
|||
|
|||
PrismChoiceOrigins::CommandSet const& PrismChoiceOrigins::getCommandSet(uint_fast64_t choiceIndex) const { |
|||
return identifierToCommandSet[this->getIdentifier(choiceIndex)]; |
|||
} |
|||
|
|||
std::shared_ptr<ChoiceOrigins> PrismChoiceOrigins::cloneWithNewIndexToIdentifierMapping(std::vector<uint_fast64_t>&& indexToIdentifierMapping) const { |
|||
std::vector<CommandSet> identifierToCommandSetMapping = this->identifierToCommandSet; |
|||
std::vector<std::string> identifierToInfoMapping = this->identifierToInfo; |
|||
return std::make_shared<PrismChoiceOrigins>(this->program, std::move(indexToIdentifierMapping), std::move(identifierToInfoMapping), std::move(identifierToCommandSetMapping)); |
|||
} |
|||
|
|||
|
|||
} |
|||
} |
|||
} |
@ -0,0 +1,62 @@ |
|||
#pragma once |
|||
|
|||
#include <memory> |
|||
#include <string> |
|||
#include <boost/container/flat_set.hpp> |
|||
|
|||
#include "storm/storage/sparse/ChoiceOrigins.h" |
|||
#include "storm/storage/prism/Program.h" |
|||
|
|||
|
|||
namespace storm { |
|||
namespace storage { |
|||
namespace sparse { |
|||
|
|||
|
|||
/*! |
|||
* This class represents for each choice the set of prism commands that induced the choice |
|||
*/ |
|||
class PrismChoiceOrigins : public ChoiceOrigins { |
|||
public: |
|||
|
|||
typedef boost::container::flat_set<uint_fast64_t> CommandSet; |
|||
|
|||
/*! |
|||
* Creates a new representation of the choice indices to their origin in the prism program |
|||
* @param prismProgram The associated prism program |
|||
* @param indexToIdentifierMapping maps a choice index to the internally used identifier of the choice origin |
|||
* @param identifierToInfoMapping maps an origin identifier to a string representation of the origin |
|||
* @param identifierToCommandSetMapping maps an origin identifier to the set of global indices of the corresponding prism commands |
|||
*/ |
|||
PrismChoiceOrigins(std::shared_ptr<storm::prism::Program const> const& prismProgram, std::vector<uint_fast64_t> const& indexToIdentifierMapping, std::vector<std::string> const& identifierToInfoMapping, std::vector<CommandSet> const& identifierToCommandSetMapping); |
|||
PrismChoiceOrigins(std::shared_ptr<storm::prism::Program const> const& prismProgram, std::vector<uint_fast64_t>&& indexToIdentifierMapping, std::vector<std::string>&& identifierToInfoMapping, std::vector<CommandSet>&& identifierToCommandSetMapping); |
|||
|
|||
virtual ~PrismChoiceOrigins() = default; |
|||
|
|||
virtual bool isPrismChoiceOrigins() const override ; |
|||
|
|||
/* |
|||
* Returns the prism program associated with this |
|||
*/ |
|||
storm::prism::Program const& getProgram() const; |
|||
|
|||
/* |
|||
* Returns the set of prism commands that induced the choice with the given index. |
|||
* The command set is represented by a set of global command indices |
|||
*/ |
|||
CommandSet const& getCommandSet(uint_fast64_t choiceIndex) const; |
|||
|
|||
/* |
|||
* Returns a copy of this object where the mapping of choice indices to origin identifiers is replaced by the given one. |
|||
*/ |
|||
virtual std::shared_ptr<ChoiceOrigins> cloneWithNewIndexToIdentifierMapping(std::vector<uint_fast64_t>&& indexToIdentifierMapping) const override; |
|||
|
|||
private: |
|||
|
|||
std::shared_ptr<storm::prism::Program const> program; |
|||
std::vector<CommandSet> identifierToCommandSet; |
|||
|
|||
}; |
|||
} |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue