83 assert(source->
getID() !=
"");
90 EdgeVector::iterator i = find(
mySinks.begin(),
mySinks.end(), sink);
96 assert(sink->
getID() !=
"");
112 double joinedVal = 0;
114 EdgeVector::iterator i =
mySinks.begin();
116 for (; i !=
mySinks.end(); i++, j++) {
119 if (find(which.begin(), which.end(), tmp) == which.end()) {
122 newList.push_back(tmp);
123 newWeights.push_back(val);
131 newList.push_back(by);
132 newWeights.push_back(joinedVal);
144 double joinedVal = 0;
146 EdgeVector::iterator i =
mySources.begin();
151 if (find(which.begin(), which.end(), tmp) == which.end()) {
154 newList.push_back(tmp);
155 newWeights.push_back(val);
163 newList.push_back(by);
164 newWeights.push_back(joinedVal);
174 for (i = 0; i < (int)
mySinks.size(); ++i) {
180 for (i = 0; i < (int)
mySources.size(); ++i) {
void replaceOutgoing(const EdgeVector &which, NBEdge *const by)
Replaces outgoing edges from the vector (source) by the given edge.
WeightsCont mySinkWeights
The weights of the sinks.
void add(const Position &pos)
Adds the given position to this one.
Some static methods for string processing.
The representation of a single edge during network building.
std::vector< double > WeightsCont
Definition of a vector of connection weights.
void mirrorX()
mirror coordinates along the x-axis
const std::string & getID() const
Returns the id.
void reshiftPosition(double xoff, double yoff)
Applies an offset to the district.
void addShape(const PositionVector &p)
Sets the shape of this district.
NBDistrict(const std::string &id, const Position &pos)
Constructor with id, and position.
EdgeVector mySources
The sources (connection from district to network)
void setCenter(const Position &pos)
Sets the center coordinates.
Position myPosition
The position of the district.
A point in 2D or 3D with translation and scaling methods.
void removeFromSinksAndSources(NBEdge *const e)
Removes the given edge from the lists of sources and sinks.
Base class for objects which have an id.
bool addSink(NBEdge *const sink, double weight)
Adds a sink.
EdgeVector mySinks
The sinks (connection from network to district)
WeightsCont mySourceWeights
The weights of the sources.
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
PositionVector myShape
The shape of the dsitrict.
void mul(double val)
Multiplies both positions with the given value.
void add(double xoff, double yoff, double zoff)
bool addSource(NBEdge *const source, double weight)
Adds a source.
void replaceIncoming(const EdgeVector &which, NBEdge *const by)
Replaces incoming edges from the vector (sinks) by the given edge.