NIVissimEdge::connection_position_sorter Class Reference


Detailed Description

Sorts connections the edge participates in by their position along the given edge

Definition at line 223 of file NIVissimEdge.h.


Public Member Functions

 connection_position_sorter (int edgeid)
 constructor
int operator() (int c1id, int c2id) const
 comparing operation

Private Attributes

int myEdgeID
 The id of the edge.

Constructor & Destructor Documentation

NIVissimEdge::connection_position_sorter::connection_position_sorter ( int  edgeid  )  [explicit]

constructor

Definition at line 70 of file NIVissimEdge.cpp.

00071         : myEdgeID(edgeid) {}


Member Function Documentation

int NIVissimEdge::connection_position_sorter::operator() ( int  c1id,
int  c2id 
) const

comparing operation

Definition at line 75 of file NIVissimEdge.cpp.

References NIVissimConnection::dictionary(), NIVissimConnection::getFromEdgeID(), NIVissimConnection::getFromPosition(), NIVissimConnection::getToPosition(), myEdgeID, and SUMOReal.

00076                         {
00077     NIVissimConnection *c1 = NIVissimConnection::dictionary(c1id);
00078     NIVissimConnection *c2 = NIVissimConnection::dictionary(c2id);
00079     SUMOReal pos1 =
00080         c1->getFromEdgeID()==myEdgeID
00081         ? c1->getFromPosition() : c1->getToPosition();
00082     SUMOReal pos2 =
00083         c2->getFromEdgeID()==myEdgeID
00084         ? c2->getFromPosition() : c2->getToPosition();
00085     return pos1<pos2;
00086 }


Field Documentation

The id of the edge.

Definition at line 233 of file NIVissimEdge.h.

Referenced by operator()().


The documentation for this class was generated from the following files:

Generated on Wed May 5 00:06:54 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6