Base class for objects which have an id.
int sourceNumber() const
Returns the number of sources.
RandomDistributor< std::string > mySources
Container of weighted sources.
void addSource(const std::string &id, double weight)
Adds a source connection.
RandomDistributor< std::string > mySinks
Container of weighted sinks.
void addSink(const std::string &id, double weight)
Adds a sink connection.
ODDistrict(const std::string &id)
Constructor.
int sinkNumber() const
Returns the number of sinks.
std::string getRandomSink() const
Returns the id of a sink to use.
std::string getRandomSource() const
Returns the id of a source to use.
T get(SumoRNG *which=nullptr) const
Draw a sample of the distribution.
bool add(T val, double prob, bool checkDuplicates=true)
Adds a value with an assigned probability to the distribution.
const std::vector< T > & getVals() const
Returns the members of the distribution.