Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
Marking.h
Go to the documentation of this file.
1#pragma once
2
3#include <cmath>
4#include <map>
5#include <memory>
7
8namespace storm {
9namespace gspn {
10class Marking {
11 public:
19 Marking(uint_fast64_t const& numberOfPlaces, std::map<uint_fast64_t, uint_fast64_t> const& numberOfBits, uint_fast64_t const& numberOfTotalBits);
20
28 Marking(uint_fast64_t const& numberOfPlaces, std::map<uint_fast64_t, uint_fast64_t> const& numberOfBits, storm::storage::BitVector const& bitvector);
29
35 uint_fast64_t getNumberOfPlaces() const;
36
43 void setNumberOfTokensAt(uint_fast64_t const& place, uint_fast64_t const& numberOfTokens);
44
51 uint_fast64_t getNumberOfTokensAt(uint_fast64_t const& place) const;
52
58 std::shared_ptr<storm::storage::BitVector> getBitVector() const;
59
63 bool operator==(const Marking& other) const;
64
65 private:
66 // the maximal number of places in the gspn
67 uint_fast64_t numberOfPlaces;
68
69 // number of bits for each place
70 std::map<uint_fast64_t, uint_fast64_t> numberOfBits;
71
72 // contains the information of the marking
74};
75} // namespace gspn
76} // namespace storm
std::shared_ptr< storm::storage::BitVector > getBitVector() const
Returns a copy of the bitvector.
Definition Marking.cpp:39
uint_fast64_t getNumberOfPlaces() const
Retrieves the number of places for which the tokens are stored.
Definition Marking.cpp:19
Marking(uint_fast64_t const &numberOfPlaces, std::map< uint_fast64_t, uint_fast64_t > const &numberOfBits, uint_fast64_t const &numberOfTotalBits)
Creates an empty marking (at all places contain 0 tokens).
Definition Marking.cpp:7
bool operator==(const Marking &other) const
Overload equality operator.
Definition Marking.cpp:45
void setNumberOfTokensAt(uint_fast64_t const &place, uint_fast64_t const &numberOfTokens)
Set the number of tokens for the given place to the given amount.
Definition Marking.cpp:23
uint_fast64_t getNumberOfTokensAt(uint_fast64_t const &place) const
Get the number of tokens for the given place.
Definition Marking.cpp:31
A bit vector that is internally represented as a vector of 64-bit values.
Definition BitVector.h:16