218 static double initScale(
const std::string vtypeid);
Inserts vehicles into the network when their departure time is reached.
std::vector< Flow > myFlows
Container for periodical vehicle parameters.
const MSVehicleContainer::VehicleVector & getPendingVehicles() const
retrieve vehicles waiting for insertion
void adaptIntermodalRouter(MSTransportableRouter &router) const
int getWaitingVehicleNo() const
Returns the number of waiting vehicles.
void clearPendingVehicles(const std::string &route)
clears out all pending vehicles from a route, "" for all routes
std::map< const MSLane *, int > myPendingEmitsForLane
the number of pending emits for each edge in the current time step
int tryInsert(SUMOTime time, SUMOVehicle *veh, MSVehicleContainer::VehicleVector &refusedEmits)
Tries to emit the vehicle.
bool myEagerInsertionCheck
Whether an edge on which a vehicle could not depart should be ignored in the same step.
SUMOVehicle * getLastFlowVehicle(const std::string &id) const
return the last vehicle for the given flow
int emitVehicles(SUMOTime time)
Emits vehicles that want to depart at the given time.
int getPendingEmits(const MSLane *lane)
return the number of pending emits for the given lane
bool addFlow(SUMOVehicleParameter *const pars, int index=-1)
Adds parameter for a vehicle flow for departure.
MSInsertionControl & operator=(const MSInsertionControl &)
Invalidated assignment operator.
bool hasFlow(const std::string &id) const
checks whether the given flow still exists
const SUMOVehicleParameter * getFlowPars(const std::string &id) const
return parameters for the given flow
SUMOTime myPendingEmitsUpdateTime
Last time at which pending emits for each edge where counted.
void retractDescheduleDeparture(const SUMOVehicle *veh)
reverts a previous call to descheduleDeparture (only needed for departPos="random_free")
std::set< SUMOVehicle * > myEmitCandidates
Buffer for vehicles that may be inserted in the current step.
void alreadyDeparted(SUMOVehicle *veh)
stops trying to emit the given vehicle (because it already departed)
SUMOTime myMaxRandomDepartOffset
The maximum random offset to be added to vehicles departure times (non-negative)
MSVehicleContainer::VehicleVector myPendingEmits
Buffers for vehicles that could not be inserted.
MSVehicleControl & myVehicleControl
The assigned vehicle control (needed for vehicle re-insertion and deletion)
std::map< std::string, int > myFlowIDs
Cache for periodical vehicle ids and their most recent index for quicker checking.
void add(SUMOVehicle *veh)
Adds a single vehicle for departure.
void determineCandidates(SUMOTime time)
Checks for all vehicles whether they can be emitted.
void updateScale(const std::string vtypeid)
updates the flow scale value to keep track of TraCI-induced change
void checkCandidates(SUMOTime time, const bool preCheck)
Adds all vehicles that should have been emitted earlier to the refuse container.
MSInsertionControl(const MSInsertionControl &)
Invalidated copy constructor.
int getPendingFlowCount() const
Returns the number of flows that are still active.
std::set< const SUMOVehicle * > myAbortedEmits
Set of vehicles which shall not be inserted anymore.
void clearState()
Remove all vehicles before quick-loading state.
int myMaxVehicleNumber
Storage for maximum vehicle number.
SumoRNG * getFlowRNG()
retrieve internal RNG
void saveState(OutputDevice &out)
Saves the current state into the given stream.
SUMOTime myMaxDepartDelay
The maximum waiting time; vehicles waiting longer are deleted (-1: no deletion)
void descheduleDeparture(const SUMOVehicle *veh)
stops trying to emit the given vehicle (and delete it)
MSVehicleContainer myAllVeh
All loaded vehicles sorted by their departure time.
~MSInsertionControl()
Destructor.
SUMOTime computeRandomDepartOffset() const
compute (optional) random offset to the departure time
SumoRNG myFlowRNG
A random number generator for probabilistic flows.
static double initScale(const std::string vtypeid)
init scale value of flow
Representation of a lane in the micro simulation.
std::vector< SUMOVehicle * > VehicleVector
definition of a list of vehicles which have the same departure time
The class responsible for building and deletion of vehicles.
Representation of a vehicle in the micro simulation.
Static storage of an output device and its base (abstract) implementation.
Representation of a vehicle.
Structure representing possible vehicle parameter.
Definition of vehicle flow with the current index for vehicle numbering.
int index
the running index
SUMOVehicleParameter * pars
The parameters.
double scale
the type scaling of this flow. Negative value indicates inhomogenous type distribution