From b8ac41f561b175c8469f85d75c6cb9148253112b Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Mon, 30 Mar 2020 18:11:13 +0200 Subject: [PATCH] Fixed problem with stormpy by changing boost::optional arguments to const& in GSPNs --- src/storm-gspn/storage/gspn/GspnBuilder.cpp | 4 ++-- src/storm-gspn/storage/gspn/GspnBuilder.h | 4 ++-- src/storm-gspn/storage/gspn/Place.cpp | 2 +- src/storm-gspn/storage/gspn/Place.h | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/storm-gspn/storage/gspn/GspnBuilder.cpp b/src/storm-gspn/storage/gspn/GspnBuilder.cpp index c39b5c0f7..41ef64f96 100644 --- a/src/storm-gspn/storage/gspn/GspnBuilder.cpp +++ b/src/storm-gspn/storage/gspn/GspnBuilder.cpp @@ -13,7 +13,7 @@ namespace storm { gspnName = name; } - uint_fast64_t GspnBuilder::addPlace(boost::optional capacity, uint_fast64_t const& initialTokens, std::string const& name) { + uint_fast64_t GspnBuilder::addPlace(boost::optional const& capacity, uint_fast64_t const& initialTokens, std::string const& name) { auto newId = places.size(); auto place = storm::gspn::Place(newId); place.setCapacity(capacity); @@ -70,7 +70,7 @@ namespace storm { return addTimedTransition(priority, rate, 1, name); } - uint_fast64_t GspnBuilder::addTimedTransition(uint_fast64_t const &priority, double const &rate, boost::optional numServers, std::string const& name) { + uint_fast64_t GspnBuilder::addTimedTransition(uint_fast64_t const &priority, double const &rate, boost::optional const& numServers, std::string const& name) { auto trans = storm::gspn::TimedTransition(); auto newId = GSPN::timedTransitionIdToTransitionId(timedTransitions.size()); trans.setName(name); diff --git a/src/storm-gspn/storage/gspn/GspnBuilder.h b/src/storm-gspn/storage/gspn/GspnBuilder.h index 5e4db4a34..fb4cd2ad7 100644 --- a/src/storm-gspn/storage/gspn/GspnBuilder.h +++ b/src/storm-gspn/storage/gspn/GspnBuilder.h @@ -25,7 +25,7 @@ namespace storm { * A capacity of -1 indicates an unbounded place. * @param initialTokens The number of inital tokens in the place. */ - uint_fast64_t addPlace(boost::optional capacity = 1, uint_fast64_t const& initialTokens = 0, std::string const& name = ""); + uint_fast64_t addPlace(boost::optional const& capacity = 1, uint_fast64_t const& initialTokens = 0, std::string const& name = ""); void setPlaceLayoutInfo(uint64_t placeId, LayoutInfo const& layoutInfo); @@ -51,7 +51,7 @@ namespace storm { * @param rate The rate for the transition. * @param numServers The number of servers this transition has (in case of K-Server semantics) or boost::none (in case of Infinite-Server-Semantics). */ - uint_fast64_t addTimedTransition(uint_fast64_t const &priority, RateType const& rate, boost::optional numServers, std::string const& name = ""); + uint_fast64_t addTimedTransition(uint_fast64_t const &priority, RateType const& rate, boost::optional const& numServers, std::string const& name = ""); void setTransitionLayoutInfo(uint64_t transitionId, LayoutInfo const& layoutInfo); diff --git a/src/storm-gspn/storage/gspn/Place.cpp b/src/storm-gspn/storage/gspn/Place.cpp index ca9a4a9e1..8d7347936 100644 --- a/src/storm-gspn/storage/gspn/Place.cpp +++ b/src/storm-gspn/storage/gspn/Place.cpp @@ -29,7 +29,7 @@ namespace storm { return this->numberOfInitialTokens; } - void Place::setCapacity(boost::optional cap) { + void Place::setCapacity(boost::optional const& cap) { this->capacity = cap; } diff --git a/src/storm-gspn/storage/gspn/Place.h b/src/storm-gspn/storage/gspn/Place.h index 55c9da6fb..b6a8b4ca1 100644 --- a/src/storm-gspn/storage/gspn/Place.h +++ b/src/storm-gspn/storage/gspn/Place.h @@ -56,7 +56,7 @@ namespace storm { * @param capacity The capacity of this place. A non-negative number represents the capacity. * boost::none indicates that the flag is not set. */ - void setCapacity(boost::optional capacity); + void setCapacity(boost::optional const& capacity); /*! * Returns the capacity of tokens of this place.