 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
19 #ifndef MSInsertionControl_h
20 #define MSInsertionControl_h
std::vector< Flow > myFlows
Container for periodical vehicle parameters.
SUMOTime myMaxDepartDelay
The maximum waiting time; vehicles waiting longer are deleted (-1: no deletion)
SUMOVehicleParameter * pars
The parameters.
bool myEagerInsertionCheck
Whether an edge on which a vehicle could not depart should be ignored in the same step.
Representation of a lane in the micro simulation.
int emitVehicles(SUMOTime time)
Emits vehicles that want to depart at the given time.
Static storage of an output device and its base (abstract) implementation.
int getPendingFlowCount() const
Returns the number of flows that are still active.
MSVehicleContainer::VehicleVector myPendingEmits
Buffers for vehicles that could not be inserted.
SUMOTime myPendingEmitsUpdateTime
Last time at which pending emits for each edge where counted.
MSInsertionControl(const MSInsertionControl &)
Invalidated copy constructor.
Representation of a vehicle.
MSVehicleControl & myVehicleControl
The assigned vehicle control (needed for vehicle re-insertion and deletion)
std::set< SUMOVehicle * > myEmitCandidates
Buffer for vehicles that may be inserted in the current step.
Structure representing possible vehicle parameter.
int getWaitingVehicleNo() const
Returns the number of waiting vehicles.
std::mt19937 myFlowRNG
A random number generator for probabilistic flows.
int myMaxVehicleNumber
Storage for maximum vehicle number.
SUMOTime computeRandomDepartOffset() const
compute (optional) random offset to the departure time
void adaptIntermodalRouter(MSNet::MSIntermodalRouter &router) const
std::mt19937 * getFlowRNG()
retrieve internal RNG
MSInsertionControl(MSVehicleControl &vc, SUMOTime maxDepartDelay, bool checkEdgesOnce, int maxVehicleNumber, SUMOTime randomDepartOffset)
Constructor.
int index
the running index
void saveState(OutputDevice &out)
Saves the current state into the given stream.
std::set< std::string > myFlowIDs
Cache for periodical vehicle ids for quicker checking.
Inserts vehicles into the network when their departure time is reached.
std::set< const SUMOVehicle * > myAbortedEmits
Set of vehicles which shall not be inserted anymore.
int getPendingEmits(const MSLane *lane)
return the number of pending emits for the given lane
void descheduleDeparture(const SUMOVehicle *veh)
stops trying to emit the given vehicle (and delete it)
void determineCandidates(SUMOTime time)
Checks for all vehicles whether they can be emitted.
std::map< const MSLane *, int > myPendingEmitsForLane
the number of pending emits for each edge in the current time step
std::vector< SUMOVehicle * > VehicleVector
definition of a list of vehicles which have the same departure time
MSInsertionControl & operator=(const MSInsertionControl &)
Invalidated assignment operator.
void add(SUMOVehicle *veh)
Adds a single vehicle for departure.
void checkCandidates(SUMOTime time, const bool preCheck)
Adds all vehicles that should have been emitted earlier to the refuse container.
void clearPendingVehicles(const std::string &route)
clears out all pending vehicles from a route, "" for all routes
bool addFlow(SUMOVehicleParameter *const pars, int index=-1)
Adds parameter for a vehicle flow for departure.
The class responsible for building and deletion of vehicles.
SUMOTime myMaxRandomDepartOffset
The maximum random offset to be added to vehicles departure times (non-negative)
MSVehicleContainer myAllVeh
All loaded vehicles sorted by their departure time.
Definition of vehicle flow with the current index for vehicle numbering.
int tryInsert(SUMOTime time, SUMOVehicle *veh, MSVehicleContainer::VehicleVector &refusedEmits)
Tries to emit the vehicle.
~MSInsertionControl()
Destructor.
Representation of a vehicle in the micro simulation.
void alreadyDeparted(SUMOVehicle *veh)
stops trying to emit the given vehicle (because it already departed)