50 std::cout <<
"- AGPosition: *Street=" <<
street <<
" position=" <<
position <<
"/" <<
street->getLength() << std::endl;
68 double minDist = std::numeric_limits<double>::infinity();
70 std::list<AGPosition>::const_iterator itt;
72 for (itt = positions.begin(); itt != positions.end(); ++itt) {
74 if (tempDist < minDist) {
84 double minDist = std::numeric_limits<double>::infinity();
86 std::map<int, AGPosition>::const_iterator itt;
88 for (itt = positions.begin(); itt != positions.end(); ++itt) {
90 if (tempDist < minDist) {
123 position2d.
sub(From);
125 position2d.
add(From);
double getPosition() const
Provides the relative position of this AGPosition on the street.
double distanceTo(const AGPosition &otherPos) const
Computes the distance between two AGPosition objects.
const AGStreet & getStreet() const
Provides the street this AGPosition is located on.
void print() const
Prints out a summary of the properties of this class on standard output.
bool operator==(const AGPosition &pos) const
Tests whether two positions are at the same place.
double minDistanceTo(const std::list< AGPosition > &positions) const
Computes the distance to the closest position in a list.
static double randomPositionInStreet(const AGStreet &street)
Determines a random relative position on a street.
AGPosition(const AGStreet &str, double pos)
Constructs an AGPosition at a certain point on a street.
Position compute2dPosition() const
A model of the street in the city.
A point in 2D or 3D with translation and scaling methods.
void sub(double dx, double dy)
Subtracts the given position from this one.
void add(const Position &pos)
Adds the given position to this one.
void mul(double val)
Multiplies position with the given value.
double getLength() const
Returns the length of the edge.
static double rand(SumoRNG *rng=nullptr)
Returns a random real number in [0, 1).