7Marking::Marking(uint_fast64_t
const& numberOfPlaces, std::map<uint_fast64_t, uint_fast64_t>
const& numberOfBits, uint_fast64_t
const& numberOfTotalBits) {
8 this->numberOfPlaces = numberOfPlaces;
9 this->numberOfBits = numberOfBits;
14 this->numberOfPlaces = numberOfPlaces;
15 this->numberOfBits = numberOfBits;
16 this->marking = bitvector;
20 return this->numberOfPlaces;
24 uint_fast64_t index = 0;
25 for (uint_fast64_t i = 0; i < place; ++i) {
26 index += numberOfBits[i];
28 marking.
setFromInt(index, numberOfBits[place], numberOfTokens);
32 uint_fast64_t index = 0;
33 for (uint_fast64_t i = 0; i < place; ++i) {
34 index += numberOfBits.at(i);
36 return marking.
getAsInt(index, numberOfBits.at(place));
40 auto result = std::make_shared<storm::storage::BitVector>();
49 if (&numberOfBits == &other.numberOfBits) {
50 return marking == other.marking;
std::shared_ptr< storm::storage::BitVector > getBitVector() const
Returns a copy of the bitvector.
uint_fast64_t getNumberOfPlaces() const
Retrieves the number of places for which the tokens are stored.
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).
bool operator==(const Marking &other) const
Overload equality operator.
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.
uint_fast64_t getNumberOfTokensAt(uint_fast64_t const &place) const
Get the number of tokens for the given place.
A bit vector that is internally represented as a vector of 64-bit values.
void setFromInt(uint_fast64_t bitIndex, uint_fast64_t numberOfBits, uint64_t value)
Sets the selected number of lowermost bits of the provided value at the given bit index.
uint_fast64_t getAsInt(uint_fast64_t bitIndex, uint_fast64_t numberOfBits) const
Retrieves the content of the current bit vector at the given index for the given number of bits as an...