 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
65 myName(name), myFromDef(from_def), myToDef(to_def),
66 myAssignedVehicles(assignedVehicles), myClosedLanes(clv) {}
79 DictType::iterator i =
myDict.find(
id);
91 DictType::iterator i =
myDict.find(
id);
101 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
105 std::vector<int> connections =
108 std::vector<int>(),
true);
119 std::vector<int> ret;
120 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
121 if ((*i).second->crosses(poly)) {
122 ret.push_back((*i).second->myID);
141 std::vector<int> ret;
142 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
143 int connID = (*i).first;
144 if ((*i).second->myFromDef.getEdgeID() == edgeid
146 (*i).second->myToDef.getEdgeID() == edgeid) {
147 if (!(*i).second->hasNodeCluster()) {
148 ret.push_back(connID);
212 int unsetConnections = 0;
214 NBEdge* fromEdge =
nullptr;
220 if (vissimFrom !=
nullptr) {
230 if (vissimTo !=
nullptr) {
242 if (fromEdge ==
nullptr || toEdge ==
nullptr) {
248 const std::vector<int>& toLanes =
getToLanes();
249 if (fromLanes.size() != toLanes.size()) {
252 for (
int index = 0; index < (int)fromLanes.size(); ++index) {
262 return unsetConnections;
268 int unsetConnections = 0;
270 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
271 unsetConnections += (*i).second->buildEdgeConnections(ec);
273 if (unsetConnections != 0) {
274 WRITE_WARNING(toString<int>(unsetConnections) +
" of " + toString<int>((
int)
myDict.size()) +
" connections could not be assigned.");
279 const std::vector<int>&
285 const std::vector<int>&
307 for (DictType::iterator i =
myDict.begin(); i !=
myDict.end(); i++) {
static void dict_assignToEdges()
std::vector< NIVissimClosedLaneDef * > NIVissimClosedLanesVector
int buildEdgeConnections(NBEdgeCont &ec)
void setNodeCluster(int nodeid)
#define WRITE_WARNING(msg)
Storage for edges, including some functionality operating on multiple edges.
const Boundary & getBoundingBox() const
A temporary storage for edges imported from Vissim.
bool wasWithinAJunction() const
Returns whether this edge was found to be within a junction.
double getToPosition() const
const std::vector< int > & getLanes() const
void recheckLanes(const NBEdge *const fromEdge, const NBEdge *const toEdge)
Resets lane numbers if all lanes shall be used.
Position getToGeomPosition() const
double xmax() const
Returns maximum x-coordinate.
static bool dictionary(int id, NIVissimNodeCluster *o)
static std::vector< int > getForEdge(int edgeid, bool omitNodeAssigned=true)
NIVissimExtendedEdgePoint myToDef
The representation of a single edge during network building.
static bool dictionary(int id, const std::string &name, const std::string &type, int noLanes, double zuschlag1, double zuschlag2, double length, const PositionVector &geom, const NIVissimClosedLanesVector &clv)
Adds the described item to the dictionary Builds the edge first.
Position getFromGeomPosition() const
NIVissimConnection(int id, const std::string &name, const NIVissimExtendedEdgePoint &from_def, const NIVissimExtendedEdgePoint &to_def, const PositionVector &geom, const std::vector< int > &assignedVehicles, const NIVissimClosedLanesVector &clv)
bool addLane2LaneConnection(int fromLane, NBEdge *dest, int toLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED)
Adds a connection between the specified this edge's lane and an approached one.
double xmin() const
Returns minimum x-coordinate.
A class that stores a 2D geometrical boundary.
int getNumLanes() const
Returns the number of lanes.
NBEdge * retrievePossiblySplit(const std::string &id, bool downstream) const
Tries to retrieve an edge, even if it is splitted.
virtual ~NIVissimConnection()
A point in 2D or 3D with translation and scaling methods.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
double getFromPosition() const
NIVissimEdge * getBestIncoming() const
void recheckLanes(const NBEdge *const edge)
Resets lane numbers if all lanes shall be used.
The connection was computed and validated.
static void dict_buildNBEdgeConnections(NBEdgeCont &ec)
NIVissimEdge * getBestOutgoing() const
NIVissimClosedLanesVector myClosedLanes
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const std::vector< int > & getToLanes() const
std::map< int, NIVissimConnection * > DictType
static std::vector< int > getWithin(const AbstractPoly &poly)
const std::vector< int > & getFromLanes() const
Position getGeomPosition() const
NIVissimExtendedEdgePoint myFromDef
static bool dictionary(int id, NIVissimConnection *o)
int getFromEdgeID() const
static void buildNodeClusters()
double getPosition() const
const std::string & getID() const