45 #ifdef CHECK_MEMORY_LEAKS
47 #endif // CHECK_MEMORY_LEAKS
59 :
Named(id), myPosition(0, 0) {}
81 assert(source->
getID() !=
"");
88 EdgeVector::iterator i = find(
mySinks.begin(),
mySinks.end(), sink);
94 assert(sink->
getID() !=
"");
112 EdgeVector::iterator i =
mySinks.begin();
114 for (; i !=
mySinks.end(); i++, j++) {
117 if (find(which.begin(), which.end(), tmp) == which.end()) {
120 newList.push_back(tmp);
121 newWeights.push_back(val);
129 newList.push_back(by);
130 newWeights.push_back(joinedVal);
144 EdgeVector::iterator i =
mySources.begin();
149 if (find(which.begin(), which.end(), tmp) == which.end()) {
152 newList.push_back(tmp);
153 newWeights.push_back(val);
161 newList.push_back(by);
162 newWeights.push_back(joinedVal);
172 for (i = 0; i <
mySinks.size(); ++i) {
void replaceOutgoing(const EdgeVector &which, NBEdge *const by)
Replaces outgoing edges from the vector (source) by the given edge.
void reshiftRotate(SUMOReal xoff, SUMOReal yoff, SUMOReal rot)
WeightsCont mySinkWeights
The weights of the sinks.
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 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.
const std::string & getID() const
Returns the id.
void reshiftRotate(SUMOReal xoff, SUMOReal yoff, SUMOReal rot)
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.
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
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.