22 #ifndef MSVehicleControl_h 23 #define MSVehicleControl_h 77 typedef std::map<std::string, SUMOVehicle*>::const_iterator
constVehIt;
105 const bool ignoreStopErrors,
const bool fromRouteFile =
true);
422 void setState(
int runningVehNo,
int loadedVehNo,
int endedVehNo,
SUMOReal totalDepartureDelay,
SUMOReal totalTravelTime);
536 std::map<const MSEdge* const, std::vector<SUMOVehicle*> >
myWaiting;
bool myDefaultPedTypeMayBeDeleted
Whether no pedestrian type was loaded.
unsigned int getTeleportsYield() const
return the number of teleports due to vehicles stuck on a minor road
bool checkVType(const std::string &id)
Checks whether the vehicle type (distribution) may be added.
SUMOReal myMaxSpeedFactor
The maximum speed factor for all vehicles in the network.
bool addVTypeDistribution(const std::string &id, RandomDistributor< MSVehicleType * > *vehTypeDistribution)
Adds a vehicle type distribution.
void addWaiting(const MSEdge *const edge, SUMOVehicle *vehicle)
Adds a vehicle to the list of waiting vehiclse to a given edge.
unsigned int getTeleportsWrongLane() const
return the number of teleports due to vehicles stuck on the wrong lane
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)
SUMOReal myMinDeceleration
The minimum deceleration capability for all vehicles in the network.
unsigned int getRunningVehicleNo() const
Returns the number of build and inserted, but not yet deleted vehicles.
SUMOReal getTotalDepartureDelay() const
Returns the total departure delay.
unsigned int getDepartedVehicleNo() const
Returns the number of inserted vehicles.
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)
constVehIt loadedVehBegin() const
Returns the begin of the internal vehicle map.
void registerTeleportYield()
register one non-collision-related teleport
unsigned int myWaitingForContainer
the number of vehicles wainting for containers contained in myWaiting which can only continue by bein...
std::map< const MSEdge *const, std::vector< SUMOVehicle * > > myWaiting
the lists of waiting vehicles to a given edge
MSVehicleControl()
Constructor.
int getActiveVehicleCount() const
Returns the number of build vehicles that have not been removed or need to wait for a passenger or a ...
void registerEmergencyStop()
register emergency stop
VehicleDictType myVehicleDict
Dictionary of vehicles.
SUMOVehicle * getWaitingVehicle(const MSEdge *const edge, const std::set< std::string > &lines, const SUMOReal position, const std::string ridingID)
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)
Removes a vehicle from the list of waiting vehicles to a given edge.
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.
const std::string DEFAULT_VTYPE_ID
The car-following model and parameter.
SUMOReal getTotalTravelTime() const
Returns the total travel time.
void unregisterOneWaitingForContainer()
decreases the count of vehicles waiting for a container to allow recogniztion of container related de...
unsigned int getCollisionCount() const
return the number of collisions
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)
SUMOTime computeRandomDepartOffset() const
compute (optional) random offset to the departure time
Representation of a vehicle.
SUMOReal getMaxSpeedFactor() const
return the maximum speed factor for all vehicles that ever entered the network
SUMOReal myScale
The scaling factor (especially for inc-dua)
std::map< std::string, RandomDistributor< MSVehicleType * > * > VTypeDistDictType
Vehicle type distribution dictionary type.
virtual SUMOVehicle * buildVehicle(SUMOVehicleParameter *defs, const MSRoute *route, const MSVehicleType *type, const bool ignoreStopErrors, const bool fromRouteFile=true)
Builds a vehicle, increases the number of built vehicles.
SUMOTime myMaxRandomDepartOffset
The maximum random offset to be added to vehicles departure times (non-negative)
void saveState(OutputDevice &out)
Saves the current state into the given stream.
unsigned int myCollisions
The number of collisions.
void setState(int runningVehNo, int loadedVehNo, int endedVehNo, SUMOReal totalDepartureDelay, SUMOReal totalTravelTime)
Sets the current state variables as loaded from the stream.
unsigned int myEndedVehNo
The number of removed vehicles.
void registerTeleportJam()
register one non-collision-related teleport
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...
unsigned int myTeleportsJam
The number of teleports due to jam.
unsigned int myTeleportsWrongLane
The number of teleports due to vehicles stuck on the wrong lane.
void abortWaiting()
informes about all waiting vehicles (deletion in destructor)
MSVehicleControl & operator=(const MSVehicleControl &s)
invalidated assignment operator
bool addVType(MSVehicleType *vehType)
Adds a vehicle type.
unsigned int getTeleportsJam() const
return the number of teleports due to jamming
void registerOneWaitingForContainer()
increases the count of vehicles waiting for a container to allow recogniztion of container related de...
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 wainting for persons contained in myWaiting which can only continue by being t...
virtual ~MSVehicleControl()
Destructor.
unsigned int myEmergencyStops
The number of emergency stops.
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.
SUMOReal getMinDeceleration() const
return the minimum deceleration capability for all vehicles that ever entered the network ...
SUMOVehicle * getVehicle(const std::string &id) const
Returns the vehicle with the given id.
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.
unsigned int myTeleportsYield
The number of teleports due to vehicles stuck on a minor road.
void registerCollision()
registers one collision-related teleport
constVehIt loadedVehEnd() const
Returns the end of the internal vehicle map.
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.
void discountStateLoaded()
avoid counting a vehicle twice if it was loaded from state and route input
MSVehicleType * getVType(const std::string &id=DEFAULT_VTYPE_ID, MTRand *rng=0)
Returns the named vehicle type or a sample from the named distribution.
void registerTeleportWrongLane()
register one non-collision-related teleport
unsigned int getEmergencyStops() const
return the number of emergency stops
unsigned int getQuota(SUMOReal frac=-1) const
Returns the number of instances of the current vehicle that shall be emitted considering that "frac" ...
unsigned int myRunningVehNo
The number of vehicles within the network (build and inserted but not removed)