 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
48 :
Named(id), myPosition(0, 0) {}
77 assert(source->
getID() !=
"");
84 EdgeVector::iterator i = std::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) {
NBDistrict(const std::string &id, const Position &pos)
Constructor with id, and position.
EdgeVector mySinks
The sinks (connection from network to district)
Base class for objects which have an id.
void replaceOutgoing(const EdgeVector &which, NBEdge *const by)
Replaces outgoing edges from the vector (source) by the given edge.
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
The representation of a single edge during network building.
PositionVector myShape
The shape of the dsitrict.
void add(double xoff, double yoff, double zoff)
void removeFromSinksAndSources(NBEdge *const e)
Removes the given edge from the lists of sources and sinks.
void reshiftPosition(double xoff, double yoff)
Applies an offset to the district.
void addShape(const PositionVector &p)
Sets the shape of this district.
std::vector< double > WeightsCont
Definition of a vector of connection weights.
A point in 2D or 3D with translation and scaling methods.
WeightsCont mySinkWeights
The weights of the sinks.
void mul(double val)
Multiplies both positions with the given value.
Some static methods for string processing.
Position myPosition
The position of the district.
bool addSink(NBEdge *const sink, double weight)
Adds a sink.
void mirrorX()
mirror coordinates along the x-axis
void add(const Position &pos)
Adds the given position to this one.
void setCenter(const Position &pos)
Sets the center coordinates.
WeightsCont mySourceWeights
The weights of the sources.
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.
EdgeVector mySources
The sources (connection from district to network)
const std::string & getID() const