diff --git a/src/storage/gspn/GspnBuilder.cpp b/src/storage/gspn/GspnBuilder.cpp index 70d4cb39d..6391d4720 100644 --- a/src/storage/gspn/GspnBuilder.cpp +++ b/src/storage/gspn/GspnBuilder.cpp @@ -13,10 +13,9 @@ namespace storm { } uint_fast64_t GspnBuilder::addPlace(int_fast64_t const& capacity, uint_fast64_t const& initialTokens, std::string const& name) { - auto place = storm::gspn::Place(); - place.setCapacity(capacity); auto newId = places.size(); - place.setID(newId); + auto place = storm::gspn::Place(newId); + place.setCapacity(capacity); place.setNumberOfInitialTokens(initialTokens); places.push_back(place); return newId; diff --git a/src/storage/gspn/Place.cpp b/src/storage/gspn/Place.cpp index 15ff85b6c..84f426231 100644 --- a/src/storage/gspn/Place.cpp +++ b/src/storage/gspn/Place.cpp @@ -5,6 +5,10 @@ namespace storm { namespace gspn { + Place::Place(uint64_t id) : id(id) { + + } + void Place::setName(std::string const& name) { this->name = name; } @@ -13,24 +17,19 @@ namespace storm { return this->name; } - void Place::setID(uint_fast64_t const& id) { - this->id = id; - } - - uint_fast64_t Place::getID() const { + uint64_t Place::getID() const { return this->id; } - void Place::setNumberOfInitialTokens(uint_fast64_t const& tokens) { + void Place::setNumberOfInitialTokens(uint64_t tokens) { this->numberOfInitialTokens = tokens; } - uint_fast64_t Place::getNumberOfInitialTokens() const { + uint64_t Place::getNumberOfInitialTokens() const { return this->numberOfInitialTokens; } void Place::setCapacity(uint64_t cap) { - std::cout << this->name << std::endl; this->capacity = cap; } diff --git a/src/storage/gspn/Place.h b/src/storage/gspn/Place.h index 7b99fe6d2..e995f6a93 100644 --- a/src/storage/gspn/Place.h +++ b/src/storage/gspn/Place.h @@ -11,6 +11,8 @@ namespace storm { */ class Place { public: + Place(uint64_t id); + /*! * Sets the name of this place. The name is not used to identify a place (and therefore do not have to be unique). * Some input and output formats use the name to identify a place. If you want to use the export or import @@ -27,33 +29,26 @@ namespace storm { */ std::string getName() const; - /*! - * Sets the id of this place. The id must be unique for a gspn. - * - * @param id The new id of this place. - */ - void setID(uint_fast64_t const& id); - /*! * Returns the id of this place. * * @return The id of this place. */ - uint_fast64_t getID() const; + uint64_t getID() const; /*! * Sets the number of initial tokens of this place. * * @param tokens The number of initial tokens. */ - void setNumberOfInitialTokens(uint_fast64_t const& tokens); + void setNumberOfInitialTokens(uint64_t tokens); /*! * Returns the number of initial tokens of this place. * * @return The number of initial tokens of this place. */ - uint_fast64_t getNumberOfInitialTokens() const; + uint64_t getNumberOfInitialTokens() const; /*! * Sets the capacity of tokens of this place. @@ -76,10 +71,10 @@ namespace storm { bool hasRestrictedCapacity() const; private: // contains the number of initial tokens of this place - uint_fast64_t numberOfInitialTokens = 0; + uint64_t numberOfInitialTokens = 0; // unique id (is used to refer to a specific place in a bitvector) - uint_fast64_t id = 0; + uint64_t id = 0; // name which is used in pnml file std::string name;