22 #ifndef MSVehicleContainer_h
23 #define MSVehicleContainer_h
81 const VehicleVector&
top();
99 friend std::ostream&
operator << (std::ostream& strm,
114 bool operator()(
const VehicleDepartureVector& e1,
115 const VehicleDepartureVector& e2)
const;
125 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.
VehicleHeap array
The vehicle vector heap.
SUMOTime topTime() const
Returns the time the uppermost vehicle vector is assigned to.
void percolateDown(int hole)
Moves the elements down.
bool operator()(const VehicleDepartureVector &e) const
comparison operator
DepartFinder(SUMOTime time)
constructor
bool operator()(const VehicleDepartureVector &e1, const VehicleDepartureVector &e2) const
comparison operator
bool isEmpty() const
Returns the information whether the container is empty.
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.
MSVehicleContainer(size_t capacity=10)
Constructor.
size_t size() const
Returns the size of the container.
void add(SUMOVehicle *veh)
Adds a single vehicle.
const VehicleVector & top()
Returns the uppermost vehicle vector.
SUMOTime myTime
the searched departure time
bool anyWaitingFor(SUMOTime time) const
Returns the information whether any vehicles want to depart at the given time.
Sort-criterion for vehicle departure lists.
std::pair< SUMOTime, VehicleVector > VehicleDepartureVector
void showArray() const
Prints the container (the departure times)
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.