1#ifndef STORM_GENERATOR_NEXTSTATEGENERATOR_H_
2#define STORM_GENERATOR_NEXTSTATEGENERATOR_H_
7#include <boost/variant.hpp>
25namespace expressions {
27class ExpressionEvaluator;
35template<
typename ValueType,
typename StateType = u
int32_t>
36class NextStateGenerator;
42template<
typename ValueType,
typename StateType = u
int32_t>
61template<
typename ValueType,
typename StateType = u
int32_t>
72template<
typename ValueType,
typename StateType>
125 std::vector<StateType>
const& initialStateIndices = {},
126 std::vector<StateType>
const& deadlockStateIndices = {},
127 std::vector<StateType>
const& unexploredStateIndices = {}) = 0;
133 virtual std::shared_ptr<storm::storage::sparse::ChoiceOrigins>
generateChoiceOrigins(std::vector<boost::any>& dataForChoiceOrigins)
const;
140 void remapStateIds(std::function<StateType(StateType
const&)>
const& remapping);
152 std::vector<StateType>
const& initialStateIndices, std::vector<StateType>
const& deadlockStateIndices,
153 std::vector<StateType>
const& unexploredStateIndices,
154 std::vector<std::pair<std::string, storm::expressions::Expression>> labelsAndExpressions);
187 std::unique_ptr<storm::expressions::ExpressionEvaluator<ValueType>>
evaluator;
207 std::shared_ptr<ActionMask<ValueType, StateType>>
actionMask;
This class is responsible for managing a set of typed variables and all expressions using these varia...
A simple implementation of the valuation interface.
Action masks are arguments you can give to the state generator that limit which states are generated.
virtual ~ActionMask()=default
virtual bool query(storm::generator::NextStateGenerator< ValueType, StateType > const &generator, uint64_t actionIndex)=0
This method is called to check whether an action should be expanded.
virtual std::shared_ptr< storm::storage::sparse::ChoiceOrigins > generateChoiceOrigins(std::vector< boost::any > &dataForChoiceOrigins) const
virtual std::map< std::string, storm::storage::PlayerIndex > getPlayerNameToIndexMap() const
std::shared_ptr< storm::expressions::ExpressionManager const > expressionManager
The expression manager used for evaluating expressions.
virtual storm::storage::sparse::StateValuations makeObservationValuation() const
Adds the valuation for the currently loaded state.
std::unique_ptr< storm::expressions::ExpressionEvaluator< ValueType > > evaluator
An evaluator used to evaluate expressions.
bool isSpecialLabel(std::string const &label) const
Checks if the input label has a special purpose (e.g.
std::shared_ptr< ActionMask< ValueType, StateType > > actionMask
virtual ~NextStateGenerator()
virtual storm::storage::BitVector evaluateObservationLabels(CompressedState const &state) const =0
void initializeSpecialStates()
Initializes the out-of-bounds state and states with overlapping guards.
std::string stateToString(CompressedState const &state) const
virtual storm::storage::sparse::StateValuationsBuilder initializeStateValuationsBuilder() const
Initializes a builder for state valuations by adding the appropriate variables.
storm::utility::ConstantsComparator< ValueType > comparator
A comparator used to compare constants.
std::function< StateType(CompressedState const &)> StateToIdCallback
void postprocess(StateBehavior< ValueType, StateType > &result)
boost::optional< std::vector< uint64_t > > overlappingGuardStates
A map that stores the indices of states with overlapping guards.
CompressedState const * state
The currently loaded state.
uint32_t observabilityClass(CompressedState const &state) const
virtual ModelType getModelType() const =0
NextStateGeneratorOptions const & getOptions() const
std::vector< std::pair< storm::expressions::Expression, bool > > terminalStates
The expressions that define terminal states.
storm::expressions::SimpleValuation currentStateToSimpleValuation() const
CompressedState outOfBoundsState
A state that encodes the outOfBoundsState.
virtual bool isDiscreteTimeModel() const =0
storm::storage::BitVector mask
The mask to compute the observability class (Constructed upon first use)
storm::json< ValueType > currentStateToJson(bool onlyObservable=false) const
void load(CompressedState const &state)
virtual storm::storage::sparse::StateValuationsBuilder initializeObservationValuationsBuilder() const
bool satisfies(storm::expressions::Expression const &expression) const
std::unordered_map< storm::storage::BitVector, uint32_t > observabilityMap
The observability classes handed out so far.
virtual std::vector< StateType > getInitialStates(StateToIdCallback const &stateToIdCallback)=0
virtual storm::builder::RewardModelInformation getRewardModelInformation(uint64_t const &index) const =0
virtual void addStateValuation(storm::storage::sparse::state_type const ¤tStateIndex, storm::storage::sparse::StateValuationsBuilder &valuationsBuilder) const
Adds the valuation for the currently loaded state to the given builder.
NextStateGeneratorOptions options
The options to be used for next-state generation.
virtual void extendStateInformation(storm::json< ValueType > &stateInfo) const
void remapStateIds(std::function< StateType(StateType const &)> const &remapping)
Performs a remapping of all values stored by applying the given remapping.
virtual void unpackTransientVariableValuesIntoEvaluator(CompressedState const &state, storm::expressions::ExpressionEvaluator< ValueType > &evaluator) const
Sets the values of all transient variables in the current state to the given evaluator.
uint64_t getStateSize() const
VariableInformation const & getVariableInformation() const
virtual bool isPartiallyObservable() const =0
virtual bool isDeterministicModel() const =0
virtual std::size_t getNumberOfRewardModels() const =0
virtual StateBehavior< ValueType, StateType > expand(StateToIdCallback const &stateToIdCallback)=0
VariableInformation variableInformation
Information about how the variables are packed.
virtual storm::models::sparse::StateLabeling label(storm::storage::sparse::StateStorage< StateType > const &stateStorage, std::vector< StateType > const &initialStateIndices={}, std::vector< StateType > const &deadlockStateIndices={}, std::vector< StateType > const &unexploredStateIndices={})=0
A particular instance of the action mask that uses a callback function to evaluate whether an action ...
virtual ~StateValuationFunctionMask()=default
bool query(storm::generator::NextStateGenerator< ValueType, StateType > const &generator, uint64_t actionIndex) override
This method is called to check whether an action should be expanded.
This class manages the labeling of the state space with a number of (atomic) labels.
A bit vector that is internally represented as a vector of 64-bit values.
storm::storage::BitVector CompressedState
storm::builder::BuilderOptions NextStateGeneratorOptions
nlohmann::basic_json< std::map, std::vector, std::string, bool, int64_t, uint64_t, ValueType > json