84 assert(source->
getID() !=
"");
91 EdgeVector::iterator i = find(
mySinks.begin(),
mySinks.end(), sink);
97 assert(sink->
getID() !=
"");
113 double joinedVal = 0;
115 EdgeVector::iterator i =
mySinks.begin();
117 for (; i !=
mySinks.end(); i++, j++) {
120 if (find(which.begin(), which.end(), tmp) == which.end()) {
123 newList.push_back(tmp);
124 newWeights.push_back(val);
132 newList.push_back(by);
133 newWeights.push_back(joinedVal);
145 double joinedVal = 0;
147 EdgeVector::iterator i =
mySources.begin();
152 if (find(which.begin(), which.end(), tmp) == which.end()) {
155 newList.push_back(tmp);
156 newWeights.push_back(val);
164 newList.push_back(by);
165 newWeights.push_back(joinedVal);
175 for (i = 0; i < (int)
mySinks.size(); ++i) {
181 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.