 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
19 #ifndef MSVehicleControl_h
20 #define MSVehicleControl_h
75 typedef std::map<std::string, SUMOVehicle*>::const_iterator
constVehIt;
103 const bool ignoreStopErrors,
const bool fromRouteFile =
true);
277 int getQuota(
double frac = -1)
const;
382 bool hasVType(
const std::string&
id)
const;
479 void setState(
int runningVehNo,
int loadedVehNo,
int endedVehNo,
double totalDepartureDelay,
double totalTravelTime);
612 std::map<const MSEdge* const, std::vector<SUMOVehicle*> >
myWaiting;
void vehicleDeparted(const SUMOVehicle &v)
Informs this control about a vehicle's departure.
The car-following model and parameter.
void registerOneWaiting(const bool isPerson)
increases the count of vehicles waiting for a transport to allow recognition of person / container re...
void setScale(double scale)
sets the demand scaling factor
int getDepartedVehicleNo() const
Returns the number of inserted vehicles.
int getTeleportsWrongLane() const
return the number of teleports due to vehicles stuck on the wrong lane
int myEmergencyStops
The number of emergency stops.
MSVehicleType * getVType(const std::string &id=DEFAULT_VTYPE_ID, std::mt19937 *rng=nullptr)
Returns the named vehicle type or a sample from the named distribution.
void removeVType(const MSVehicleType *vehType)
Static storage of an output device and its base (abstract) implementation.
void registerTeleportJam()
register one non-collision-related teleport
double getVehicleMeanSpeed() const
int getActiveVehicleCount() const
Returns the number of build vehicles that have not been removed or need to wait for a passenger or a ...
virtual ~MSVehicleControl()
Destructor.
void discountStateLoaded(bool removed=false)
avoid counting a vehicle twice if it was loaded from state and route input
void saveState(OutputDevice &out)
Saves the current state into the given stream.
int getEmergencyStops() const
return the number of emergency stops
MSVehicleControl & operator=(const MSVehicleControl &s)
invalidated assignment operator
double getMinDeceleration() const
return the minimum deceleration capability for all vehicles that ever entered the network
void removeWaiting(const MSEdge *const edge, const SUMOVehicle *vehicle)
Removes a vehicle from the list of waiting vehicles for the given edge.
double myTotalTravelTime
The aggregated time vehicles needed to aacomplish their route (in seconds)
void abortWaiting()
informes about all waiting vehicles (deletion in destructor)
int myDiscarded
The number of vehicles which were discarded while loading.
std::map< std::string, RandomDistributor< MSVehicleType * > * > VTypeDistDictType
Vehicle type distribution dictionary type.
int getTeleportsJam() const
return the number of teleports due to jamming
Representation of a vehicle.
int getLoadedVehicleNo() const
Returns the number of build vehicles.
bool addVTypeDistribution(const std::string &id, RandomDistributor< MSVehicleType * > *vehTypeDistribution)
Adds a vehicle type distribution.
int getTeleportsYield() const
return the number of teleports due to vehicles stuck on a minor road
Structure representing possible vehicle parameter.
void scheduleVehicleRemoval(SUMOVehicle *veh, bool checkDuplicate=false)
Removes a vehicle after it has ended.
std::map< std::string, SUMOVehicle * >::const_iterator constVehIt
Definition of the internal vehicles map iterator.
void addWaiting(const MSEdge *const edge, SUMOVehicle *vehicle)
Adds a vehicle to the list of waiting vehicles for the given edge.
VTypeDictType myVTypeDict
Dictionary of vehicle types.
int getDiscardedVehicleNo() const
Returns the number of discarded vehicles.
int getEndedVehicleNo() const
Returns the number of removed vehicles.
int myLoadedVehNo
The number of build vehicles.
bool myDefaultPedTypeMayBeDeleted
Whether the default pedestrian type was already used or can still be replaced.
int getRunningVehicleNo() const
Returns the number of build and inserted, but not yet deleted vehicles.
std::map< std::string, std::set< std::string > > myVTypeToDist
Inverse lookup from vehicle type to distributions it is a member of.
virtual SUMOVehicle * buildVehicle(SUMOVehicleParameter *defs, const MSRoute *route, MSVehicleType *type, const bool ignoreStopErrors, const bool fromRouteFile=true)
Builds a vehicle, increases the number of built vehicles.
void registerEmergencyStop()
register emergency stop
double getVehicleMeanSpeedRelative() const
int getArrivedVehicleNo() const
Returns the number of arrived vehicles.
virtual bool addVehicle(const std::string &id, SUMOVehicle *v)
Tries to insert the vehicle into the internal vehicle container.
double myMaxSpeedFactor
The maximum speed factor for all vehicles in the network.
SUMOVehicle * getVehicle(const std::string &id) const
Returns the vehicle with the given id.
std::map< std::string, SUMOVehicle * > VehicleDictType
Vehicle dictionary type.
void setState(int runningVehNo, int loadedVehNo, int endedVehNo, double totalDepartureDelay, double totalTravelTime)
Sets the current state variables as loaded from the stream.
const std::set< std::string > getVTypeDistributionMembership(const std::string &id) const
Return the distribution IDs the vehicle type is a member of.
void adaptIntermodalRouter(MSNet::MSIntermodalRouter &router) const
bool hasVTypeDistribution(const std::string &id) const
Asks for a vehicle type distribution.
VTypeDistDictType myVTypeDistDict
A distribution of vehicle types (probability->vehicle type)
int myRunningVehNo
The number of vehicles within the network (build and inserted but not removed)
bool addVType(MSVehicleType *vehType)
Adds a vehicle type.
const std::string DEFAULT_VTYPE_ID
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
VehicleDictType myVehicleDict
Dictionary of vehicles.
int myTeleportsJam
The number of teleports due to jam.
double myStopTolerance
The tolerance to apply when matching waiting persons and vehicles.
virtual void deleteVehicle(SUMOVehicle *v, bool discard=false)
Deletes the vehicle.
void registerTeleportYield()
register one non-collision-related teleport
int myWaitingForPerson
the number of vehicles wainting for persons contained in myWaiting which can only continue by being t...
std::map< const MSEdge *const, std::vector< SUMOVehicle * > > myWaiting
the lists of waiting vehicles to a given edge
A road/street connecting two junctions.
int getQuota(double frac=-1) const
Returns the number of instances of the current vehicle that shall be emitted considering that "frac" ...
double myTotalDepartureDelay
The aggregated time vehicles had to wait for departure (in seconds)
int getCollisionCount() const
return the number of collisions
std::vector< SUMOVehicle * > myPTVehicles
List of vehicles which belong to public transport.
double myScale
The scaling factor (especially for inc-dua)
void registerCollision()
registers one collision-related teleport
int myTeleportsYield
The number of teleports due to vehicles stuck on a minor road.
int myWaitingForContainer
the number of vehicles wainting for containers contained in myWaiting which can only continue by bein...
virtual int getHaltingVehicleNo() const
Returns the number of halting vehicles.
void registerTeleportWrongLane()
register one non-collision-related teleport
void removePending()
Removes a vehicle after it has ended.
double myMinDeceleration
The minimum deceleration capability for all vehicles in the network.
MSVehicleControl()
Constructor.
int myCollisions
The number of collisions.
bool myDefaultVTypeMayBeDeleted
Whether the default vehicle type was already used or can still be replaced.
std::map< std::string, MSVehicleType * > VTypeDictType
Vehicle type dictionary type.
double getTotalTravelTime() const
Returns the total travel time.
virtual std::pair< double, double > getVehicleMeanSpeeds() const
get current absolute and relative mean vehicle speed in the network
int myTeleportsWrongLane
The number of teleports due to vehicles stuck on the wrong lane.
bool checkVType(const std::string &id)
Checks whether the vehicle type (distribution) may be added.
void insertVTypeIDs(std::vector< std::string > &into) const
Inserts ids of all known vehicle types and vehicle type distributions to the given vector.
The class responsible for building and deletion of vehicles.
std::vector< SUMOVehicle * > myPendingRemovals
List of vehicles which are going to be removed.
double getTotalDepartureDelay() const
Returns the total departure delay.
bool hasVType(const std::string &id) const
Asks for existence of a vehicle type.
SUMOVehicle * getWaitingVehicle(MSTransportable *transportable, const MSEdge *const edge, const double position)
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
int getTeleportCount() const
return the number of teleports (including collisions)
double getMaxSpeedFactor() const
return the maximum speed factor for all vehicles that ever entered the network
int myEndedVehNo
The number of removed vehicles.
void unregisterOneWaiting(const bool isPerson)
decreases the count of vehicles waiting for a transport to allow recognition of person / container re...
bool myDefaultBikeTypeMayBeDeleted
Whether the default bicycle type was already used or can still be replaced.
Representation of a vehicle in the micro simulation.