38 #define JUNCTION_TAZ_MISSING_HELP "\nSet option '--junction-taz' or load a TAZ-file"
52 myActiveRouteRepeat(0),
53 myActiveRoutePeriod(0),
54 myActivePlan(nullptr),
55 myActiveContainerPlan(nullptr),
56 myAddVehiclesDirectly(addVehiclesDirectly),
57 myCurrentVTypeDistribution(nullptr),
58 myCurrentRouteDistribution(nullptr),
59 myAmLoadingState(false) {
69 MSTransportable::MSTransportablePlan::iterator i;
89 const std::string element =
toString(tag);
101 const std::string tazType = useJunction ?
"junction" :
"taz";
104 if (fromTaz ==
nullptr) {
107 }
else if (fromTaz->getNumSuccessors() == 0 && tag !=
SUMO_TAG_PERSON) {
125 if (viaSink ==
nullptr) {
128 viaEdges.push_back(viaSink);
135 for (
const MSEdge* e : viaEdges) {
144 const std::string tazType = useJunction ?
"junction" :
"taz";
147 if (toTaz ==
nullptr) {
150 }
else if (toTaz->getNumPredecessors() == 0 && tag !=
SUMO_TAG_PERSON) {
211 arrivalPos = cs->getEndLanePosition();
219 if (from ==
nullptr) {
231 const std::string
error =
"No connection found between '" + from->getID() +
"' and '" + to->getID() +
"' for container '" +
myVehicleParameter->
id +
"'.";
280 while (st.hasNext()) {
281 std::string vtypeID = st.next();
283 if (type ==
nullptr) {
355 WRITE_WARNING(
"Attribute 'period' is deprecated for route. Use 'cycleTime' instead.");
363 if (vtype !=
nullptr) {
368 WRITE_ERROR(
"Disconnected route " + rid +
" when repeating.");
399 std::string type =
"vehicle";
400 if (mayBeDisconnected) {
421 if (route !=
nullptr) {
446 if (stop.until > 0) {
451 throw ProcessError(
"Cannot repeat stops with 'until' in route " + description +
" because no cycleTime is defined.");
455 if (stop.arrival > 0) {
460 throw ProcessError(
"Cannot repeat stops with 'arrival' in route " + description +
" because no cycleTime is defined.");
520 std::vector<double> probs;
533 std::string routeID = st.
next();
535 if (route ==
nullptr) {
538 const double prob = ((int)probs.size() > probIndex ? probs[probIndex] : 1.0);
544 if (probs.size() > 0 && probIndex != (int)probs.size()) {
583 if (route !=
nullptr) {
597 if (vtype ==
nullptr) {
614 if (route ==
nullptr) {
667 for (
int i = 1; i < quota; i++) {
691 throw ProcessError(
"Another vehicle with the id '" + veh_id +
"' exists.");
699 if (vehicle !=
nullptr) {
713 assert(route->
getStops().size() > 0);
717 if (stop.
index == 0) {
718 if (edges.front() != stopEdge ||
720 edges.insert(edges.begin(), stopEdge);
723 if (edges.back() != stopEdge ||
725 edges.push_back(stopEdge);
821 for (
int j = 0; j < quota; j++) {
822 if (i > 0 || j > 0) {
829 copyPlan->push_back(s->clone());
839 + (j > 0 ?
"." +
toString(j) :
""));
842 if (!pc.
add(person)) {
859 const std::string
id = vehType->
getID();
862 throw ProcessError(
"Another vehicle type (or distribution) with the id '" +
id +
"' exists.");
879 if (type ==
nullptr) {
933 if (route ==
nullptr) {
968 throw ProcessError(
"Found ride outside person element");
983 to = &bs->getLane().getEdge();
986 bs ==
nullptr ? std::numeric_limits<double>::infinity() : bs->getEndLanePosition());
990 if (st.size() != 1) {
991 throw ProcessError(
"Triggered departure for person '" + pid +
"' requires a unique lines value.");
995 const std::string vehID = st.front();
997 if (startVeh ==
nullptr) {
998 throw ProcessError(
"Unknown vehicle '" + vehID +
"' in triggered departure for person '" + pid +
"'.");
1001 throw ProcessError(
"Cannot use triggered vehicle '" + vehID +
"' in triggered departure for person '" + pid +
"'.");
1007 const std::string fromID = attrs.
get<std::string>(
SUMO_ATTR_FROM, pid.c_str(), ok);
1009 if (from ==
nullptr) {
1010 throw ProcessError(
"The from edge '" + fromID +
"' within a ride of person '" + pid +
"' is not known.");
1013 const bool stopWithAccess = (
myActivePlan->back()->getDestinationStop() !=
nullptr
1014 && &
myActivePlan->back()->getDestinationStop()->getLane().getEdge() == from);
1015 const bool transferAtJunction = (from->getFromJunction() ==
myActivePlan->back()->getDestination()->getFromJunction()
1016 || from->getFromJunction() ==
myActivePlan->back()->getDestination()->getToJunction());
1017 if (!(stopWithAccess || transferAtJunction)) {
1019 "' (edge '" + fromID +
"' != edge '" +
myActivePlan->back()->getDestination()->getID() +
"').");
1022 if (startVeh !=
nullptr && startVeh->getRoute().getEdges().front() != from) {
1023 throw ProcessError(
"Disconnected plan for triggered person '" + pid +
1024 "' (edge '" + fromID +
"' != edge '" + startVeh->getRoute().getEdges().front()->getID() +
"').");
1031 throw ProcessError(
"The start edge for person '" + pid +
"' is not known.");
1033 if (to ==
nullptr) {
1034 const std::string toID = attrs.
get<std::string>(
SUMO_ATTR_TO, pid.c_str(), ok);
1036 if (to ==
nullptr) {
1037 throw ProcessError(
"The to edge '" + toID +
"' within a ride of person '" + pid +
"' is not known.");
1050 throw ProcessError(
"Found transport outside container element");
1056 const std::string desc = attrs.
get<std::string>(
SUMO_ATTR_LINES, containerId.c_str(), ok);
1062 if (cs ==
nullptr) {
1067 cs ==
nullptr ? std::numeric_limits<double>::infinity() : cs->getEndLanePosition());
1069 const std::string fromID = attrs.
get<std::string>(
SUMO_ATTR_FROM, containerId.c_str(), ok);
1071 if (from ==
nullptr) {
1072 throw ProcessError(
"The from edge '" + fromID +
"' within a transport of container '" + containerId +
"' is not known.");
1081 const bool transferAtJunction = (from->getFromJunction() ==
myActiveContainerPlan->back()->getDestination()->getFromJunction()
1083 if (!(stopWithAccess || transferAtJunction)) {
1085 "' (edge '" + fromID +
"' != edge '" +
myActiveContainerPlan->back()->getDestination()->getID() +
"').");
1094 throw ProcessError(
"The start edge within a transport of container '" + containerId +
"' is not known.");
1096 const std::string toID = attrs.
get<std::string>(
SUMO_ATTR_TO, containerId.c_str(), ok);
1098 if (to ==
nullptr) {
1099 throw ProcessError(
"The to edge '" + toID +
"' within a transport of container '" + containerId +
"' is not known.");
1113 std::string errorSuffix;
1128 const MSEdge* edge =
nullptr;
1134 if (bs ==
nullptr) {
1148 if (cs ==
nullptr) {
1162 if (pa ==
nullptr) {
1175 if (cs ==
nullptr) {
1188 if (ows ==
nullptr) {
1203 if (ok && stop.
edge !=
"") {
1206 WRITE_ERROR(
"The edge '" + stop.
edge +
"' for a stop is not known" + errorSuffix);
1209 }
else if (ok && stop.
lane !=
"") {
1212 WRITE_ERROR(
"The lane '" + stop.
lane +
"' for a stop is not known" + errorSuffix);
1219 if (bs !=
nullptr) {
1231 WRITE_ERROR(
"A stop must be placed on a busStop, a chargingStation, an overheadWireSegment, a containerStop, a parkingArea, an edge or a lane" + errorSuffix);
1237 WRITE_WARNING(
"Deprecated attribute 'pos' in description of stop" + errorSuffix);
1244 WRITE_ERROR(
"Invalid start or end position for stop on "
1246 ? (
"lane '" + stop.
lane)
1247 : (
"edge '" + stop.
edge)) +
"'" + errorSuffix);
1260 }
else if (
myActivePlan->back()->getDestination() != edge) {
1266 const double prevAr =
myActivePlan->back()->getArrivalPos();
1267 if (start > prevAr + NUMERICAL_EPS || end < prevAr - NUMERICAL_EPS) {
1269 +
"' (stop range " +
toString(start) +
"-" +
toString(end) +
" does not cover previous arrival position " +
toString(prevAr) + +
").");
1316 const MSStage*
const lastStage,
bool& ok) {
1317 const std::string description =
"person '" + personID +
"' walking from " + fromEdge->
getID();
1320 WRITE_WARNING(
"The attribute departPos is no longer supported for walks, please use the person attribute, the arrivalPos of the previous step or explicit stops.");
1323 if (lastStage !=
nullptr) {
1336 if (bs ==
nullptr) {
1337 throw ProcessError(
"Unknown bus stop '" + bsID +
"' for " + description +
".");
1340 if (arrivalPos < 0) {
1341 throw ProcessError(
"Bus stop '" + bsID +
"' is not connected to arrival edge '" + toEdge->
getID() +
"' for " + description +
".");
1348 arrivalPos = arrPos;
1355 if (toEdge ==
nullptr) {
1356 throw ProcessError(
"No destination edge for " + description +
".");
1373 const MSEdge* from =
nullptr;
1374 const MSEdge* to =
nullptr;
1393 double departPos = 0;
1394 double arrivalPos = 0;
1401 std::string errorMsg;
1409 const std::string vtypeid = st.next();
1410 if (vehControl.
getVType(vtypeid) ==
nullptr) {
1432 stoppingPlace, duration, modeSet, types, speed, walkFactor, group,
1457 double departPos = 0;
1458 double arrivalPos = 0;
1463 if (route ==
nullptr) {
1518 return defaultGroup ==
"" ? personID : defaultGroup;
std::vector< const MSEdge * > ConstMSEdgeVector
#define JUNCTION_TAZ_MISSING_HELP
#define WRITE_WARNINGF(...)
#define WRITE_WARNING(msg)
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
const int VTYPEPARS_MAXSPEED_SET
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SVC_PEDESTRIAN
pedestrian
const double DEFAULT_VEH_PROB
const std::string DEFAULT_VTYPE_ID
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
const double DEFAULT_CONTAINER_TRANSHIP_SPEED
const int VEHPARS_ROUTE_SET
const int VEHPARS_TO_TAZ_SET
@ RANDOM
The position is chosen randomly.
const int VEHPARS_DEPARTPOS_SET
@ GIVEN
The edge index is given.
@ DEFAULT
No information given; use default.
const int VEHPARS_FROM_TAZ_SET
const int VEHPARS_FORCE_REROUTE
const double MIN_STOP_LENGTH
@ DEPART_GIVEN
The time is given.
@ DEPART_TRIGGERED
The departure is person triggered.
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_STOP
stop for vehicles
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_OVERHEAD_WIRE_SEGMENT
An overhead wire segment.
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_ATTR_CONTAINER_STOP
@ SUMO_ATTR_DEPARTPOS_LAT
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_COLOR
A color information.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void error(const XERCES_CPP_NAMESPACE::SAXParseException &exception)
Handler for XML-errors.
A road/street connecting two junctions.
static void parseEdgesList(const std::string &desc, ConstMSEdgeVector &into, const std::string &rid)
Parses the given string assuming it contains a list of edge ids divided by spaces.
const MSEdge * getNormalSuccessor() const
if this edge is an internal edge, return its first normal successor, otherwise the edge itself
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
double getLength() const
return the length of the edge
bool isInternal() const
return whether this edge is an internal 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....
const MSEdge * getNormalBefore() const
if this edge is an internal edge, return its first normal predecessor, otherwise the edge itself
const MSJunction * getToJunction() const
static bool gStateLoaded
Information whether a state has been loaded.
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
void add(SUMOVehicle *veh)
Adds a single vehicle for departure.
SUMOTime computeRandomDepartOffset() const
compute (optional) random offset to the departure time
Representation of a lane in the micro simulation.
double getLength() const
Returns the lane's length.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
MSEdge & getEdge() const
Returns the lane's edge.
The simulated network and simulation perfomer.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
virtual MSTransportableControl & getContainerControl()
Returns the container control.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag category) const
Returns the named stopping place of the given category.
bool hasContainers() const
Returns whether containers are simulated.
MSInsertionControl & getInsertionControl()
Returns the insertion control.
bool hasPersons() const
Returns whether persons are simulated.
virtual MSTransportableControl & getPersonControl()
Returns the person control.
static std::mt19937 myParsingRNG
A random number generator used to choose from vtype/route distributions and computing the speed facto...
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
void addStop(const SUMOSAXAttributes &attrs)
Processing of a stop.
bool myAmLoadingState
whether a state file is being loaded
SUMOTime myActiveRoutePeriod
void closeVType()
Ends the processing of a vehicle type.
void openTrip(const SUMOSAXAttributes &attrs)
opens a trip for reading
void closeVehicleTypeDistribution()
closes (ends) the building of a distribution
std::string myCurrentVTypeDistributionID
The id of the currently parsed vehicle type distribution.
RandomDistributor< const MSRoute * > * myCurrentRouteDistribution
The currently parsed distribution of routes (probability->route)
void closeRouteDistribution()
closes (ends) the building of a distribution
void parseFromViaTo(SumoXMLTag tag, const SUMOSAXAttributes &attrs)
Called for parsing from and to and the corresponding taz attributes.
void closeFlow()
Ends the processing of a flow.
void closeContainer()
Ends the processing of a container.
MSTransportable::MSTransportablePlan * myActiveContainerPlan
The plan of the current container.
std::string myCurrentRouteDistributionID
The id of the currently parsed route distribution.
void closePersonFlow()
Ends the processing of a personFlow.
void openRouteFlow(const SUMOSAXAttributes &attrs)
opens a route flow for reading
RandomDistributor< MSVehicleType * > * myCurrentVTypeDistribution
The currently parsed distribution of vehicle types (probability->vehicle type)
void deleteActivePlans()
delete already created MSTransportablePlans if error occurs before handing over responsibility to a M...
void closePerson()
Ends the processing of a person.
void closeTrip()
Ends the processing of a trip.
void openRouteDistribution(const SUMOSAXAttributes &attrs)
opens a route distribution for reading
ConstMSEdgeVector myActiveRoute
The current route.
int myActiveRouteRepeat
number of repetitions of the active route
MSTransportable::MSTransportablePlan * myActivePlan
The plan of the current person.
void addPersonTrip(const SUMOSAXAttributes &attrs)
add a routing request for a walking or intermodal person
void addTranship(const SUMOSAXAttributes &attrs)
Processing of a tranship.
virtual void closeVehicle()
Ends the processing of a vehicle (note: is virtual because is reimplemented in MSStateHandler)
MSRoute * addVehicleStopsToImplicitRoute(const MSRoute *route, bool isPermanent)
adapt implicit route (edges derived from stops) to additional vehicle-stops
void openVehicleTypeDistribution(const SUMOSAXAttributes &attrs)
opens a type distribution for reading
void openFlow(const SUMOSAXAttributes &attrs)
opens a flow for reading
MSRouteHandler(const std::string &file, bool addVehiclesDirectly)
standard constructor
virtual ~MSRouteHandler()
standard destructor
bool myAddVehiclesDirectly
Information whether vehicles shall be directly added to the network or kept within the buffer.
void addWalk(const SUMOSAXAttributes &attrs)
add a fully specified walk
void openRoute(const SUMOSAXAttributes &attrs)
opens a route for reading
void addTransport(const SUMOSAXAttributes &attrs)
Processing of a transport.
void parseWalkPositions(const SUMOSAXAttributes &attrs, const std::string &personID, const MSEdge *fromEdge, const MSEdge *&toEdge, double &departPos, double &arrivalPos, MSStoppingPlace *&bs, const MSStage *const lastStage, bool &ok)
@ brief parse depart- and arrival positions of a walk
void addRide(const SUMOSAXAttributes &attrs)
Processing of a ride.
static std::string getDefaultGroup(const std::string &personID)
determine the default group for rides and trips
void addFlowPerson(SUMOTime depart, MSVehicleType *type, const std::string &baseID, int i)
delete already created MSTransportablePlans if error occurs before handing over responsibility to a M...
void addPerson(const SUMOSAXAttributes &attrs)
Processing of a person.
void closeRoute(const bool mayBeDisconnected=false)
closes (ends) the building of a route.
void addContainer(const SUMOSAXAttributes &attrs)
Processing of a container.
void addReference() const
increments the reference counter for the route
void setReroute(bool reroute=true)
const std::vector< SUMOVehicleParameter::Stop > & getStops() const
Returns the stops.
static bool dictionary(const std::string &id, const MSRoute *route)
Adds a route to the dictionary.
void setCosts(double costs)
Sets the costs of the route.
void release() const
deletes the route if there are no further references to it
const RGBColor & getColor() const
Returns the color.
void setPeriod(SUMOTime period)
sets the period
const ConstMSEdgeVector & getEdges() const
const MSEdge * getDestination() const
returns the destination edge
virtual double getArrivalPos() const
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
A lane area vehicles can halt at.
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.
double getAccessPos(const MSEdge *edge) const
the position on the given edge which is connected to this stop, -1 on failure
virtual MSTransportable * buildPerson(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan, std::mt19937 *rng) const
Builds a new person.
int getLoadedNumber() const
Returns the number of build transportables.
virtual MSTransportable * buildContainer(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan) const
Builds a new container.
bool add(MSTransportable *transportable)
Adds a single transportable, returns false if an id clash occurred.
MSTransportable * get(const std::string &id) const
Returns the named transportable, if existing.
std::vector< MSStage * > MSTransportablePlan
the structure holding the plan of a transportable
The class responsible for building and deletion of vehicles.
virtual void deleteVehicle(SUMOVehicle *v, bool discard=false)
Deletes the vehicle.
virtual bool addVehicle(const std::string &id, SUMOVehicle *v)
Tries to insert the vehicle into the internal vehicle container.
SUMOVehicle * getVehicle(const std::string &id) const
Returns the vehicle with the given id.
int getQuota(double frac=-1, int loaded=-1) const
Returns the number of instances of the current vehicle that shall be emitted considering that "frac" ...
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.
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.
The car-following model and parameter.
double getDefaultProbability() const
Get the default probability of this vehicle type.
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
static MSVehicleType * build(SUMOVTypeParameter &from)
Builds the microsim vehicle type described by the given parameter.
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
const std::string & getID() const
Returns the name of the vehicle type.
bool wasSet(int what) const
Returns whether the given parameter was set.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
const std::string & getID() const
Returns the id.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
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.
bool add(T val, double prob, bool checkDuplicates=true)
Adds a value with an assigned probability to the distribution.
Parser for routes during their loading.
bool parseStop(SUMOVehicleParameter::Stop &stop, const SUMOSAXAttributes &attrs, std::string errorSuffix, MsgHandler *const errorOutput)
parses attributes common to all stops
std::vector< SUMOVehicleParameter::Stop > myActiveRouteStops
List of the stops on the parsed route.
void registerLastDepart()
save last depart (only to be used if vehicle is not discarded)
double myCurrentCosts
The currently parsed route costs.
std::string myActiveRouteID
The id of the current route.
SUMOVehicleParameter * myVehicleParameter
Parameter of the current vehicle, trip, person, container or flow.
const bool myHardFail
flag to enable or disable hard fails
SUMOVTypeParameter * myCurrentVType
The currently parsed vehicle type.
static StopPos checkStopPos(double &startPos, double &endPos, const double laneLength, const double minLength, const bool friendlyPos)
check start and end position of a stop
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
double myActiveRouteProbability
The probability of the current route.
int myInsertStopEdgesAt
where stop edges can be inserted into the current route (-1 means no insertion)
std::string myActiveRouteRefID
The id of the route the current route references to.
const RGBColor * myActiveRouteColor
The currently parsed route's color.
bool checkLastDepart()
Checks whether the route file is sorted by departure time if needed.
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.
const std::vector< std::string > getStringVector(int attr) const
Tries to read given attribute assuming it is a string vector.
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.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
virtual const SUMOVehicleParameter & getParameter() const =0
Returns the vehicle's parameter (including departure definition)
Representation of a vehicle.
Definition of vehicle stop (position and duration)
std::string edge
The edge to stop at (used only in NETEDIT)
std::string lane
The lane to stop at.
std::string parkingarea
(Optional) parking area if one is assigned to the stop
double startPos
The stopping position start.
std::string chargingStation
(Optional) charging station if one is assigned to the stop
std::string overheadWireSegment
(Optional) overhead line segment if one is assigned to the stop
int index
at which position in the stops list
SUMOTime until
The time at which the vehicle may continue its journey.
double endPos
The stopping position end.
std::string busstop
(Optional) bus stop if one is assigned to the stop
std::string containerstop
(Optional) container stop if one is assigned to the stop
SUMOTime duration
The stopping duration.
Structure representing possible vehicle parameter.
double repetitionProbability
The probability for emitting a vehicle per second.
int parametersSet
Information for the router which parameter were set, TraCI may modify this (when changing color)
std::string vtypeid
The vehicle's type id.
SUMOTime repetitionOffset
The time offset between vehicle reinsertions.
std::vector< std::string > via
List of the via-edges the vehicle must visit.
int repetitionsDone
The number of times the vehicle was already inserted.
SUMOTime repetitionEnd
The time at which the flow ends (only needed when using repetitionProbability)
double departPos
(optional) The position the vehicle shall depart from
std::string routeid
The vehicle's route id.
std::string id
The vehicle's id.
std::vector< Stop > stops
List of the stops the vehicle will make, TraCI may add entries here.
int departEdge
(optional) The initial edge within the route of the vehicle
static bool parsePersonModes(const std::string &modes, const std::string &element, const std::string &id, SVCPermissions &modeSet, std::string &error)
Validates a given person modes value.
bool wasSet(int what) const
Returns whether the given parameter was set.
DepartEdgeDefinition departEdgeProcedure
Information how the vehicle's initial edge shall be chosen.
static double interpretEdgePos(double pos, double maximumValue, SumoXMLAttr attr, const std::string &id, bool silent=false)
Interprets negative edge positions and fits them onto a given edge.
DepartDefinition departProcedure
Information how the vehicle shall choose the depart time.
DepartPosDefinition departPosProcedure
Information how the vehicle shall choose the departure position.
static double parseWalkPos(SumoXMLAttr attr, const bool hardFail, const std::string &id, double maxPos, const std::string &val, std::mt19937 *rng=0)
parse departPos or arrivalPos for a walk
bool hasNext()
returns the information whether further substrings exist
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
static double toDoubleSecure(const std::string &sData, const double def)
converts a string into the integer value described by it