46 :
Named(id), myPosition(0, 0) {}
75 assert(source->
getID() !=
"");
82 EdgeVector::iterator i = std::find(
mySinks.begin(),
mySinks.end(), sink);
88 assert(sink->
getID() !=
"");
104 double joinedVal = 0;
106 EdgeVector::iterator i =
mySinks.begin();
108 for (; i !=
mySinks.end(); i++, j++) {
111 if (find(which.begin(), which.end(), tmp) == which.end()) {
114 newList.push_back(tmp);
115 newWeights.push_back(val);
123 newList.push_back(by);
124 newWeights.push_back(joinedVal);
136 double joinedVal = 0;
138 EdgeVector::iterator i =
mySources.begin();
143 if (find(which.begin(), which.end(), tmp) == which.end()) {
146 newList.push_back(tmp);
147 newWeights.push_back(val);
155 newList.push_back(by);
156 newWeights.push_back(joinedVal);
166 for (i = 0; i < (int)
mySinks.size(); ++i) {
172 for (i = 0; i < (int)
mySources.size(); ++i) {
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
bool addSink(NBEdge *const sink, double weight)
Adds a sink.
Position myPosition
The position of the district.
std::vector< double > WeightsCont
Definition of a vector of connection weights.
void mirrorX()
mirror coordinates along the x-axis
NBDistrict(const std::string &id, const Position &pos)
Constructor with id, and position.
void replaceIncoming(const EdgeVector &which, NBEdge *const by)
Replaces incoming edges from the vector (sinks) by the given edge.
EdgeVector mySources
The sources (connection from district to network)
void addShape(const PositionVector &p)
Sets the shape of this district.
bool addSource(NBEdge *const source, double weight)
Adds a source.
EdgeVector mySinks
The sinks (connection from network to district)
void replaceOutgoing(const EdgeVector &which, NBEdge *const by)
Replaces outgoing edges from the vector (source) by the given edge.
void reshiftPosition(double xoff, double yoff)
Applies an offset to the district.
WeightsCont mySourceWeights
The weights of the sources.
void setCenter(const Position &pos)
Sets the center coordinates.
PositionVector myShape
The shape of the dsitrict.
WeightsCont mySinkWeights
The weights of the sinks.
void removeFromSinksAndSources(NBEdge *const e)
Removes the given edge from the lists of sources and sinks.
The representation of a single edge during network building.
const std::string & getID() const
Base class for objects which have an id.
A point in 2D or 3D with translation and scaling methods.
void add(const Position &pos)
Adds the given position to this one.
void mul(double val)
Multiplies position with the given value.
void add(double xoff, double yoff, double zoff)
Some static methods for string processing.