 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
59 #define DEBUGCOND (veh.isSelected())
73 double prob,
const std::string& file,
bool off,
75 const std::string& vTypes) :
80 myUserProbability(prob),
81 myAmInUserMode(false),
82 myTimeThreshold(timeThreshold) {
84 for (MSEdgeVector::const_iterator j = edges.begin(); j != edges.end(); ++j) {
90 const std::vector<MSLane*>& destLanes = (*j)->getLanes();
91 for (std::vector<MSLane*>::const_iterator i = destLanes.begin(); i != destLanes.end(); ++i) {
92 (*i)->addMoveReminder(
this);
121 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": No destination edge id given.");
125 if (dest ==
"keepDestination") {
127 }
else if (dest ==
"terminateRoute") {
130 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Destination edge '" + dest +
"' is not known.");
140 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Attribute 'probability' for destination '" + dest +
"' is negative (must not).");
151 if (closed ==
nullptr) {
152 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Edge '" + closed_id +
"' to close is not known.");
165 if (closed ==
nullptr) {
166 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Lane '" + closed_id +
"' to close is not known.");
185 if (routeStr ==
"") {
189 if (route ==
nullptr) {
190 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Route '" + routeStr +
"' does not exist.");
200 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Attribute 'probability' for route '" + routeStr +
"' is negative (must not).");
210 if (parkingarea ==
"") {
211 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": No parking area id given.");
215 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Parking area '" + parkingarea +
"' is not known.");
224 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Attribute 'probability' for destination '" + parkingarea +
"' is negative (must not).");
252 std::set<MSEdge*> affected;
254 affected.insert(&l->
getEdge());
279 if (i->begin == currentTime && !(i->closed.empty() && i->closedLanes.empty()) && i->permissions !=
SVCAll) {
280 for (MSEdgeVector::iterator e = i->closed.begin(); e != i->closed.end(); ++e) {
281 for (std::vector<MSLane*>::const_iterator l = (*e)->getLanes().begin(); l != (*e)->getLanes().end(); ++l) {
283 (*l)->setPermissions(i->permissions, i->id);
285 (*e)->rebuildAllowedLanes();
287 for (std::vector<MSLane*>::iterator l = i->closedLanes.begin(); l != i->closedLanes.end(); ++l) {
288 (*l)->setPermissions(i->permissions, i->id);
289 (*l)->getEdge().rebuildAllowedLanes();
294 if (i->end == currentTime && !(i->closed.empty() && i->closedLanes.empty()) && i->permissions !=
SVCAll) {
295 for (MSEdgeVector::iterator e = i->closed.begin(); e != i->closed.end(); ++e) {
296 for (std::vector<MSLane*>::const_iterator l = (*e)->getLanes().begin(); l != (*e)->getLanes().end(); ++l) {
297 (*l)->resetPermissions(i->id);
300 (*e)->rebuildAllowedLanes();
302 for (std::vector<MSLane*>::iterator l = i->closedLanes.begin(); l != i->closedLanes.end(); ++l) {
303 (*l)->resetPermissions(i->id);
304 (*l)->getEdge().rebuildAllowedLanes();
315 if (i->begin <= time && i->end > time) {
318 i->edgeProbs.getOverallProb() > 0 ||
320 i->routeProbs.getOverallProb() > 0 ||
322 i->parkProbs.getOverallProb() > 0 ||
338 if (i->begin <= time && i->end > time) {
339 if (i->parkProbs.getOverallProb() != 0 || i->edgeProbs.getOverallProb() != 0 || i->routeProbs.getOverallProb() != 0 || !i->closed.empty()) {
374 if (rerouteDef ==
nullptr) {
386 if (rerouteDef->
closedLanes.size() > 0 && !hasReroutingDevice) {
392 #ifdef DEBUG_REROUTER
402 bool newDestination =
false;
405 if (newParkingArea !=
nullptr) {
411 if (newDestination) {
426 const double savings = previousCost - routeCost;
435 std::string errorMsg;
440 +
"' could not reroute to new parkingArea '" + newParkingArea->
getID()
450 if (newRoute !=
nullptr) {
451 #ifdef DEBUG_REROUTER
453 std::cout <<
" replacedRoute from routeDist " << newRoute->
getID() <<
"\n";
459 const MSEdge* newEdge = lastEdge;
461 double newArrivalPos = -1;
462 const bool destUnreachable = std::find(rerouteDef->
closed.begin(), rerouteDef->
closed.end(), lastEdge) != rerouteDef->
closed.end();
463 bool keepDestination =
false;
466 if (rerouteDef->
closed.size() == 0 || destUnreachable) {
469 keepDestination =
true;
477 WRITE_WARNING(
"Cannot keep destination edge '" + lastEdge->
getID() +
"' for vehicle '" + veh.
getID() +
"' due to closed edges. Terminating route.");
482 }
else if (newEdge ==
nullptr) {
483 #ifdef DEBUG_REROUTER
485 std::cout <<
" could not find new edge!\n";
503 while (edges.size() == 0 && edgeProbs2.
getVals().size() > 0) {
504 newEdge = edgeProbs2.
get();
524 #ifdef DEBUG_REROUTER
525 if (
DEBUGCOND) std::cout <<
" rerouting: newDest=" << newEdge->
getID()
527 <<
" useNewRoute=" << useNewRoute <<
" newArrivalPos=" << newArrivalPos <<
" numClosed=" << rerouteDef->
closed.size()
530 if (useNewRoute && newArrivalPos != -1) {
589 return defaultWeight;
607 if (destParkArea ==
nullptr) {
612 bool destVisible =
false;
613 for (
auto paVis : parks) {
614 if (paVis.first == destParkArea
636 <<
" rerouteParkingArea dest=" << destParkArea->
getID()
638 <<
" newDest=" << newDestination
643 typedef std::map<std::string, double> ParkingParamMap_t;
644 typedef std::map<MSParkingArea*, ParkingParamMap_t> MSParkingAreaMap_t;
646 ParkingParamMap_t weights;
647 std::map<MSParkingArea*, ConstMSEdgeVector> newRoutes;
650 weights[
"probability"] =
getWeight(veh,
"parking.probability.weight", 0.0);
653 weights[
"capacity"] =
getWeight(veh,
"parking.capacity.weight", 0.0);
656 weights[
"absfreespace"] =
getWeight(veh,
"parking.absfreespace.weight", 0.0);
659 weights[
"relfreespace"] =
getWeight(veh,
"parking.relfreespace.weight", 0.0);
662 weights[
"distanceto"] =
getWeight(veh,
"parking.distanceto.weight",
getWeight(veh,
"parking.distance.weight", 1.0));
665 weights[
"timeto"] =
getWeight(veh,
"parking.timeto.weight", 0.0);
668 weights[
"distancefrom"] =
getWeight(veh,
"parking.distancefrom.weight", 0.0);
671 weights[
"timefrom"] =
getWeight(veh,
"parking.timefrom.weight", 0.0);
674 ParkingParamMap_t maxValues;
676 maxValues[
"probability"] = 0.0;
677 maxValues[
"capacity"] = 0.0;
678 maxValues[
"absfreespace"] = 0.0;
679 maxValues[
"relfreespace"] = 0.0;
680 maxValues[
"distanceto"] = 0.0;
681 maxValues[
"timeto"] = 0.0;
682 maxValues[
"distancefrom"] = 0.0;
683 maxValues[
"timefrom"] = 0.0;
686 MSParkingAreaMap_t parkAreas;
694 for (
int i = 0; i < (int)parks.size(); ++i) {
696 const double prob = probs[i];
700 if (paOccupancy < pa->getCapacity()) {
703 ParkingParamMap_t parkValues;
718 if (edgesToPark.size() > 0) {
724 int nextDestinationIndex = route.
size() - 1;
725 if (!newDestination) {
726 std::vector<std::pair<int, double> > stopIndices = veh.
getStopIndices();
727 if (stopIndices.size() > 1) {
728 nextDestinationIndex = stopIndices[1].first;
729 nextDestination = route.
getEdges()[nextDestinationIndex];
730 nextPos = stopIndices[1].second;
733 if (parkEdge == nextDestination && nextPos < pa->getEndLanePosition()) {
740 if (edgesFromPark.size() > 0 || newDestination) {
742 parkValues[
"probability"] = prob;
744 if (parkValues[
"probability"] > maxValues[
"probability"]) {
745 maxValues[
"probability"] = parkValues[
"probability"];
748 parkValues[
"capacity"] = (double)(pa->
getCapacity());
749 parkValues[
"absfreespace"] = (double)(pa->
getCapacity() - paOccupancy);
750 parkValues[
"relfreespace"] = parkValues[
"absfreespace"] / parkValues[
"capacity"];
752 if (parkValues[
"capacity"] > maxValues[
"capacity"]) {
753 maxValues[
"capacity"] = parkValues[
"capacity"];
756 if (parkValues[
"absfreespace"] > maxValues[
"absfreespace"]) {
757 maxValues[
"absfreespace"] = parkValues[
"absfreespace"];
760 if (parkValues[
"relfreespace"] > maxValues[
"relfreespace"]) {
761 maxValues[
"relfreespace"] = parkValues[
"relfreespace"];
768 routeToPark.
begin(), routeToPark.
end() - 1, includeInternalLengths);
777 if (parkValues[
"distanceto"] < brakeGap) {
786 if (parkValues[
"distanceto"] > maxValues[
"distanceto"]) {
787 maxValues[
"distanceto"] = parkValues[
"distanceto"];
790 if (parkValues[
"timeto"] > maxValues[
"timeto"]) {
791 maxValues[
"timeto"] = parkValues[
"timeto"];
796 if (newDestination) {
797 parkValues[
"distancefrom"] = 0;
798 parkValues[
"timefrom"] = 0;
800 MSRoute routeFromPark(route.
getID() +
"!frompark#1", edgesFromPark,
false,
804 routeFromPark.
begin(), routeFromPark.
end() - 1, includeInternalLengths);
807 newEdges.insert(newEdges.end(), edgesFromPark.begin() + 1, edgesFromPark.end());
808 newEdges.insert(newEdges.end(), route.
begin() + nextDestinationIndex + 1, route.
end());
811 if (parkValues[
"distancefrom"] > maxValues[
"distancefrom"]) {
812 maxValues[
"distancefrom"] = parkValues[
"distancefrom"];
815 if (parkValues[
"timefrom"] > maxValues[
"timefrom"]) {
816 maxValues[
"timefrom"] = parkValues[
"timefrom"];
819 parkAreas[pa] = parkValues;
820 newRoutes[pa] = newEdges;
824 std::cout <<
" altPA=" << pa->
getID()
837 std::cout <<
" maxValues=" <<
joinToString(maxValues,
" ",
":") <<
"\n";
842 double minParkingCost = 0.0;
844 for (MSParkingAreaMap_t::iterator it = parkAreas.begin(); it != parkAreas.end(); ++it) {
846 ParkingParamMap_t parkValues = it->second;
849 parkValues[
"probability"] = maxValues[
"probability"] > 0.0 ? 1.0 - parkValues[
"probability"] / maxValues[
"probability"] : 0.0;
850 parkValues[
"capacity"] = maxValues[
"capacity"] > 0.0 ? 1.0 - parkValues[
"capacity"] / maxValues[
"capacity"] : 0.0;
851 parkValues[
"absfreespace"] = maxValues[
"absfreespace"] > 0.0 ? 1.0 - parkValues[
"absfreespace"] / maxValues[
"absfreespace"] : 0.0;
852 parkValues[
"relfreespace"] = maxValues[
"relfreespace"] > 0.0 ? 1.0 - parkValues[
"relfreespace"] / maxValues[
"relfreespace"] : 0.0;
854 parkValues[
"distanceto"] = maxValues[
"distanceto"] > 0.0 ? parkValues[
"distanceto"] / maxValues[
"distanceto"] : 0.0;
855 parkValues[
"timeto"] = maxValues[
"timeto"] > 0.0 ? parkValues[
"timeto"] / maxValues[
"timeto"] : 0.0;
857 parkValues[
"distancefrom"] = maxValues[
"distancefrom"] > 0.0 ? parkValues[
"distancefrom"] / maxValues[
"distancefrom"] : 0.0;
858 parkValues[
"timefrom"] = maxValues[
"timefrom"] > 0.0 ? parkValues[
"timefrom"] / maxValues[
"timefrom"] : 0.0;
861 double parkingCost = 0.0;
864 for (ParkingParamMap_t::iterator pc = parkValues.begin(); pc != parkValues.end(); ++pc) {
865 parkingCost += weights[pc->first] * pc->second;
869 if (nearParkArea ==
nullptr || parkingCost < minParkingCost) {
870 minParkingCost = parkingCost;
871 nearParkArea = it->first;
872 newRoute = newRoutes[nearParkArea];
877 std::cout <<
" altPA=" << it->first->
getID() <<
" score=" << parkingCost <<
"\n";
899 for (
auto vTypeDist : vTypeDists) {
virtual bool compute(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into, bool silent=false)=0
Builds the route between the given edges using the minimum effort at the given time The definition of...
SUMOTime myCurrentIntervalBegin
The first and the last time steps of the interval.
const MSLane & getLane() const
Returns the lane this stop is located at.
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Triggers rerouting (once) for vehicles that are already on the edge when the rerouter activates.
const RerouteInterval * getCurrentReroute(SUMOTime time, SUMOVehicle &veh) const
Returns the rerouting definition valid for the given time and vehicle, 0 if none.
@ NOTIFICATION_LANE_CHANGE
The vehicle changes lanes (micro only)
virtual int getRNGIndex() const =0
static const RGBColor DEFAULT_COLOR
The default color (for vehicle types and vehicles)
RandomDistributor< const MSRoute * > routeProbs
The distributions of new routes to use.
bool add(T val, double prob, bool checkDuplicates=true)
Adds a value with an assigned probability to the distribution.
bool hasInternalLinks() const
return whether the network contains internal links
Representation of a vehicle or person.
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
virtual SUMOTime getWaitingTime() const =0
@ ARRIVAL_POS_GIVEN
The arrival position is given.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
A lane area vehicles can halt at.
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
A device that performs vehicle rerouting based on current edge speeds.
#define WRITE_WARNING(msg)
Representation of a lane in the micro simulation.
virtual void replaceParameter(const SUMOVehicleParameter *newParameter)=0
Replaces the vehicle's parameter.
virtual std::mt19937 * getRNG() const =0
Returns the associated RNG for this vehicle.
virtual bool replaceRouteEdges(ConstMSEdgeVector &edges, double cost, double savings, const std::string &info, bool onInit=false, bool check=false, bool removeStops=true)=0
Replaces the current route by the given edges.
SAX-handler base for SUMO-files.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
A single mesoscopic segment (cell)
double getEndLanePosition() const
Returns the end position of this stop.
virtual std::vector< std::pair< int, double > > getStopIndices() const =0
return list of route indices and stop positions for the remaining stops
MSRouteIterator end() const
Returns the end of the list of edges to pass.
virtual bool replaceParkingArea(MSParkingArea *parkingArea, std::string &errorMsg)=0
Replaces a stop.
virtual const MSEdge * getEdge() const =0
Returns the edge the vehicle is currently at.
virtual const MSVehicleType & getVehicleType() const =0
Returns the vehicle's type.
int getLastStepOccupancy() const
Returns the area occupancy at the end of the last simulation step.
virtual bool isVehicle() const =0
Get the vehicle's ID.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
void addDetector(MSMoveReminder *data)
Adds a data collector for a detector to this segment.
SVCPermissions permissions
The permissions to use.
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
virtual const std::string & getID() const =0
Get the vehicle's ID.
virtual const ConstMSEdgeVector::const_iterator & getCurrentRouteEdge() const =0
Returns an iterator pointing to the current edge in this vehicles route.
SUMOTime myCurrentIntervalEnd
double getBeginLanePosition() const
Returns the begin position of this stop.
virtual SUMOTime getAccumulatedWaitingTime() const =0
static int gNumSimThreads
how many threads to use for simulation
const MSEdge * getLastEdge() const
returns the destination edge
double getUserProbability() const
Returns the rerouting probability given by the user.
Representation of a vehicle.
A wrapper for a Command function.
SVCPermissions myCurrentPermissions
List of permissions for closed edges.
std::vector< const MSEdge * > ConstMSEdgeVector
std::vector< MSLane * > myCurrentClosedLanes
List of closed lanes.
const ConstMSEdgeVector & getEdges() const
std::set< std::string > myVehicleTypes
The vehicle types to look for (empty means all)
Structure representing possible vehicle parameter.
MSParkingArea * rerouteParkingArea(const MSTriggeredRerouter::RerouteInterval *rerouteDef, SUMOVehicle &veh, bool &newDestination, ConstMSEdgeVector &newRoute) const
SUMOTime setPermissions(const SUMOTime currentTime)
Sets the edge permission if there are any defined in the closingEdge.
const RGBColor & getColor() const
Returns the color.
MSTriggeredRerouter(const std::string &id, const MSEdgeVector &edges, double prob, const std::string &file, bool off, SUMOTime timeThreshold, const std::string &vTypes)
Constructor.
RandomDistributor< MSEdge * > edgeProbs
The distributions of new destinations to use.
static SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector())
return the router instance
double getLength() const
return the length of the edge
@ SVC_AUTHORITY
authorities vehicles
RandomDistributor< ParkingAreaVisible > myCurrentParkProb
new destinations with probabilities
virtual MSParkingArea * getNextParkingArea()=0
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
Something on a lane to be noticed about vehicle movement.
void setUserMode(bool val)
Sets whether the process is currently steered by the user.
@ SUMO_ATTR_BEGIN
weights: time range begin
virtual const std::vector< MSTransportable * > & getPersons() const =0
retrieve riding persons
@ SUMO_TAG_PARKING_ZONE_REROUTE
entry for an alternative parking zone
double myProbability
The probability and the user-given probability.
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
const std::string & getOriginalID() const
Returns the id of the original vehicle type if this is a vehicle specific type, the id otherwise.
virtual const MSRoute & getRoute() const =0
Returns the current route.
T get(std::mt19937 *which=0) const
Draw a sample of the distribution.
@ SUMO_TAG_DEST_PROB_REROUTE
probability of destiny of a reroute
int size() const
Returns the number of edges to pass.
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Removes the reminder.
static double rand(std::mt19937 *rng=0)
Returns a random real number in [0, 1)
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Tries to reroute the vehicle.
double getWeight(SUMOVehicle &veh, const std::string param, const double defaultWeight) const
static MSEdge mySpecialDest_keepDestination
special destination values
const std::set< std::string > getVTypeDistributionMembership(const std::string &id) const
Return the distribution IDs the vehicle type is a member of.
bool computeLooped(const E *from, const E *to, const V *const vehicle, SUMOTime msTime, std::vector< const E * > &into, bool silent=false)
Builds the route between the given edges using the minimum effort at the given time if from == to,...
bool remove(T val)
Removes a value with an assigned probability from the distribution.
void setUserUsageProbability(double prob)
Sets the probability with which a vehicle is rerouted given by the user.
virtual void setArrivalPos(double arrivalPos)=0
Sets this vehicle's desired arrivalPos for its current route.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
virtual void myEndElement(int element)
Called when a closing tag occurs.
int getCapacity() const
Returns the area capacity.
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary....
virtual MSVehicleDevice * getDevice(const std::type_info &type) const =0
Returns a device of the given type if it exists or 0.
A scoped lock which only triggers on condition.
virtual MSLane * getLane() const =0
Returns the lane the vehicle is on.
virtual bool replaceRoute(const MSRoute *route, const std::string &info, bool onInit=false, int offset=0, bool addStops=true, bool removeStops=true)=0
Replaces the current route by the given one.
@ SUMO_TAG_PARKING_AREA
A parking area.
MESegment * getSegmentForEdge(const MSEdge &e, double pos=0)
Get the segment for a given edge at a given position.
double arrivalPos
(optional) The position the vehicle shall arrive on
RandomDistributor< const MSRoute * > myCurrentRouteProb
new routes with probabilities
std::vector< MSLane * > closedLanes
The list of closed lanes.
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
@ SUMO_TAG_ROUTE_PROB_REROUTE
probability of route of a reroute
std::string time2string(SUMOTime t)
A road/street connecting two junctions.
void clear()
Clears the distribution.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
virtual ~MSTriggeredRerouter()
Destructor.
const std::vector< double > & getProbs() const
Returns the probabilities assigned to the members of the distribution.
virtual double getBrakeGap() const =0
get distance for coming to a stop (used for rerouting checks)
RandomDistributor< MSEdge * > myCurrentEdgeProb
new destinations with probabilities
@ SUMO_TAG_CLOSING_REROUTE
reroute of type closing
An abstract device that changes the state of the micro simulation.
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
SUMOTime begin
The begin time these definitions are valid.
MSEdge & getEdge() const
Returns the lane's edge.
static MSEdge mySpecialDest_terminateRoute
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
int getOccupancy() const
Returns the area occupancy.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
SUMOTime getOptSUMOTimeReporting(int attr, const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
static MELoop * gMesoNet
mesoscopic simulation infrastructure
bool inUserMode() const
Returns whether the user is setting the rerouting probability.
double recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime, double *lengthp=nullptr) const
bool myAmInUserMode
Information whether the current rerouting probability is the user-given.
const SVCPermissions SVCAll
all VClasses are allowed
std::vector< MSEdge * > MSEdgeVector
const std::vector< SUMOVehicleParameter::Stop > & getStops() const
Returns the stops.
const SUMOVTypeParameter & getParameter() const
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
virtual double getArrivalPos() const =0
Returns this vehicle's desired arrivalPos for its current route (may change on reroute)
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
std::vector< std::string > getVector()
return vector of strings
std::vector< RerouteInterval > myIntervals
List of rerouting definition intervals.
static bool dictionary(const std::string &id, const MSRoute *route)
Adds a route to the dictionary.
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
@ SUMO_TAG_CLOSING_LANE_REROUTE
lane of a reroute of type closing
@ SUMO_ATTR_END
weights: time range end
@ SUMO_TAG_INTERVAL
an aggreagated-output interval
virtual std::string getStringSecure(int id, const std::string &def) const =0
Returns the string-value of the named (by its enum-value) attribute.
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
virtual double getPositionOnLane() const =0
Get the vehicle's position along the lane.
bool containsAnyOf(const MSEdgeVector &edgelist) const
SUMOTime end
The end time these definitions are valid.
MSEdgeVector closed
The list of closed edges.
double getOverallProb() const
Return the sum of the probabilites assigned to the members.
double getDistanceBetween(double fromPos, double toPos, const MSEdge *fromEdge, const MSEdge *toEdge, bool includeInternal=true, int routePosition=0) const
Compute the distance between 2 given edges on this route, including the length of internal lanes....
Encapsulated SAX-Attributes.
const std::string & getID() const
Returns the id.
Notification
Definition of a vehicle state.
@ NOTIFICATION_JUNCTION
The vehicle arrived at a junction.
MSEdgeVector closedLanesAffected
The list of edges that are affect by closed lanes.
RandomDistributor< ParkingAreaVisible > parkProbs
The distributions of new parking areas to use as destinations.
MSEdgeVector myCurrentClosed
List of closed edges.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
bool vehicleApplies(const SUMOVehicle &veh) const
Checks whether the detector measures vehicles of the given type.
const std::vector< T > & getVals() const
Returns the members of the distribution.
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
double getProbability() const
Returns the rerouting probability.