 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
48 while (angle2 > 180.) {
51 while (angle2 < -180.) {
60 double rel =
relAngle(angle1, angle2);
71 std::stringstream strm1(
id);
74 std::stringstream strm2;
88 std::ifstream strm(file.c_str());
90 throw ProcessError(
"Could not load names of edges too keep from '" + file +
"'.");
98 into.insert(name.substr(5));
106 std::ifstream strm(file.c_str());
108 throw ProcessError(
"Could not load IDs from '" + file +
"'.");
110 while (strm.good()) {
111 std::string prefixedID;
114 into.insert(prefixedID.substr(prefix.size()));
122 const std::string::size_type sep_index = lane_id.rfind(
'_');
123 if (sep_index == std::string::npos) {
124 WRITE_ERROR(
"Invalid lane id '" + lane_id +
"' (missing '_').");
126 edge_id = lane_id.substr(0, sep_index);
127 std::string index_string = lane_id.substr(sep_index + 1);
131 WRITE_ERROR(
"Invalid lane index '" + index_string +
"' for lane '" + lane_id +
"'.");
static std::string normalIDRepresentation(const std::string &id)
converts the numerical id to its "normal" string representation
static double normRelAngle(double angle1, double angle2)
ensure that reverse relAngles (>=179.999) always count as turnarounds (-180)
static double relAngle(double angle1, double angle2)
computes the relative angle between the two angles
const Position & getPosition() const
static void loadPrefixedIDsFomFile(const std::string &file, const std::string prefix, std::set< std::string > &into)
Add prefixed ids defined in file.
static double distance(NBNode *node1, NBNode *node2)
returns the distance between both nodes
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
static void interpretLaneID(const std::string &lane_id, std::string &edge_id, int &index)
parses edge-id and index from lane-id
static int toInt(const std::string &sData)
converts a string into the integer value described by it by calling the char-type converter,...
Represents a single node (junction) during network building.
static void loadEdgesFromFile(const std::string &file, std::set< std::string > &into)
Add edge ids defined in file (either ID or edge:ID per line) into the given set.