22 #ifndef MSVehicleContainer_h 23 #define MSVehicleContainer_h 83 const VehicleVector&
top();
101 friend std::ostream&
operator << (std::ostream& strm,
116 bool operator()(
const VehicleDepartureVector& e1,
117 const VehicleDepartureVector& e2)
const;
127 bool operator()(
const VehicleDepartureVector& e)
const;
friend std::ostream & operator<<(std::ostream &strm, MSVehicleContainer &cont)
Prints the contents of the container.
Representation of a vehicle in the micro simulation.
int size() const
Returns the size of the container.
VehicleHeap array
The vehicle vector heap.
void percolateDown(int hole)
Moves the elements down.
bool isEmpty() const
Returns the information whether the container is empty.
bool anyWaitingBefore(SUMOTime time) const
Returns the information whether any vehicles want to depart before the given time.
bool operator()(const VehicleDepartureVector &e1, const VehicleDepartureVector &e2) const
comparison operator
std::vector< SUMOVehicle * > VehicleVector
definition of a list of vehicles which have the same departure time
int currentSize
Number of elements in heap.
void pop()
Removes the uppermost vehicle vector.
std::vector< VehicleDepartureVector > VehicleHeap
Definition of the heap type.
Representation of a vehicle.
void add(SUMOVehicle *veh)
Adds a single vehicle.
void showArray() const
Prints the container (the departure times)
const VehicleVector & top()
Returns the uppermost vehicle vector.
SUMOTime myTime
the searched departure time
MSVehicleContainer(int capacity=10)
Constructor.
SUMOTime topTime() const
Returns the time the uppermost vehicle vector is assigned to.
Sort-criterion for vehicle departure lists.
std::pair< SUMOTime, VehicleVector > VehicleDepartureVector
void addReplacing(const VehicleDepartureVector &cont)
Replaces the existing single departure time vector by the one given.
Searches for the VehicleDepartureVector with the wished depart.
~MSVehicleContainer()
Destructor.