 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
47 :
Named(id), myPosition(0, 0) {}
76 assert(source->
getID() !=
"");
83 EdgeVector::iterator i = std::find(
mySinks.begin(),
mySinks.end(), sink);
89 assert(sink->
getID() !=
"");
105 double joinedVal = 0;
107 EdgeVector::iterator i =
mySinks.begin();
109 for (; i !=
mySinks.end(); i++, j++) {
112 if (find(which.begin(), which.end(), tmp) == which.end()) {
115 newList.push_back(tmp);
116 newWeights.push_back(val);
124 newList.push_back(by);
125 newWeights.push_back(joinedVal);
137 double joinedVal = 0;
139 EdgeVector::iterator i =
mySources.begin();
144 if (find(which.begin(), which.end(), tmp) == which.end()) {
147 newList.push_back(tmp);
148 newWeights.push_back(val);
156 newList.push_back(by);
157 newWeights.push_back(joinedVal);
167 for (i = 0; i < (int)
mySinks.size(); ++i) {
173 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