Browse Source

Fixed problem with stormpy by changing boost::optional arguments to const& in GSPNs

tempestpy_adaptions
Matthias Volk 5 years ago
parent
commit
b8ac41f561
  1. 4
      src/storm-gspn/storage/gspn/GspnBuilder.cpp
  2. 4
      src/storm-gspn/storage/gspn/GspnBuilder.h
  3. 2
      src/storm-gspn/storage/gspn/Place.cpp
  4. 2
      src/storm-gspn/storage/gspn/Place.h

4
src/storm-gspn/storage/gspn/GspnBuilder.cpp

@ -13,7 +13,7 @@ namespace storm {
gspnName = name;
}
uint_fast64_t GspnBuilder::addPlace(boost::optional<uint64_t> capacity, uint_fast64_t const& initialTokens, std::string const& name) {
uint_fast64_t GspnBuilder::addPlace(boost::optional<uint64_t> 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<uint64_t> numServers, std::string const& name) {
uint_fast64_t GspnBuilder::addTimedTransition(uint_fast64_t const &priority, double const &rate, boost::optional<uint64_t> const& numServers, std::string const& name) {
auto trans = storm::gspn::TimedTransition<double>();
auto newId = GSPN::timedTransitionIdToTransitionId(timedTransitions.size());
trans.setName(name);

4
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<uint64_t> capacity = 1, uint_fast64_t const& initialTokens = 0, std::string const& name = "");
uint_fast64_t addPlace(boost::optional<uint64_t> 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<uint64_t> numServers, std::string const& name = "");
uint_fast64_t addTimedTransition(uint_fast64_t const &priority, RateType const& rate, boost::optional<uint64_t> const& numServers, std::string const& name = "");
void setTransitionLayoutInfo(uint64_t transitionId, LayoutInfo const& layoutInfo);

2
src/storm-gspn/storage/gspn/Place.cpp

@ -29,7 +29,7 @@ namespace storm {
return this->numberOfInitialTokens;
}
void Place::setCapacity(boost::optional<uint64_t> cap) {
void Place::setCapacity(boost::optional<uint64_t> const& cap) {
this->capacity = cap;
}

2
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<uint64_t> capacity);
void setCapacity(boost::optional<uint64_t> const& capacity);
/*!
* Returns the capacity of tokens of this place.

Loading…
Cancel
Save