45 #ifdef CHECK_MEMORY_LEAKS 47 #endif // CHECK_MEMORY_LEAKS 88 assert(source->
getID() !=
"");
95 EdgeVector::iterator i = find(
mySinks.begin(),
mySinks.end(), sink);
101 assert(sink->
getID() !=
"");
119 EdgeVector::iterator i =
mySinks.begin();
121 for (; i !=
mySinks.end(); i++, j++) {
124 if (find(which.begin(), which.end(), tmp) == which.end()) {
127 newList.push_back(tmp);
128 newWeights.push_back(val);
136 newList.push_back(by);
137 newWeights.push_back(joinedVal);
151 EdgeVector::iterator i =
mySources.begin();
156 if (find(which.begin(), which.end(), tmp) == which.end()) {
159 newList.push_back(tmp);
160 newWeights.push_back(val);
168 newList.push_back(by);
169 newWeights.push_back(joinedVal);
179 for (i = 0; i < (int)
mySinks.size(); ++i) {
185 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.
bool addSource(NBEdge *const source, SUMOReal weight)
Adds a source.
The representation of a single edge during network building.
void mirrorX()
mirror coordinates along the x-axis
const std::string & getID() const
Returns the id.
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 add(SUMOReal xoff, SUMOReal yoff, SUMOReal zoff)
void removeFromSinksAndSources(NBEdge *const e)
Removes the given edge from the lists of sources and sinks.
Base class for objects which have an id.
EdgeVector mySinks
The sinks (connection from network to district)
WeightsCont mySourceWeights
The weights of the sources.
std::vector< SUMOReal > WeightsCont
Definition of a vector of connection weights.
bool addSink(NBEdge *const sink, SUMOReal weight)
Adds a sink.
std::vector< NBEdge * > EdgeVector
void mul(SUMOReal val)
Multiplies both positions with the given value.
PositionVector myShape
The shape of the dsitrict.
void reshiftPosition(SUMOReal xoff, SUMOReal yoff)
Applies an offset to the district.
void replaceIncoming(const EdgeVector &which, NBEdge *const by)
Replaces incoming edges from the vector (sinks) by the given edge.