ROVehicleByDepartureComperator Class Reference

#include <ROHelper.h>

Inheritance diagram for ROVehicleByDepartureComperator:

less

Detailed Description

A function for sorting vehicles by their departure time.

In the case two vehicles have the same departure time, they are sorted lexically.

Definition at line 48 of file ROHelper.h.


Public Member Functions

bool operator() (ROVehicle *veh1, ROVehicle *veh2) const throw ()
 Comparing operator.
 ROVehicleByDepartureComperator () throw ()
 Constructor.
 ~ROVehicleByDepartureComperator () throw ()
 Destructor.

Constructor & Destructor Documentation

ROVehicleByDepartureComperator::ROVehicleByDepartureComperator (  )  throw () [inline, explicit]

Constructor.

Definition at line 51 of file ROHelper.h.

00051 { }

ROVehicleByDepartureComperator::~ROVehicleByDepartureComperator (  )  throw () [inline]

Destructor.

Definition at line 54 of file ROHelper.h.

00054 { }


Member Function Documentation

bool ROVehicleByDepartureComperator::operator() ( ROVehicle veh1,
ROVehicle veh2 
) const throw () [inline]

Comparing operator.

Returns whether the first vehicles wants to leave later than the second. If both vehicles have the same departure time, a lexical comparison is done.

Parameters:
i] veh1 The first vehicle to compare
i] veh2 The second vehicle to compare
Returns:
Whether the first vehicle departs later than the second
Todo:
Check whether both vehicles can be const

Definition at line 67 of file ROHelper.h.

00067                                                                     {
00068         if (veh1->getDepartureTime()==veh2->getDepartureTime()) {
00069             return veh1->getID()>veh2->getID();
00070         }
00071         return veh1->getDepartureTime()>veh2->getDepartureTime();
00072     }


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

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