Skip to content

Commit 3055ccd

Browse files
committed
Docs
1 parent 0414257 commit 3055ccd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/dsf/mobility/RoadNetwork.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ namespace dsf::mobility {
190190
requires is_street_v<std::remove_reference_t<T1>> &&
191191
(is_street_v<std::remove_reference_t<Tn>> && ...)
192192
void addStreets(T1&& street, Tn&&... streets);
193-
193+
/// @brief Set the streets' stationary weights
194+
/// @param streetWeights A map where the key is the street id and the value is the street stationary weight. If a street id is not present in the map, its stationary weight is set to 1.0.
194195
void setStreetStationaryWeights(std::unordered_map<Id, double> const& streetWeights);
195196

196197
/// @brief Get a street from the graph

src/dsf/mobility/Street.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ namespace dsf::mobility {
8686
static void setMeanVehicleLength(double meanVehicleLength);
8787
/// @brief Set the street's stationary weight
8888
/// @param weight The street's stationary weight
89-
inline void setStationaryWeight(double const weight) { m_stationaryWeight = weight; }
89+
inline void setStationaryWeight(double const weight) {
90+
weight > 0. ? m_stationaryWeight = weight
91+
: throw std::invalid_argument("Stationary weight must be positive");
92+
}
9093
/// @brief Enable a coil (dsf::Counter sensor) on the street
9194
/// @param name The name of the counter (default is "Coil_<street_id>")
9295
void enableCounter(std::string name = std::string());

0 commit comments

Comments
 (0)