22 #ifndef MSVehicleControl_h
23 #define MSVehicleControl_h
78 typedef std::map<std::string, SUMOVehicle*>::const_iterator
constVehIt;
456 std::map<const MSEdge* const, std::vector<SUMOVehicle*> >
myWaiting;
bool checkVType(const std::string &id)
Checks whether the vehicle type (distribution) may be added.
bool addVTypeDistribution(const std::string &id, RandomDistributor< MSVehicleType * > *vehTypeDistribution)
Adds a vehicle type distribution.
void addWaiting(const MSEdge *const edge, SUMOVehicle *vehicle)
Representation of a vehicle in the micro simulation.
virtual void deleteVehicle(SUMOVehicle *v, bool discard=false)
Deletes the vehicle.
SUMOReal myTotalDepartureDelay
The aggregated time vehicles had to wait for departure (in seconds)
unsigned int getRunningVehicleNo() const
Returns the number of build and inserted, but not yet deleted vehicles.
unsigned int getDepartedVehicleNo() const
Returns the number of inserted vehicles.
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
unsigned int myDiscarded
The number of vehicles which were discarded while loading.
SUMOReal myTotalTravelTime
The aggregated time vehicles needed to aacomplish their route (in seconds)
void registerTeleport()
register one non-collision-related teleport
std::map< const MSEdge *const, std::vector< SUMOVehicle * > > myWaiting
the lists of waiting vehicles
MSVehicleType * getVType(const std::string &id=DEFAULT_VTYPE_ID)
Returns the named vehicle type or a sample from the named distribution.
MSVehicleControl()
Constructor.
int getActiveVehicleCount() const
Returns the number of build vehicles that have not been removed or need to wait for a passenger...
VehicleDictType myVehicleDict
Dictionary of vehicles.
virtual bool addVehicle(const std::string &id, SUMOVehicle *v)
Tries to insert the vehicle into the internal vehicle container.
VTypeDictType myVTypeDict
Dictionary of vehicle types.
void removeWaiting(const MSEdge *const edge, SUMOVehicle *vehicle)
void insertVTypeIDs(std::vector< std::string > &into) const
Inserts ids of all known vehicle types and vehicle type distributions to the given vector...
bool myDefaultVTypeMayBeDeleted
Whether no vehicle type was loaded.
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
const std::string DEFAULT_VTYPE_ID
void printMeanTravelTime(OutputDevice &od) const
Returns the mean travel time of vehicles The mean travel time of ended vehicles (-1 if no vehicle has...
void printMeanWaitingTime(OutputDevice &od) const
Prints the mean waiting time of vehicles. The mean time vehicles had to wait for being inserted (-1 i...
The car-following model and parameter.
unsigned int getCollisionCount() const
return the number of collisions
virtual SUMOVehicle * buildVehicle(SUMOVehicleParameter *defs, const MSRoute *route, const MSVehicleType *type)
Builds a vehicle, increases the number of built vehicles.
SUMOVehicle * getWaitingVehicle(const MSEdge *const edge, const std::set< std::string > &lines)
A road/street connecting two junctions.
unsigned int getLoadedVehicleNo() const
Returns the number of build vehicles.
std::map< std::string, MSVehicleType * > VTypeDictType
Vehicle type dictionary type.
unsigned int getTeleportCount() const
return the number of teleports (including collisions)
void setState(int runningVehNo, int endedVehNo, SUMOReal totalDepartureDelay, SUMOReal totalTravelTime)
Sets the current state variables as loaded from the stream.
Representation of a vehicle.
SUMOReal myScale
The scaling factor (especially for inc-dua)
std::map< std::string, RandomDistributor< MSVehicleType * > * > VTypeDistDictType
Vehicle type distribution dictionary type.
void saveState(OutputDevice &out)
Saves the current state into the given stream.
unsigned int myCollisions
The number of collisions.
static MTRand myVehicleParamsRNG
A random number generator used to choose from vtype/route distributions and computing the speed facto...
unsigned int myEndedVehNo
The number of removed vehicles.
void unregisterOneWaitingForPerson()
decreases the count of vehicles waiting for a person to allow recogniztion of person related deadlock...
void registerOneWaitingForPerson()
increases the count of vehicles waiting for a person to allow recogniztion of person related deadlock...
void abortWaiting()
removes any vehicles that are still waiting
MSVehicleControl & operator=(const MSVehicleControl &s)
invalidated assignment operator
bool addVType(MSVehicleType *vehType)
Adds a vehicle type.
void scheduleVehicleRemoval(SUMOVehicle *veh)
Removes a vehicle after it has ended.
Structure representing possible vehicle parameter.
VTypeDistDictType myVTypeDistDict
A distribution of vehicle types (probability->vehicle type)
unsigned int myWaitingForPerson
the number of vehicles contained in myWaiting which can only continue by being triggered ...
virtual ~MSVehicleControl()
Destructor.
std::map< std::string, SUMOVehicle * >::const_iterator constVehIt
Definition of the internal vehicles map iterator.
unsigned int getEndedVehicleNo() const
Returns the number of removed vehicles.
SUMOVehicle * getVehicle(const std::string &id) const
Returns the vehicle with the given id.
bool isInQuota(SUMOReal frac=-1) const
Returns the information whether the currently vehicle number shall be emitted considering that only f...
bool hasVTypeDistribution(const std::string &id) const
Asks for a vehicle type distribution.
Static storage of an output device and its base (abstract) implementation.
std::map< std::string, SUMOVehicle * > VehicleDictType
Vehicle dictionary type.
void registerCollision()
registers one collision-related teleport
void vehicleDeparted(const SUMOVehicle &v)
Informs this control about a vehicle's departure.
The class responsible for building and deletion of vehicles.
unsigned int myLoadedVehNo
The number of build vehicles.
unsigned int myRunningVehNo
The number of vehicles within the network (build and inserted but not removed)
unsigned int myTeleports
The number of teleports (including collisions)