58 #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) {
85 for (MSEdgeVector::const_iterator j = edges.begin(); j != edges.end(); ++j) {
91 const std::vector<MSLane*>& destLanes = (*j)->getLanes();
92 for (std::vector<MSLane*>::const_iterator i = destLanes.begin(); i != destLanes.end(); ++i) {
93 (*i)->addMoveReminder(
this);
123 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": No destination edge id given.");
127 if (dest ==
"keepDestination") {
129 }
else if (dest ==
"terminateRoute") {
132 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Destination edge '" + dest +
"' is not known.");
142 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Attribute 'probability' for destination '" + dest +
"' is negative (must not).");
153 if (closed ==
nullptr) {
154 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Edge '" + closed_id +
"' to close is not known.");
167 if (closed ==
nullptr) {
168 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Lane '" + closed_id +
"' to close is not known.");
187 if (routeStr ==
"") {
191 if (route ==
nullptr) {
192 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Route '" + routeStr +
"' does not exist.");
202 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Attribute 'probability' for route '" + routeStr +
"' is negative (must not).");
212 if (parkingarea ==
"") {
213 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": No parking area id given.");
217 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Parking area '" + parkingarea +
"' is not known.");
226 throw ProcessError(
"MSTriggeredRerouter " +
getID() +
": Attribute 'probability' for destination '" + parkingarea +
"' is negative (must not).");
254 std::set<MSEdge*> affected;
256 affected.insert(&l->
getEdge());
262 if (closingBegin < simBegin && ri.end > simBegin) {
288 if (i->begin == currentTime && !(i->closed.empty() && i->closedLanes.empty()) && i->permissions !=
SVCAll) {
289 for (MSEdgeVector::iterator e = i->closed.begin(); e != i->closed.end(); ++e) {
290 for (std::vector<MSLane*>::const_iterator l = (*e)->getLanes().begin(); l != (*e)->getLanes().end(); ++l) {
292 (*l)->setPermissions(i->permissions, i->id);
294 (*e)->rebuildAllowedLanes();
296 for (std::vector<MSLane*>::iterator l = i->closedLanes.begin(); l != i->closedLanes.end(); ++l) {
297 (*l)->setPermissions(i->permissions, i->id);
298 (*l)->getEdge().rebuildAllowedLanes();
303 if (i->end == currentTime && !(i->closed.empty() && i->closedLanes.empty()) && i->permissions !=
SVCAll) {
304 for (MSEdgeVector::iterator e = i->closed.begin(); e != i->closed.end(); ++e) {
305 for (std::vector<MSLane*>::const_iterator l = (*e)->getLanes().begin(); l != (*e)->getLanes().end(); ++l) {
306 (*l)->resetPermissions(i->id);
309 (*e)->rebuildAllowedLanes();
311 for (std::vector<MSLane*>::iterator l = i->closedLanes.begin(); l != i->closedLanes.end(); ++l) {
312 (*l)->resetPermissions(i->id);
313 (*l)->getEdge().rebuildAllowedLanes();
324 if (i->begin <= time && i->end > time) {
327 i->edgeProbs.getOverallProb() > 0 ||
329 i->routeProbs.getOverallProb() > 0 ||
331 i->parkProbs.getOverallProb() > 0 ||
347 if (i->begin <= time && i->end > time) {
348 if (i->parkProbs.getOverallProb() != 0 || i->edgeProbs.getOverallProb() != 0 || i->routeProbs.getOverallProb() != 0 || !i->closed.empty()) {
383 if (rerouteDef ==
nullptr) {
395 if (rerouteDef->
closedLanes.size() > 0 && !hasReroutingDevice) {
401 #ifdef DEBUG_REROUTER
411 bool newDestination =
false;
414 if (newParkingArea !=
nullptr) {
420 if (newDestination) {
435 const double savings = previousCost - routeCost;
444 std::string errorMsg;
449 +
"' could not reroute to new parkingArea '" + newParkingArea->
getID()
459 if (newRoute !=
nullptr) {
460 #ifdef DEBUG_REROUTER
462 std::cout <<
" replacedRoute from routeDist " << newRoute->
getID() <<
"\n";
468 const MSEdge* newEdge = lastEdge;
470 double newArrivalPos = -1;
471 const bool destUnreachable = std::find(rerouteDef->
closed.begin(), rerouteDef->
closed.end(), lastEdge) != rerouteDef->
closed.end();
472 bool keepDestination =
false;
475 if (rerouteDef->
closed.size() == 0 || destUnreachable) {
478 keepDestination =
true;
486 WRITE_WARNING(
"Cannot keep destination edge '" + lastEdge->
getID() +
"' for vehicle '" + veh.
getID() +
"' due to closed edges. Terminating route.");
491 }
else if (newEdge ==
nullptr) {
492 #ifdef DEBUG_REROUTER
494 std::cout <<
" could not find new edge!\n";
512 while (edges.size() == 0 && edgeProbs2.
getVals().size() > 0) {
513 newEdge = edgeProbs2.
get();
533 #ifdef DEBUG_REROUTER
534 if (
DEBUGCOND) std::cout <<
" rerouting: newDest=" << newEdge->
getID()
536 <<
" useNewRoute=" << useNewRoute <<
" newArrivalPos=" << newArrivalPos <<
" numClosed=" << rerouteDef->
closed.size()
539 if (useNewRoute && newArrivalPos != -1) {
598 return defaultWeight;
616 if (destParkArea ==
nullptr) {
621 bool destVisible =
false;
622 for (
auto paVis : parks) {
623 if (paVis.first == destParkArea
645 <<
" rerouteParkingArea dest=" << destParkArea->
getID()
647 <<
" newDest=" << newDestination
652 typedef std::map<std::string, double> ParkingParamMap_t;
653 typedef std::map<MSParkingArea*, ParkingParamMap_t> MSParkingAreaMap_t;
655 ParkingParamMap_t weights;
656 std::map<MSParkingArea*, ConstMSEdgeVector> newRoutes;
659 weights[
"probability"] =
getWeight(veh,
"parking.probability.weight", 0.0);
662 weights[
"capacity"] =
getWeight(veh,
"parking.capacity.weight", 0.0);
665 weights[
"absfreespace"] =
getWeight(veh,
"parking.absfreespace.weight", 0.0);
668 weights[
"relfreespace"] =
getWeight(veh,
"parking.relfreespace.weight", 0.0);
671 weights[
"distanceto"] =
getWeight(veh,
"parking.distanceto.weight",
getWeight(veh,
"parking.distance.weight", 1.0));
674 weights[
"timeto"] =
getWeight(veh,
"parking.timeto.weight", 0.0);
677 weights[
"distancefrom"] =
getWeight(veh,
"parking.distancefrom.weight", 0.0);
680 weights[
"timefrom"] =
getWeight(veh,
"parking.timefrom.weight", 0.0);
683 ParkingParamMap_t maxValues;
685 maxValues[
"probability"] = 0.0;
686 maxValues[
"capacity"] = 0.0;
687 maxValues[
"absfreespace"] = 0.0;
688 maxValues[
"relfreespace"] = 0.0;
689 maxValues[
"distanceto"] = 0.0;
690 maxValues[
"timeto"] = 0.0;
691 maxValues[
"distancefrom"] = 0.0;
692 maxValues[
"timefrom"] = 0.0;
695 MSParkingAreaMap_t parkAreas;
703 for (
int i = 0; i < (int)parks.size(); ++i) {
705 const double prob = probs[i];
709 if (paOccupancy < pa->getCapacity()) {
712 ParkingParamMap_t parkValues;
727 if (edgesToPark.size() > 0) {
733 int nextDestinationIndex = route.
size() - 1;
734 if (!newDestination) {
735 std::vector<std::pair<int, double> > stopIndices = veh.
getStopIndices();
736 if (stopIndices.size() > 1) {
737 nextDestinationIndex = stopIndices[1].first;
738 nextDestination = route.
getEdges()[nextDestinationIndex];
739 nextPos = stopIndices[1].second;
742 if (parkEdge == nextDestination && nextPos < pa->getLastFreePos(veh)) {
749 if (edgesFromPark.size() > 0 || newDestination) {
751 parkValues[
"probability"] = prob;
753 if (parkValues[
"probability"] > maxValues[
"probability"]) {
754 maxValues[
"probability"] = parkValues[
"probability"];
757 parkValues[
"capacity"] = (double)(pa->
getCapacity());
758 parkValues[
"absfreespace"] = (double)(pa->
getCapacity() - paOccupancy);
759 parkValues[
"relfreespace"] = parkValues[
"absfreespace"] / parkValues[
"capacity"];
761 if (parkValues[
"capacity"] > maxValues[
"capacity"]) {
762 maxValues[
"capacity"] = parkValues[
"capacity"];
765 if (parkValues[
"absfreespace"] > maxValues[
"absfreespace"]) {
766 maxValues[
"absfreespace"] = parkValues[
"absfreespace"];
769 if (parkValues[
"relfreespace"] > maxValues[
"relfreespace"]) {
770 maxValues[
"relfreespace"] = parkValues[
"relfreespace"];
777 routeToPark.
begin(), routeToPark.
end() - 1, includeInternalLengths);
786 if (parkValues[
"distanceto"] < brakeGap) {
795 if (parkValues[
"distanceto"] > maxValues[
"distanceto"]) {
796 maxValues[
"distanceto"] = parkValues[
"distanceto"];
799 if (parkValues[
"timeto"] > maxValues[
"timeto"]) {
800 maxValues[
"timeto"] = parkValues[
"timeto"];
805 if (newDestination) {
806 parkValues[
"distancefrom"] = 0;
807 parkValues[
"timefrom"] = 0;
809 MSRoute routeFromPark(route.
getID() +
"!frompark#1", edgesFromPark,
false,
813 routeFromPark.
begin(), routeFromPark.
end() - 1, includeInternalLengths);
816 newEdges.insert(newEdges.end(), edgesFromPark.begin() + 1, edgesFromPark.end());
817 newEdges.insert(newEdges.end(), route.
begin() + nextDestinationIndex + 1, route.
end());
820 if (parkValues[
"distancefrom"] > maxValues[
"distancefrom"]) {
821 maxValues[
"distancefrom"] = parkValues[
"distancefrom"];
824 if (parkValues[
"timefrom"] > maxValues[
"timefrom"]) {
825 maxValues[
"timefrom"] = parkValues[
"timefrom"];
828 parkAreas[pa] = parkValues;
829 newRoutes[pa] = newEdges;
833 std::cout <<
" altPA=" << pa->
getID()
846 std::cout <<
" maxValues=" <<
joinToString(maxValues,
" ",
":") <<
"\n";
851 double minParkingCost = 0.0;
853 for (MSParkingAreaMap_t::iterator it = parkAreas.begin(); it != parkAreas.end(); ++it) {
855 ParkingParamMap_t parkValues = it->second;
858 parkValues[
"probability"] = maxValues[
"probability"] > 0.0 ? 1.0 - parkValues[
"probability"] / maxValues[
"probability"] : 0.0;
859 parkValues[
"capacity"] = maxValues[
"capacity"] > 0.0 ? 1.0 - parkValues[
"capacity"] / maxValues[
"capacity"] : 0.0;
860 parkValues[
"absfreespace"] = maxValues[
"absfreespace"] > 0.0 ? 1.0 - parkValues[
"absfreespace"] / maxValues[
"absfreespace"] : 0.0;
861 parkValues[
"relfreespace"] = maxValues[
"relfreespace"] > 0.0 ? 1.0 - parkValues[
"relfreespace"] / maxValues[
"relfreespace"] : 0.0;
863 parkValues[
"distanceto"] = maxValues[
"distanceto"] > 0.0 ? parkValues[
"distanceto"] / maxValues[
"distanceto"] : 0.0;
864 parkValues[
"timeto"] = maxValues[
"timeto"] > 0.0 ? parkValues[
"timeto"] / maxValues[
"timeto"] : 0.0;
866 parkValues[
"distancefrom"] = maxValues[
"distancefrom"] > 0.0 ? parkValues[
"distancefrom"] / maxValues[
"distancefrom"] : 0.0;
867 parkValues[
"timefrom"] = maxValues[
"timefrom"] > 0.0 ? parkValues[
"timefrom"] / maxValues[
"timefrom"] : 0.0;
870 double parkingCost = 0.0;
873 for (ParkingParamMap_t::iterator pc = parkValues.begin(); pc != parkValues.end(); ++pc) {
874 parkingCost += weights[pc->first] * pc->second;
878 if (nearParkArea ==
nullptr || parkingCost < minParkingCost) {
879 minParkingCost = parkingCost;
880 nearParkArea = it->first;
881 newRoute = newRoutes[nearParkArea];
886 std::cout <<
" altPA=" << it->first->
getID() <<
" score=" << parkingCost <<
"\n";
908 for (
auto vTypeDist : vTypeDists) {
std::vector< const MSEdge * > ConstMSEdgeVector
std::vector< MSEdge * > MSEdgeVector
#define WRITE_WARNING(msg)
std::string time2string(SUMOTime t)
convert SUMOTime to string
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
const SVCPermissions SVCAll
all VClasses are allowed
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
@ SVC_AUTHORITY
authorities vehicles
@ GIVEN
The arrival position is given.
@ SUMO_TAG_INTERVAL
an aggreagated-output interval
@ SUMO_TAG_CLOSING_REROUTE
reroute of type closing
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_PARKING_ZONE_REROUTE
entry for an alternative parking zone
@ SUMO_TAG_ROUTE_PROB_REROUTE
probability of route of a reroute
@ SUMO_TAG_DEST_PROB_REROUTE
probability of destiny of a reroute
@ SUMO_TAG_CLOSING_LANE_REROUTE
lane of a reroute of type closing
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_END
weights: time range end
std::string joinToString(const std::vector< T > &v, const T_BETWEEN &between, std::streamsize accuracy=gPrecision)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A scoped lock which only triggers on condition.
MESegment * getSegmentForEdge(const MSEdge &e, double pos=0)
Get the segment for a given edge at a given position.
A single mesoscopic segment (cell)
void addDetector(MSMoveReminder *data)
Adds a data collector for a detector to this segment.
A device that performs vehicle rerouting based on current edge speeds.
A road/street connecting two junctions.
double getLength() const
return the length of the edge
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 void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
static MELoop * gMesoNet
mesoscopic simulation infrastructure
static int gNumSimThreads
how many threads to use for simulation
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
Representation of a lane in the micro simulation.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
MSEdge & getEdge() const
Returns the lane's edge.
Something on a lane to be noticed about vehicle movement.
Notification
Definition of a vehicle state.
@ NOTIFICATION_LANE_CHANGE
The vehicle changes lanes (micro only)
@ NOTIFICATION_JUNCTION
The vehicle arrived at a junction.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, const MSEdgeVector &prohibited=MSEdgeVector()) const
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
bool hasInternalLinks() const
return whether the network contains internal links
A lane area vehicles can halt at.
int getCapacity() const
Returns the area capacity.
double getLastFreePos(const SUMOVehicle &forVehicle) const
Returns the last free position on this stop.
int getLastStepOccupancy() const
Returns the area occupancy at the end of the last simulation step.
int getOccupancy() const
Returns the area occupancy.
int size() const
Returns the number of edges to pass.
const std::vector< SUMOVehicleParameter::Stop > & getStops() const
Returns the stops.
MSRouteIterator end() const
Returns the end of the list of edges to pass.
static bool dictionary(const std::string &id, const MSRoute *route)
Adds a route to the dictionary.
const MSEdge * getLastEdge() const
returns the destination edge
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....
bool containsAnyOf(const MSEdgeVector &edgelist) const
const RGBColor & getColor() const
Returns the color.
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
const ConstMSEdgeVector & getEdges() const
static SUMOAbstractRouter< MSEdge, SUMOVehicle > & getRouterTT(const int rngIndex, SUMOVehicleClass svc, const MSEdgeVector &prohibited=MSEdgeVector())
return the router instance
double getBeginLanePosition() const
Returns the begin position of this stop.
double getEndLanePosition() const
Returns the end position of this stop.
const MSLane & getLane() const
Returns the lane this stop is located at.
An abstract device that changes the state of the micro simulation.
SUMOTime setPermissions(const SUMOTime currentTime)
Sets the edge permission if there are any defined in the closingEdge.
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Tries to reroute the vehicle.
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.
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Removes the reminder.
RandomDistributor< ParkingAreaVisible > myCurrentParkProb
new destinations with probabilities
double getUserProbability() const
Returns the rerouting probability given by the user.
std::vector< MSLane * > myCurrentClosedLanes
List of closed lanes.
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
void setUserUsageProbability(double prob)
Sets the probability with which a vehicle is rerouted given by the user.
SVCPermissions myCurrentPermissions
List of permissions for closed edges.
MSParkingArea * rerouteParkingArea(const MSTriggeredRerouter::RerouteInterval *rerouteDef, SUMOVehicle &veh, bool &newDestination, ConstMSEdgeVector &newRoute) const
static MSEdge mySpecialDest_terminateRoute
virtual void myEndElement(int element)
Called when a closing tag occurs.
const RerouteInterval * getCurrentReroute(SUMOTime time, SUMOVehicle &veh) const
Returns the rerouting definition valid for the given time and vehicle, 0 if none.
double myProbability
The probability and the user-given probability.
virtual ~MSTriggeredRerouter()
Destructor.
bool inUserMode() const
Returns whether the user is setting the rerouting probability.
std::set< std::string > myVehicleTypes
The vehicle types to look for (empty means all)
MSEdgeVector myCurrentClosed
List of closed edges.
RandomDistributor< MSEdge * > myCurrentEdgeProb
new destinations with probabilities
static std::map< std::string, MSTriggeredRerouter * > myInstances
bool vehicleApplies(const SUMOVehicle &veh) const
Checks whether the detector measures vehicles of the given type.
double getWeight(SUMOVehicle &veh, const std::string param, const double defaultWeight) const
SUMOTime myCurrentIntervalBegin
The first and the last time steps of the interval.
SUMOTime myCurrentIntervalEnd
MSTriggeredRerouter(const std::string &id, const MSEdgeVector &edges, double prob, const std::string &file, bool off, SUMOTime timeThreshold, const std::string &vTypes)
Constructor.
bool myAmInUserMode
Information whether the current rerouting probability is the user-given.
RandomDistributor< const MSRoute * > myCurrentRouteProb
new routes with probabilities
static MSEdge mySpecialDest_keepDestination
special destination values
double getProbability() const
Returns the rerouting probability.
std::vector< RerouteInterval > myIntervals
List of rerouting definition intervals.
void setUserMode(bool val)
Sets whether the process is currently steered by the user.
const std::set< std::string > getVTypeDistributionMembership(const std::string &id) const
Return the distribution IDs the vehicle type is a member of.
const std::string & getOriginalID() const
Returns the id of the original vehicle type if this is a vehicle specific type, the id otherwise.
const SUMOVTypeParameter & getParameter() const
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
const std::string & getID() const
Returns the id.
static OptionsCont & getOptions()
Retrieves the options.
const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
static const RGBColor DEFAULT_COLOR
The default color (for vehicle types and vehicles)
static double rand(std::mt19937 *rng=nullptr)
Returns a random real number in [0, 1)
double getOverallProb() const
Return the sum of the probabilites assigned to the members.
const std::vector< double > & getProbs() const
Returns the probabilities assigned to the members of the distribution.
const std::vector< T > & getVals() const
Returns the members of the distribution.
T get(std::mt19937 *which=0) const
Draw a sample of the distribution.
bool add(T val, double prob, bool checkDuplicates=true)
Adds a value with an assigned probability to the distribution.
bool remove(T val)
Removes a value with an assigned probability from the distribution.
void clear()
Clears the distribution.
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,...
double recomputeCosts(const std::vector< const E * > &edges, const V *const v, SUMOTime msTime, double *lengthp=nullptr) const
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...
Encapsulated SAX-Attributes.
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.
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.
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 bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
SAX-handler base for SUMO-files.
Representation of a vehicle, person, or container.
virtual SUMOTime getWaitingTime() const =0
virtual bool isVehicle() const
Whether it is a vehicle.
virtual std::mt19937 * getRNG() const =0
Returns the associated RNG for this object.
virtual const MSVehicleType & getVehicleType() const =0
Returns the object's "vehicle" type.
virtual SUMOVehicleClass getVClass() const =0
Returns the object's access class.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
virtual const MSLane * getLane() const =0
Returns the lane the object is currently at.
virtual const MSEdge * getEdge() const =0
Returns the edge the object is currently at.
virtual double getPositionOnLane() const =0
Get the object's position along the lane.
Representation of a vehicle.
virtual std::vector< std::pair< int, double > > getStopIndices() const =0
return list of route indices and stop positions for the remaining stops
virtual const MSRoute & getRoute() const =0
Returns the current route.
virtual MSParkingArea * getNextParkingArea()=0
virtual bool replaceParkingArea(MSParkingArea *parkingArea, std::string &errorMsg)=0
Replaces a stop.
virtual MSVehicleDevice * getDevice(const std::type_info &type) const =0
Returns a device of the given type if it exists or 0.
virtual SUMOTime getAccumulatedWaitingTime() const =0
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.
virtual int getRNGIndex() const =0
virtual const std::vector< MSTransportable * > & getPersons() const =0
retrieve riding persons
virtual const ConstMSEdgeVector::const_iterator & getCurrentRouteEdge() const =0
Returns an iterator pointing to the current edge in this vehicles route.
virtual double getArrivalPos() const =0
Returns this vehicle's desired arrivalPos for its current route (may change on reroute)
virtual void replaceParameter(const SUMOVehicleParameter *newParameter)=0
Replaces the vehicle's parameter.
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.
virtual double getBrakeGap() const =0
get distance for coming to a stop (used for rerouting checks)
virtual void setArrivalPos(double arrivalPos)=0
Sets this vehicle's desired arrivalPos for its current route.
Structure representing possible vehicle parameter.
double arrivalPos
(optional) The position the vehicle shall arrive on
ArrivalPosDefinition arrivalPosProcedure
Information how the vehicle shall choose the arrival position.
std::vector< std::string > getVector()
return vector of strings
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
A wrapper for a Command function.
SUMOTime begin
The begin time these definitions are valid.
SUMOTime end
The end time these definitions are valid.
RandomDistributor< MSEdge * > edgeProbs
The distributions of new destinations to use.
RandomDistributor< const MSRoute * > routeProbs
The distributions of new routes to use.
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.
SVCPermissions permissions
The permissions to use.
MSEdgeVector closed
The list of closed edges.
std::vector< MSLane * > closedLanes
The list of closed lanes.