77 assert(source->
getID() !=
"");
84 EdgeVector::iterator i = find(
mySinks.begin(),
mySinks.end(), sink);
90 assert(sink->
getID() !=
"");
106 double joinedVal = 0;
108 EdgeVector::iterator i =
mySinks.begin();
110 for (; i !=
mySinks.end(); i++, j++) {
113 if (find(which.begin(), which.end(), tmp) == which.end()) {
116 newList.push_back(tmp);
117 newWeights.push_back(val);
125 newList.push_back(by);
126 newWeights.push_back(joinedVal);
138 double joinedVal = 0;
140 EdgeVector::iterator i =
mySources.begin();
145 if (find(which.begin(), which.end(), tmp) == which.end()) {
148 newList.push_back(tmp);
149 newWeights.push_back(val);
157 newList.push_back(by);
158 newWeights.push_back(joinedVal);
168 for (i = 0; i < (int)
mySinks.size(); ++i) {
174 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.