 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
41 street(&str), position(pos), pos2d(compute2dPosition()) {
46 street(&str), position(randomPositionInStreet(str)), pos2d(compute2dPosition()) {
70 double minDist = std::numeric_limits<double>::infinity();
72 std::list<AGPosition>::const_iterator itt;
74 for (itt = positions.begin(); itt != positions.end(); ++itt) {
76 if (tempDist < minDist) {
86 double minDist = std::numeric_limits<double>::infinity();
88 std::map<int, AGPosition>::const_iterator itt;
90 for (itt = positions.begin(); itt != positions.end(); ++itt) {
92 if (tempDist < minDist) {
125 position2d.
sub(From);
127 position2d.
add(From);
static double randomPositionInStreet(const AGStreet &street)
Determines a random relative position on a street.
double minDistanceTo(const std::list< AGPosition > &positions) const
Computes the distance to the closest position in a list.
double distanceTo(const AGPosition &otherPos) const
Computes the distance between two AGPosition objects.
bool operator==(const AGPosition &pos) const
Tests whether two positions are at the same place.
double getPosition() const
Provides the relative position of this AGPosition on the street.
bool almostSame(const Position &p2, double maxDiv=POSITION_EPS) const
check if two position is almost the sme as other
static double rand(std::mt19937 *rng=0)
Returns a random real number in [0, 1)
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
A point in 2D or 3D with translation and scaling methods.
A model of the street in the city.
void sub(double dx, double dy)
Substracts the given position from this one.
void mul(double val)
Multiplies both positions with the given value.
const RONode * getFromJunction() const
AGPosition(const AGStreet &str, double pos)
Constructs an AGPosition at a certain point on a street.
void print() const
Prints out a summary of the properties of this class on standard output.
A location in the 2D plane freely positioned on a street.
double getLength() const
Returns the length of the edge.
const AGStreet & getStreet() const
Provides the street this AGPosition is located on.
void add(const Position &pos)
Adds the given position to this one.
Position compute2dPosition() const
const Position & getPosition() const
Returns the position of the node.
const RONode * getToJunction() const