Path: blob/main/src/utils/vehicle/SUMOVehicleParameter.h
169678 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file SUMOVehicleParameter.h14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @author Axel Wegener17/// @author Michael Behrisch18/// @date 2006-01-2419///20// Structure representing possible vehicle parameter21/****************************************************************************/22#pragma once23#include <config.h>2425#include <string>26#include <utils/common/Parameterised.h>27#include <utils/common/RGBColor.h>28#include <utils/common/SUMOTime.h>29#include <utils/common/SUMOVehicleClass.h>303132// ===========================================================================33// class declarations34// ===========================================================================35class OutputDevice;36class OptionsCont;373839// ===========================================================================40// value definitions41// ===========================================================================42const long long int VEHPARS_COLOR_SET = 1;43const long long int VEHPARS_VTYPE_SET = 2;44const long long int VEHPARS_DEPARTLANE_SET = 2 << 1;45const long long int VEHPARS_DEPARTPOS_SET = 2 << 2;46const long long int VEHPARS_DEPARTSPEED_SET = 2 << 3;47const long long int VEHPARS_END_SET = 2 << 4;48const long long int VEHPARS_NUMBER_SET = 2 << 5;49const long long int VEHPARS_PERIOD_SET = 2 << 6;50const long long int VEHPARS_VPH_SET = 2 << 7;51const long long int VEHPARS_PROB_SET = 2 << 8;52const long long int VEHPARS_POISSON_SET = 2 << 9;53const long long int VEHPARS_ROUTE_SET = 2 << 10;54const long long int VEHPARS_ARRIVALLANE_SET = 2 << 11;55const long long int VEHPARS_ARRIVALPOS_SET = 2 << 12;56const long long int VEHPARS_ARRIVALSPEED_SET = 2 << 13;57const long long int VEHPARS_LINE_SET = 2 << 14;58const long long int VEHPARS_FROM_TAZ_SET = 2 << 15;59const long long int VEHPARS_TO_TAZ_SET = 2 << 16;60const long long int VEHPARS_FORCE_REROUTE = 2 << 17;61const long long int VEHPARS_PERSON_CAPACITY_SET = 2 << 18;62const long long int VEHPARS_PERSON_NUMBER_SET = 2 << 19;63const long long int VEHPARS_CONTAINER_NUMBER_SET = 2 << 20;64const long long int VEHPARS_DEPARTPOSLAT_SET = 2 << 21;65const long long int VEHPARS_ARRIVALPOSLAT_SET = 2 << 22;66const long long int VEHPARS_VIA_SET = 2 << 23;67const long long int VEHPARS_SPEEDFACTOR_SET = 2 << 24;68const long long int VEHPARS_DEPARTEDGE_SET = 2 << 25;69const long long int VEHPARS_ARRIVALEDGE_SET = 2 << 26;70const long long int VEHPARS_CALIBRATORSPEED_SET = 2 << 27;71const long long int VEHPARS_JUNCTIONMODEL_PARAMS_SET = 2 << 28;72const long long int VEHPARS_CFMODEL_PARAMS_SET = 2 << 29;73const long long int VEHPARS_PARKING_BADGES_SET = (long long int)2 << 30;74const long long int VEHPARS_INSERTION_CHECKS_SET = (long long int)2 << 31;7576const int STOP_INDEX_END = -1;77const int STOP_INDEX_FIT = -2;78const int STOP_INDEX_REPEAT = -3;7980const int STOP_START_SET = 1;81const int STOP_END_SET = 2;82const int STOP_DURATION_SET = 2 << 1;83const int STOP_UNTIL_SET = 2 << 2;84const int STOP_EXTENSION_SET = 2 << 3;85const int STOP_TRIGGER_SET = 2 << 4;86const int STOP_PARKING_SET = 2 << 5;87const int STOP_EXPECTED_SET = 2 << 6;88const int STOP_CONTAINER_TRIGGER_SET = 2 << 7;89const int STOP_EXPECTED_CONTAINERS_SET = 2 << 8;90const int STOP_TRIP_ID_SET = 2 << 9;91const int STOP_LINE_SET = 2 << 10;92const int STOP_SPEED_SET = 2 << 11;93const int STOP_SPLIT_SET = 2 << 12;94const int STOP_JOIN_SET = 2 << 13;95const int STOP_ARRIVAL_SET = 2 << 14;96const int STOP_PERMITTED_SET = 2 << 15;97const int STOP_ENDED_SET = 2 << 16;98const int STOP_STARTED_SET = 2 << 17;99const int STOP_POSLAT_SET = 2 << 18;100const int STOP_ONDEMAND_SET = 2 << 19;101const int STOP_JUMP_SET = 2 << 20;102const int STOP_JUMP_UNTIL_SET = 2 << 21;103const int STOP_PRIORITY_SET = 2 << 22;104105const double MIN_STOP_LENGTH = 2 * POSITION_EPS;106107const std::string LINE_ANY = "ANY";108109// ===========================================================================110// enum definitions111// ===========================================================================112/**113* @enum DepartDefinition114* @brief Possible ways to depart115*/116enum class DepartDefinition {117/// @brief The time is given118GIVEN,119/// @brief The departure is person triggered120TRIGGERED,121/// @brief The departure is container triggered122CONTAINER_TRIGGERED,123/// @brief The vehicle is discarded if emission fails (not fully implemented yet)124NOW,125/// @brief The departure is triggered by a train split126SPLIT,127/// @brief The departure is at simulation start128BEGIN,129/// @brief Tag for the last element in the enum for safe int casting130DEF_MAX131};132133134/**135* @enum DepartLaneDefinition136* @brief Possible ways to choose a lane on depart137*/138enum class DepartLaneDefinition {139/// @brief No information given; use default140DEFAULT,141/// @brief The lane is given142GIVEN,143/// @brief The lane is chosen randomly144RANDOM,145/// @brief The least occupied lane is used146FREE,147/// @brief The least occupied lane from lanes which allow the continuation148ALLOWED_FREE,149/// @brief The least occupied lane from best lanes150BEST_FREE,151/// @brief The lane most likely according the speedFactor (from best lanes)152BEST_PROB,153/// @brief The rightmost lane the vehicle may use154FIRST_ALLOWED155};156157158/**159* @enum DepartPosDefinition160* @brief Possible ways to choose the departure position161*/162enum class DepartPosDefinition {163/// @brief No information given; use default164DEFAULT,165/// @brief The position is given166GIVEN,167/// @brief The position is set by the vehroute device168GIVEN_VEHROUTE,169/// @brief A random position is chosen170RANDOM,171/// @brief A free position is chosen172FREE,173/// @brief Back-at-zero position174BASE,175/// @brief Insert behind the last vehicle as close as possible to still allow the specified departSpeed. Fallback to DepartPosDefinition::BASE if there is no vehicle on the departLane yet.176LAST,177/// @brief If a fixed number of random choices fails, a free position is chosen178RANDOM_FREE,179/// @brief The position may be chosen freely in a polygon defined by a taz180RANDOM_LOCATION,181/// @brief depart position for a split vehicle is in front of the continuing vehicle182SPLIT_FRONT,183/// @brief depart position is endPos of first stop184STOP185};186187188/**189* @enum DepartPosLatDefinition190* @brief Possible ways to choose the lateral departure position191*/192enum class DepartPosLatDefinition {193/// @brief No information given; use default194DEFAULT,195/// @brief The position is given196GIVEN,197/// @brief The position is set by the vehroute device198GIVEN_VEHROUTE,199/// @brief At the rightmost side of the lane200RIGHT,201/// @brief At the center of the lane202CENTER,203/// @brief At the leftmost side of the lane204LEFT,205/// @brief The lateral position is chosen randomly206RANDOM,207/// @brief A free lateral position is chosen208FREE,209/// @brief If a fixed number of random choices fails, a free lateral position is chosen210RANDOM_FREE211};212213214/**215* @enum DepartSpeedDefinition216* @brief Possible ways to choose the departure speed217*/218enum class DepartSpeedDefinition {219/// @brief No information given; use default220DEFAULT,221/// @brief The speed is given222GIVEN,223/// @brief The speed is set by the vehroute device224GIVEN_VEHROUTE,225/// @brief The speed is chosen randomly226RANDOM,227/// @brief The maximum safe speed is used228MAX,229/// @brief The maximum lane speed is used (speedLimit * speedFactor)230DESIRED,231/// @brief The maximum lane speed is used (speedLimit)232LIMIT,233/// @brief The speed of the last vehicle. Fallback to DepartSpeedDefinition::DESIRED if there is no vehicle on the departLane yet.234LAST,235/// @brief The average speed on the lane. Fallback to DepartSpeedDefinition::DESIRED if there is no vehicle on the departLane yet.236AVG237};238239240/**241* @enum RouteIndexDefinition242* @brief Possible ways to choose the departure and arrival edge243*/244enum class RouteIndexDefinition {245/// @brief No information given; use default246DEFAULT,247/// @brief The edge index is given248GIVEN,249/// @brief The edge is chosen randomly250RANDOM,251};252253254/**255* @enum ArrivalLaneDefinition256* @brief Possible ways to choose the arrival lane257*/258enum class ArrivalLaneDefinition {259/// @brief No information given; use default260DEFAULT = 0,261/// @brief The current lane shall be used262CURRENT = 1,263/// @brief The arrival lane is given264GIVEN = 2,265/// @brief The lane is chosen randomly266RANDOM = 3,267/// @brief The rightmost lane the vehicle may use268FIRST_ALLOWED = 4269};270271272/**273* @enum ArrivalPosDefinition274* @brief Possible ways to choose the arrival position275*/276enum class ArrivalPosDefinition {277/// @brief No information given; use default278DEFAULT,279/// @brief The arrival position is given280GIVEN,281/// @brief The arrival position is chosen randomly282RANDOM,283/// @brief Half the road length284CENTER,285/// @brief The maximum arrival position is used286MAX287};288289290/**291* @enum ArrivalPosLatDefinition292* @brief Possible ways to choose the lateral arrival position293*/294enum class ArrivalPosLatDefinition {295/// @brief No information given; use default296DEFAULT,297/// @brief The position is given298GIVEN,299/// @brief At the rightmost side of the lane300RIGHT,301/// @brief At the center of the lane302CENTER,303/// @brief At the leftmost side of the lane304LEFT305};306307308/**309* @enum ArrivalSpeedDefinition310* @brief Possible ways to choose the arrival speed311*/312enum class ArrivalSpeedDefinition {313/// @brief No information given; use default314DEFAULT,315/// @brief The speed is given316GIVEN,317/// @brief The current speed is used318CURRENT319};320321322// ===========================================================================323// struct definitions324// ===========================================================================325/**326* @class SUMOVehicleParameter327* @brief Structure representing possible vehicle parameter328*329* When used within a vehicle, parameter are usually const except for selected items330* adaptable via TraCI which are flagged as mutable below331* The fields yielding with "Procedure" describe whether the according value332* shall be used or another procedure is used to choose the value.333* @see DepartLaneDefinition334* @see DepartPosDefinition335* @see DepartSpeedDefinition336*/337class SUMOVehicleParameter : public Parameterised {338public:339/** @brief Constructor340*341* Initialises the structure with default values342*/343SUMOVehicleParameter();344345/// @brief Destructor346virtual ~SUMOVehicleParameter();347348/** @struct Stop349* @brief Definition of vehicle stop (position and duration)350*/351class Stop : public Parameterised {352public:353/// @brief Destructor354virtual ~Stop() {}355356/** @brief Writes the stop as XML357*358* @param[in, out] dev The device to write into359* @exception IOError not yet implemented360*/361void write(OutputDevice& dev, const bool close = true, const bool writeTagAndParents = true) const;362363/// @brief return list of stopping place ids364std::vector<std::string> getStoppingPlaceIDs() const;365366/// @brief write trigger attribute367std::vector<std::string> getTriggers() const;368369/// @brief The edge to stop at370std::string edge;371372/// @brief The lane to stop at373std::string lane;374375/// @brief (Optional) bus stop if one is assigned to the stop376std::string busstop;377378/// @brief (Optional) container stop if one is assigned to the stop379std::string containerstop;380381/// @brief (Optional) parking area if one is assigned to the stop382std::string parkingarea;383384/// @brief (Optional) charging station if one is assigned to the stop385std::string chargingStation;386387/// @brief (Optional) overhead line segment if one is assigned to the stop388std::string overheadWireSegment;389390/// @brief The stopping position start391double startPos = 0.;392393/// @brief The stopping position end394double endPos = 0.;395396/// @brief The (expected) time at which the vehicle reaches the stop397SUMOTime arrival = -1;398399/// @brief The stopping duration400SUMOTime duration = -1;401402/// @brief The time at which the vehicle may continue its journey403SUMOTime until = -1;404405/// @brief The maximum time extension for boarding / loading406SUMOTime extension = -1;407408/// @brief The earliest pickup time for a taxi stop409SUMOTime waitUntil = -1;410411/// @brief whether an arriving person lets the vehicle continue412bool triggered = false;413414/// @brief whether an arriving container lets the vehicle continue415bool containerTriggered = false;416417/// @brief whether an joined vehicle lets this vehicle continue418bool joinTriggered = false;419420/// @brief whether the vehicle is removed from the net while stopping421ParkingType parking = ParkingType::ONROAD;422423/// @brief IDs of persons the vehicle has to wait for until departing424std::set<std::string> awaitedPersons;425426/// @brief IDs of persons or containers that may board/load at this stop427std::set<std::string> permitted;428429/// @brief IDs of containers the vehicle has to wait for until departing430std::set<std::string> awaitedContainers;431432/// @brief enable or disable friendly position (used by netedit)433bool friendlyPos = false;434435/// @brief act Type (only used by Persons) (used by netedit)436std::string actType;437438/// @brief id of the trip within a cyclical public transport route439std::string tripId;440441/// @brief the new line id of the trip within a cyclical public transport route442std::string line;443444/// @brief the id of the vehicle (train portion) that splits of upon reaching this stop445std::string split;446447/// @brief the id of the vehicle (train portion) to which this vehicle shall be joined448std::string join;449450/// @brief the speed at which this stop counts as reached (waypoint mode)451double speed = 0.;452453/// @brief the lateral offset when stopping454double posLat = INVALID_DOUBLE;455456/// @brief whether the stop may be skipped457bool onDemand = false;458459/// @brief priority for weighting/skipping stops460double priority = -1;461462/// @brief transfer time if there shall be a jump from this stop to the next route edge463SUMOTime jump = -1;464465/// @brief earlierst jump end if there shall be a jump from this stop to the next route edge466SUMOTime jumpUntil = -1;467468/// @brief the time at which this stop was reached469mutable SUMOTime started = -1;470471/// @brief the time at which this stop was ended472mutable SUMOTime ended = -1;473474/// @brief lanes and positions connected to this stop (only used by duarouter where Stop is used to store stopping places)475std::vector<std::tuple<std::string, double, double> > accessPos;476477/// @brief at which position in the stops list478int index = 0;479480/// @brief at which position within the route (only used for state saving)481mutable int routeIndex = 0;482483/// @brief Information for the output which parameter were set484int parametersSet = 0;485486/// @brief Whether this stop was triggered by a collision487bool collision = false;488489/// @brief Whether this stop was triggered by a car failure / mechanical problem / lack of energy490bool breakDown = false;491492/// @brief return flags as per Vehicle::getStops493int getFlags() const;494};495496/** @brief Returns whether the given parameter was set497* @param[in] what The parameter which one asks for498* @return Whether the given parameter was set499*/500bool wasSet(long long int what) const {501return (parametersSet & what) != 0;502}503504/** @brief Writes the parameters as a beginning element505*506* @param[in, out] dev The device to write into507* @param[in] oc The options to get defaults from508* @param[in] altTag The "root" tag to write (defaults to vehicle)509* @param[in] typeID The typeID to write (defaults to member vtypeid)510* @exception IOError not yet implemented511*/512void write(OutputDevice& dev, const OptionsCont& oc, const SumoXMLTag altTag = SUMO_TAG_VEHICLE, const std::string& typeID = "") const;513514/** @brief Returns whether the defaults shall be used515* @param[in] oc The options to get the options from516* @param[in] optionName The name of the option to determine whether its value shall be used517* @return Whether the option is set and --defaults-override was set518*/519bool defaultOptionOverrides(const OptionsCont& oc, const std::string& optionName) const;520521/// @name Depart/arrival-attributes verification522/// @{523/** @brief Validates a given depart value524* @param[in] val The depart value to parse525* @param[in] element The name of the type of the parsed element, for building the error message526* @param[in] id The id of the parsed element, for building the error message527* @param[out] depart The parsed depart time, if given528* @param[out] dd The parsed departProcedure definition529* @param[out] error Error message, if an error occures530* @return Whether the given value is a valid depart definition531*/532static bool parseDepart(const std::string& val, const std::string& element, const std::string& id,533SUMOTime& depart, DepartDefinition& dd, std::string& error, const std::string& attr = "departure");534535/** @brief Validates a given departLane value536* @param[in] val The departLane value to parse537* @param[in] element The name of the type of the parsed element, for building the error message538* @param[in] id The id of the parsed element, for building the error message539* @param[out] lane The parsed lane, if given540* @param[out] dld The parsed departLane definition541* @param[out] error Error message, if an error occures542* @return Whether the given value is a valid departLane definition543*/544static bool parseDepartLane(const std::string& val, const std::string& element, const std::string& id,545int& lane, DepartLaneDefinition& dld, std::string& error);546547/** @brief Validates a given departPos value548* @param[in] val The departPos value to parse549* @param[in] element The name of the type of the parsed element, for building the error message550* @param[in] id The id of the parsed element, for building the error message551* @param[out] pos The parsed position, if given552* @param[out] dpd The parsed departPos definition553* @param[out] error Error message, if an error occures554* @return Whether the given value is a valid departPos definition555*/556static bool parseDepartPos(const std::string& val, const std::string& element, const std::string& id,557double& pos, DepartPosDefinition& dpd, std::string& error);558559/** @brief Validates a given departPosLat value560* @param[in] val The departPosLat value to parse561* @param[in] element The name of the type of the parsed element, for building the error message562* @param[in] id The id of the parsed element, for building the error message563* @param[out] pos The parsed position, if given564* @param[out] dpd The parsed departPosLat definition565* @param[out] error Error message, if an error occures566* @return Whether the given value is a valid departPosLat definition567*/568static bool parseDepartPosLat(const std::string& val, const std::string& element, const std::string& id,569double& pos, DepartPosLatDefinition& dpd, std::string& error);570571/** @brief Validates a given departSpeed value572* @param[in] val The departSpeed value to parse573* @param[in] element The name of the type of the parsed element, for building the error message574* @param[in] id The id of the parsed element, for building the error message575* @param[out] speed The parsed speed, if given576* @param[out] dsd The parsed departSpeed definition577* @param[out] error Error message, if an error occures578* @return Whether the given value is a valid departSpeed definition579*/580static bool parseDepartSpeed(const std::string& val, const std::string& element, const std::string& id,581double& speed, DepartSpeedDefinition& dsd, std::string& error);582583/** @brief Validates a given departEdge or arrivalEdge value584* @param[in] val The departEdge value to parse585* @param[in] element The name of the type of the parsed element, for building the error message586* @param[in] id The id of the parsed element, for building the error message587* @param[out] edgeIndex The parsed edge index, if given588* @param[out] ded The parsed departEdge definition589* @param[out] error Error message, if an error occures590* @return Whether the given value is a valid departEdge definition591*/592static bool parseRouteIndex(const std::string& val, const std::string& element, const std::string& id,593const SumoXMLAttr attr,594int& edgeIndex, RouteIndexDefinition& rid, std::string& error);595596/** @brief Validates a given arrivalLane value597* @param[in] val The arrivalLane value to parse598* @param[in] element The name of the type of the parsed element, for building the error message599* @param[in] id The id of the parsed element, for building the error message600* @param[out] lane The parsed lane, if given601* @param[out] ald The parsed arrivalLane definition602* @param[out] error Error message, if an error occures603* @return Whether the given value is a valid arrivalLane definition604*/605static bool parseArrivalLane(const std::string& val, const std::string& element, const std::string& id,606int& lane, ArrivalLaneDefinition& ald, std::string& error);607608/** @brief Validates a given arrivalPos value609* @param[in] val The arrivalPos value to parse610* @param[in] element The name of the type of the parsed element, for building the error message611* @param[in] id The id of the parsed element, for building the error message612* @param[out] pos The parsed position, if given613* @param[out] apd The parsed arrivalPos definition614* @param[out] error Error message, if an error occures615* @return Whether the given value is a valid arrivalPos definition616*/617static bool parseArrivalPos(const std::string& val, const std::string& element, const std::string& id,618double& pos, ArrivalPosDefinition& apd, std::string& error);619620/** @brief Validates a given arrivalPosLat value621* @param[in] val The arrivalPosLat value to parse622* @param[in] element The name of the type of the parsed element, for building the error message623* @param[in] id The id of the parsed element, for building the error message624* @param[out] pos The parsed position, if given625* @param[out] apd The parsed arrivalPosLat definition626* @param[out] error Error message, if an error occures627* @return Whether the given value is a valid arrivalPosLat definition628*/629static bool parseArrivalPosLat(const std::string& val, const std::string& element, const std::string& id,630double& pos, ArrivalPosLatDefinition& apd, std::string& error);631632633/** @brief Validates a given arrivalSpeed value634* @param[in] val The arrivalSpeed value to parse635* @param[in] element The name of the type of the parsed element, for building the error message636* @param[in] id The id of the parsed element, for building the error message637* @param[out] speed The parsed speed, if given638* @param[out] asd The parsed arrivalSpeed definition639* @param[out] error Error message, if an error occures640* @return Whether the given value is a valid arrivalSpeed definition641*/642static bool parseArrivalSpeed(const std::string& val, const std::string& element, const std::string& id,643double& speed, ArrivalSpeedDefinition& asd, std::string& error);644/// @}645646/** @brief Interprets negative edge positions and fits them onto a given edge647* @param[in] pos The position to be interpreted648* @param[in] maximumValue The maximum allowed value (edge length)649* @param[in] attr The attribute from which the value originated650* @param[in] id The id of the object to which this attribute belongs651* @return Whether the interpreted position652*/653static double interpretEdgePos(double pos, double maximumValue, SumoXMLAttr attr, const std::string& id, bool silent = false);654655/** @brief Validates a given person modes value656* @param[in] modes The modes value to parse657* @param[in] element The name of the type of the parsed element, for building the error message658* @param[in] id The id of the parsed element, for building the error message659* @param[out] modeSet The parsed modes definition660* @param[out] error Error message, if an error occures661* @return Whether the given value is a valid arrivalSpeed definition662*/663static bool parsePersonModes(const std::string& modes, const std::string& element, const std::string& id, SVCPermissions& modeSet, std::string& error);664665/// @brief parses stop trigger values666static void parseStopTriggers(const std::vector<std::string>& triggers, bool expectTrigger, Stop& stop);667668/// @brief parses parking type value669static ParkingType parseParkingType(const std::string& value);670671/// @brief parses insertion checks672static int parseInsertionChecks(const std::string& value);673674/// @brief The vehicle tag675SumoXMLTag tag;676677/// @brief The vehicle's id678std::string id;679680/// @brief The vehicle's route id681std::string routeid;682683/// @brief The vehicle's type id684std::string vtypeid;685686/// @brief The vehicle's color, TraCI may change this687mutable RGBColor color;688689/// @name Departure definition690/// @{691/// @brief The vehicle's departure time692SUMOTime depart;693694/// @brief Information how the vehicle shall choose the depart time695DepartDefinition departProcedure;696697/// @brief (optional) The lane the vehicle shall depart from (index in edge)698int departLane;699700/// @brief Information how the vehicle shall choose the lane to depart from701DepartLaneDefinition departLaneProcedure;702703/// @brief (optional) The position the vehicle shall depart from704double departPos;705706/// @brief Information how the vehicle shall choose the departure position707DepartPosDefinition departPosProcedure;708709/// @brief (optional) The lateral position the vehicle shall depart from710double departPosLat;711712/// @brief Information how the vehicle shall choose the lateral departure position713DepartPosLatDefinition departPosLatProcedure;714715/// @brief (optional) The initial speed of the vehicle716double departSpeed;717718/// @brief Information how the vehicle's initial speed shall be chosen719DepartSpeedDefinition departSpeedProcedure;720721/// @brief (optional) The initial edge within the route of the vehicle722int departEdge;723724/// @brief Information how the vehicle's initial edge shall be chosen725RouteIndexDefinition departEdgeProcedure;726727/// @}728729/// @name Arrival definition730/// @{731/// @brief (optional) The lane the vehicle shall arrive on (not used yet)732int arrivalLane;733734/// @brief Information how the vehicle shall choose the lane to arrive on735ArrivalLaneDefinition arrivalLaneProcedure;736737/// @brief (optional) The position the vehicle shall arrive on738double arrivalPos;739740/// @brief Information how the vehicle shall choose the arrival position741ArrivalPosDefinition arrivalPosProcedure;742743/// @brief (optional) The lateral position the vehicle shall arrive on744double arrivalPosLat;745746/// @brief Information how the vehicle shall choose the lateral arrival position747ArrivalPosLatDefinition arrivalPosLatProcedure;748749/// @brief (optional) The final speed of the vehicle (not used yet)750double arrivalSpeed;751752/// @brief Information how the vehicle's end speed shall be chosen753ArrivalSpeedDefinition arrivalSpeedProcedure;754755/// @brief (optional) The final edge within the route of the vehicle756int arrivalEdge;757758/// @brief Information how the vehicle's final edge shall be chosen759RouteIndexDefinition arrivalEdgeProcedure;760761/// @}762763/// @name Repetition definition764/// @{765/// @brief The number of times the vehicle shall be repeatedly inserted766int repetitionNumber;767768/// @brief The number of times the vehicle was already inserted769int repetitionsDone;770771/// @brief The time offset between vehicle reinsertions772SUMOTime repetitionOffset;773774/// @brief The offset between depart and the time for the next vehicle insertions775SUMOTime repetitionTotalOffset;776777/// @brief The probability for emitting a vehicle per second778double repetitionProbability;779780/// @brief The rate for emitting vehicles with a poisson distribution781double poissonRate;782783/// @brief The time at which the flow ends (only needed when using repetitionProbability)784SUMOTime repetitionEnd;785786/// @}787788/// @brief The vehicle's line (mainly for public transport)789mutable std::string line;790791/// @brief The vehicle's origin zone (district)792std::string fromTaz;793794/// @brief The vehicle's destination zone (district)795std::string toTaz;796797/// @brief List of the stops the vehicle will make, TraCI may add entries here798mutable std::vector<Stop> stops;799800/// @brief List of the via-edges the vehicle must visit801mutable std::vector<std::string> via;802803/// @brief The parking access rights804std::vector<std::string> parkingBadges;805806/// @brief The modes a person or container can use807SVCPermissions modes;808809/// @brief The types of usable (auto-generated) vehicles for a person / container810std::string vTypes;811812/// @brief The static number of persons in the vehicle when it departs (not including boarding persons)813int personNumber;814815/// @brief The static number of containers in the vehicle when it departs816int containerNumber;817818/// @brief individual speedFactor (overriding distribution from vType)819double speedFactor;820821/// @brief speed (used by calibrator flows822double calibratorSpeed;823824/// @brief bitset of InsertionCheck825int insertionChecks;826827/// @brief Information for the router which parameter were set, TraCI may modify this (when changing color)828mutable long long int parametersSet;829830public:831/// @brief increment flow832void incrementFlow(double scale, SumoRNG* rng = nullptr);833834protected:835/// @brief obtain depart parameter in string format836std::string getDepart() const;837838/// @brief obtain depart lane parameter in string format839std::string getDepartLane() const;840841/// @brief obtain depart pos parameter in string format842std::string getDepartPos() const;843844/// @brief obtain depart pos lat parameter in string format845std::string getDepartPosLat() const;846847/// @brief obtain depart speed parameter in string format848std::string getDepartSpeed() const;849850/// @brief obtain depart edge parameter in string format851std::string getDepartEdge() const;852853/// @brief obtain arrival lane parameter in string format854std::string getArrivalLane() const;855856/// @brief obtain arrival pos parameter in string format857std::string getArrivalPos() const;858859/// @brief obtain arrival pos lat parameter in string format860std::string getArrivalPosLat() const;861862/// @brief obtain arrival speed parameter in string format863std::string getArrivalSpeed() const;864865/// @brief obtain arrival edge parameter in string format866std::string getArrivalEdge() const;867868/// @brief get insertion checks in string format869std::string getInsertionChecks() const;870871/// @brief check if given insertion checks are valid872bool areInsertionChecksValid(const std::string& value) const;873874};875876typedef std::vector<SUMOVehicleParameter::Stop> StopParVector;877878879