Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
ExplicitGspnModelBuilder.h
Go to the documentation of this file.
1// #pragma once
2// #include <string>
3//
4// #include "storm/models/sparse/MarkovAutomaton.h"
5// #include "storm/models/sparse/StandardRewardModel.h"
6// #include "storm/storage/BitVector.h"
7// #include "storm/storage/BitVectorHashMap.h"
8// #include "storm/storage/gspn/GSPN.h"
9// #include "storm/storage/gspn/ImmediateTransition.h"
10// #include "storm/storage/gspn/TimedTransition.h"
11//
12// namespace storm {
13// namespace builder {
14//
15// /*!
16// * This class provides the facilities for building an markov automaton.
17// */
18// template<typename ValueType=double>
19// class ExplicitGspnModelBuilder {
20// public:
21//
22// /*!
23// * Builds an MarkovAutomaton from the given GSPN.
24// *
25// * @param gspn The gspn whose semantic is covered by the MarkovAutomaton
26// * @return The resulting MarkovAutomaton
27// */
28// storm::models::sparse::MarkovAutomaton<ValueType> translateGspn(storm::gspn::GSPN const& gspn, std::string const& formula);
29// private:
30//
31// /*!
32// * Add for each partition a new row in the probability matrix.
33// *
34// * @param partitions The partitioned immediate transitions.
35// * @param currentMarking The current marking which is considered at the moment.
36// */
37// void addRowForPartitions(std::vector<std::vector<std::shared_ptr<storm::gspn::ImmediateTransition<double>>>> const& partitions,
38// storm::gspn::Marking const& currentMarking);
39//
40//
41// /*!
42// * Add row for a markovian state.
43// *
44// * @param enabledTimedTransitions List of enabled timed transitions.
45// * @param currentMarking The current marking which is considered at the moment.
46// * @param accRate The sum of all rates of the enabled timed transisitons
47// */
48// void addRowForTimedTransitions(std::vector<std::shared_ptr<storm::gspn::TimedTransition<double>>> const& enabledTimedTransitions,
49// storm::gspn::Marking const& currentMarking, double const& accRate);
50//
51// /*!
52// * Struct for comparing unsigned integer for maps
53// */
54// struct cmpByIndex {
55// bool operator()(const uint_fast64_t &a, const uint_fast64_t &b) const {
56// return a < b;
57// }
58// };
59//
60// /*!
61// * This method insert the values from a map into the matrix
62// *
63// * @param values The values which are inserted
64// */
65// void addValuesToBuilder(std::map<uint_fast64_t , double, storm::builder::ExplicitGspnModelBuilder<ValueType>::cmpByIndex> const& values);
66//
67//
68// /*!
69// * This method partitions all enabled immediate transitions w.r.t. a marking.
70// * All enabled weighted immediate transitions are in one vector. Between these transitions
71// * is chosen probabilistically by the weights.
72// *
73// * All other enabled non-weighted immediate transitions are in an singleton vector.
74// * Between different vectors is chosen non-deterministically.
75// *
76// * @param marking The current marking which is considered.
77// * @param enabledImmediateTransistions A vector of enabled immediate transitions.
78// * @return The vector of vectors which is described above.
79// */
80// std::vector<std::vector<std::shared_ptr<storm::gspn::ImmediateTransition<double>>>> partitonEnabledImmediateTransitions(storm::gspn::Marking
81// const& marking, std::vector<std::shared_ptr<storm::gspn::ImmediateTransition<double>>> const& enabledImmediateTransitions);
82//
83// /*!
84// * Computes the accumulated weight of immediate transisions which are stored in a list.
85// *
86// * @param vector List of immediate transisitions.
87// */
88// double getAccumulatedWeight(std::vector<std::shared_ptr<storm::gspn::ImmediateTransition<double>>> const& vector) const;
89//
90// /*!
91// * Compute the upper bound for the number of tokens in each place.
92// * Also computes the number of bits which are used to store a marking.
93// *
94// * @param gspn The corresponding gspn.
95// */
96// void computeCapacities(storm::gspn::GSPN const& gspn);
97//
98// /*!
99// * Returns the vector of enabled timed transition with the highest priority.
100// *
101// *
102// * @param marking The current marking which is considered.
103// * @return The vector of enabled timed transitions.
104// */
105// std::vector<std::shared_ptr<storm::gspn::TimedTransition<double>>> getEnabledTimedTransition(
106// storm::gspn::Marking const& marking);
107//
108// /*!
109// * Returns the vector of active immediate transition with the highest priority.
110// *
111// * @param marking The current marking which is considered.
112// * @return The vector of enabled immediate transitions.
113// */
114// std::vector<std::shared_ptr<storm::gspn::ImmediateTransition<double>>> getEnabledImmediateTransition(
115// storm::gspn::Marking const& marking);
116//
117// /*!
118// * Computes the accumulated rate of a vector of timed transitions.
119// *
120// * @param vector The vector of timed transitions.
121// * @return The accumulated rate.
122// */
123// double getAccumulatedRate(std::vector<std::shared_ptr<storm::gspn::TimedTransition<double>>> const& vector);
124//
125// // is only needed for debugging purposes
126// // since markings is injective, we can determine the bitvector
127// storm::storage::BitVector getBitvector(uint_fast64_t const& index);
128//
129// /*!
130// * Adds the bitvector to the marking-map.
131// * If the bitvector corresponds to a new marking the bitvector is added to the todo list.
132// *
133// * @return The rowGroup index for the bitvector.
134// */
135// uint_fast64_t findOrAddBitvectorToMarkings(storm::storage::BitVector const& bitvector);
136//
137// /*!
138// * Computes the state labeling and returns it.
139// * Every state is labeled with its name.
140// *
141// * @return The computed state labeling.
142// */
143// storm::models::sparse::StateLabeling getStateLabeling() const;
144//
145//
146// // contains the number of bits which are used the store the number of tokens at each place
147// std::map<uint_fast64_t, uint_fast64_t> numberOfBits;
148//
149// // contains the number of bits used to create markings
150// uint_fast64_t numberOfTotalBits;
151//
152// // maps bitvectors (markings w.r.t. the capacity) to their rowgroup
153// storm::storage::BitVectorHashMap<uint_fast64_t> markings = storm::storage::BitVectorHashMap<uint_fast64_t>(64, 1);
154//
155// // a list of markings for which the outgoing edges need to be computed
156// std::deque<std::shared_ptr<storm::storage::BitVector>> todo;
157//
158// //the gspn which is transformed
159// storm::gspn::GSPN gspn;
160//
161// // the next index for a new rowgroup
162// uint_fast64_t nextRowGroupIndex = 0;
163//
164// // builder object which is used to create the probability matrix
165// storm::storage::SparseMatrixBuilder<double> builder;
166//
167// // contains the current row index during the computation
168// uint_fast64_t currentRowIndex;
169// };
170// }
171// }
172//