Path: blob/main/src/netedit/elements/additional/GNEAdditionalHandler.h
193721 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2026 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 GNEAdditionalHandler.h14/// @author Pablo Alvarez Lopez15/// @date Nov 201516///17// Builds additional objects for netedit18/****************************************************************************/19#pragma once20#include <config.h>2122#include <utils/common/SUMOVehicleClass.h>23#include <utils/handlers/AdditionalHandler.h>2425// ===========================================================================26// class declarations27// ===========================================================================2829class GNENet;30class GNEEdge;31class GNELane;32class GNEAdditional;3334// ===========================================================================35// class definitions36// ===========================================================================3738class GNEAdditionalHandler : public AdditionalHandler {3940public:41/// @brief Constructor42GNEAdditionalHandler(GNENet* net, FileBucket* fileBucket, const bool allowUndoRedo);4344/// @brief Destructor45~GNEAdditionalHandler();4647/// @name build functions48/// @{49/**@brief Builds a bus stop50* @param[in] sumoBaseObject sumo base object used for build51* @param[in] id The id of the bus stop52* @param[in] laneID The lane the bus stop is placed on53* @param[in] startPos Begin position of the bus stop on the lane54* @param[in] endPos End position of the bus stop on the lane55* @param[in] name Name of busStop56* @param[in] lines Names of the bus lines that halt on this bus stop57* @param[in] personCapacity larger numbers of persons trying to enter will create an upstream jam on the sidewalk.58* @param[in] parkingLength parking length59* @param[in[ color busStop color60* @param[in] friendlyPos enable or disable friendly position61* @param[in] angle busStop's angle62* @param[in] parameters generic parameters63*/64bool buildBusStop(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,65const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,66const int personCapacity, const double parkingLength, const RGBColor& color, const bool friendlyPosition,67const double angle, const Parameterised::Map& parameters);6869/**@brief Builds a train stop70* @param[in] sumoBaseObject sumo base object used for build71* @param[in] id The id of the train stop72* @param[in] laneID The lane the train stop is placed on73* @param[in] startPos Begin position of the train stop on the lane74* @param[in] endPos End position of the train stop on the lane75* @param[in] name Name of trainStop76* @param[in] lines Names of the train lines that halt on this train stop77* @param[in] personCapacity larger numbers of persons trying to enter will create an upstream jam on the sidewalk.78* @param[in] parkingLength parking length79* @param[in[ color trainStop color80* @param[in] friendlyPos enable or disable friendly position81* @param[in] angle trainStop's angle82* @param[in] parameters generic parameters83*/84bool buildTrainStop(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,85const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,86const int personCapacity, const double parkingLength, const RGBColor& color, const bool friendlyPosition,87const double angle, const Parameterised::Map& parameters);8889/**@brief Builds an Access90* @param[in] sumoBaseObject sumo base object used for build91* @param[in] busStop GNEAdditional of this Access belongs92* @param[in] laneID The lane the Access is placed on93* @param[in] pos position of the Access on the lane94* @param[in[ length length of the Access95* @param[in] friendlyPos enable or disable friendly position96* @param[in] parameters generic parameters97*/98bool buildAccess(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& laneID, const std::string& pos,99const double length, const bool friendlyPos, const Parameterised::Map& parameters);100101/**@brief Builds a container stop102* @param[in] sumoBaseObject sumo base object used for build103* @param[in] id The id of the container stop104* @param[in] laneID The lane the container stop is placed on105* @param[in] startPos Begin position of the container stop on the lane106* @param[in] endPos End position of the container stop on the lane107* @param[in] name Name of container stop108* @param[in] lines Names of the bus lines that halt on this container stop109* @param[in] containerCapacity larger numbers of containers110* @param[in] parkingLength parking length111* @param[in[ color containerStop color112* @param[in] friendlyPos enable or disable friendly position113* @param[in] angle container stops's angle114* @param[in] parameters generic parameters115*/116bool buildContainerStop(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,117const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,118const int containerCapacity, const double parkingLength, const RGBColor& color, const bool friendlyPosition,119const double angle, const Parameterised::Map& parameters);120121/**@brief Builds a charging Station122* @param[in] sumoBaseObject sumo base object used for build123* @param[in] id The id of the charging Station124* @param[in] laneID The lane the charging Station is placed on125* @param[in] startPos Begin position of the charging Station on the lane126* @param[in] endPos End position of the charging Station on the lane127* @param[in] name Name of charging station128* @param[in] chargingPower nominal power charged in every timeStep per vehicle129* @param[in] totalPower max. power charged in every timeStep by all vehicles130* @param[in] efficiency efficiency of the charge131* @param[in] chargeInTransit enable or disable charge in transit132* @param[in] chargeDelay delay in the charge133* @param[in] chargeType charge type (normal, electric or fuel)134* @param[in] waitingTime waiting time until start charging135* @param[in] friendlyPos enable or disable friendly position136* @param[in] parameters generic parameters137*/138bool buildChargingStation(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,139const double startPos, const double endPos, const std::string& name, const double chargingPower, const double totalPower,140const double efficiency, const bool chargeInTransit, const SUMOTime chargeDelay, const std::string& chargeType,141const SUMOTime waitingTime, const bool friendlyPosition, const std::string& parkingAreaID, const Parameterised::Map& parameters);142143/**@brief Builds a Parking Area144* @param[in] sumoBaseObject sumo base object used for build145* @param[in] id The id of the Parking >Area146* @param[in] laneID The lane the Parking Area is placed on147* @param[in] startPos Begin position of the Parking Area on the lane148* @param[in] endPos End position of the Parking Area on the lane149* @param[in] departPos lane position in that vehicle must depart when leaves parkingArea150* @param[in] name Name of Parking Area151* @param[in] badges names which grant access to the parkingArea152* @param[in] friendlyPos enable or disable friendly position153* @param[in] roadSideCapacity road side capacity of ParkingArea154* @param[in] width ParkingArea's width155* @param[in] length ParkingArea's length156* @param[in] angle ParkingArea's angle157* @param[in] lefthand enable or disable lefthand158* @param[in] parameters generic parameters159*/160bool buildParkingArea(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,161const double startPos, const double endPos, const std::string& departPos, const std::string& name,162const std::vector<std::string>& badges, const bool friendlyPosition, const int roadSideCapacity, const bool onRoad,163const double width, const double length, const double angle, const bool lefthand, const Parameterised::Map& parameters);164165/**@brief Builds a Parking Space166* @param[in] sumoBaseObject sumo base object used for build167* @param[in] x Position X168* @param[in] y Position Y169* @param[in] z Position Z170* @param[in] name Name of Parking Area171* @param[in] width ParkingArea's width172* @param[in] length ParkingArea's length173* @param[in] angle ParkingArea's angle174* @param[in] slope ParkingArea's slope (of this space)175* @param[in] parameters generic parameters176*/177bool buildParkingSpace(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const double x, const double y, const double z,178const std::string& name, const std::string& width, const std::string& length, const std::string& angle,179const double slope, const Parameterised::Map& parameters);180181/**@brief Builds a induction loop detector (E1)182* @param[in] sumoBaseObject sumo base object used for build183* @param[in] id The id of the detector184* @param[in] laneID The lane the detector is placed on185* @param[in] pos position of the detector on the lane186* @param[in] period the aggregation period the values the detector collects shall be summed up.187* @param[in] filename The path to the output file.188* @param[in] vtypes list of vehicle types to be reported189* @param[in] nextEdges list of edge ids that must all be part of the future route of the vehicle to qualify for detection190* @param[in] detectPersons detect persons instead of vehicles (pedestrians or passengers)191* @param[in] name E1 detector name192* @param[in] friendlyPos enable or disable friendly position193* @param[in] parameters generic parameters194*/195bool buildE1Detector(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,196const double position, const SUMOTime period, const std::string& file, const std::vector<std::string>& vehicleTypes,197const std::vector<std::string>& nextEdges, const std::string& detectPersons, const std::string& name,198const bool friendlyPos, const Parameterised::Map& parameters);199200/**@brief Builds a single-lane Area Detector (E2)201* @param[in] sumoBaseObject sumo base object used for build202* @param[in] id The id of the detector203* @param[in] laneID The lane the detector is placed on204* @param[in] pos position of the detector on the lane205* @param[in[ length length of the detector206* @param[in] period the aggregation period the values the detector collects shall be summed up.207* @param[in] trafficLight The traffic light that triggers aggregation when switching.208* @param[in] filename The path to the output file.209* @param[in] vtypes list of vehicle types to be reported210* @param[in] nextEdges list of edge ids that must all be part of the future route of the vehicle to qualify for detection211* @param[in] detectPersons detect persons instead of vehicles (pedestrians or passengers)212* @param[in] name E2 detector name213* @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting214* @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting215* @param[in] jamThreshold The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam216* @param[in] friendlyPos enable or disable friendly position217* @param[in] show detector in sumo-gui218* @param[in] parameters generic parameters219*/220bool buildSingleLaneDetectorE2(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,221const double pos, const double length, const SUMOTime period, const std::string& trafficLight, const std::string& filename,222const std::vector<std::string>& vehicleTypes, const std::vector<std::string>& nextEdges, const std::string& detectPersons,223const std::string& name, const SUMOTime timeThreshold, const double speedThreshold, const double jamThreshold,224const bool friendlyPos, const bool show, const Parameterised::Map& parameters);225226/**@brief Builds a multi-lane Area Detector (E2)227* @param[in] sumoBaseObject sumo base object used for build228* @param[in] id The id of the detector229* @param[in] laneIDs The lanes the detector is placed on230* @param[in] pos position of the detector on the first lane231* @param[in] endPos position of the detector on the last lane232* @param[in] period the aggregation period the values the detector collects shall be summed up.233* @param[in] trafficLight The traffic light that triggers aggregation when switching.234* @param[in] filename The path to the output file.235* @param[in] vtypes list of vehicle types to be reported236* @param[in] nextEdges list of edge ids that must all be part of the future route of the vehicle to qualify for detection237* @param[in] detectPersons detect persons instead of vehicles (pedestrians or passengers)238* @param[in] name E2 detector name239* @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting240* @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting241* @param[in] jamThreshold The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam242* @param[in] friendlyPos enable or disable friendly position243* @param[in] show detector in sumo-gui244* @param[in] parameters generic parameters245*/246bool buildMultiLaneDetectorE2(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::vector<std::string>& laneIDs,247const double pos, const double endPos, const SUMOTime period, const std::string& trafficLight, const std::string& filename,248const std::vector<std::string>& vehicleTypes, const std::vector<std::string>& nextEdges, const std::string& detectPersons,249const std::string& name, const SUMOTime timeThreshold, const double speedThreshold, const double jamThreshold,250const bool friendlyPos, const bool show, const Parameterised::Map& parameters);251252/**@brief Builds a multi entry exit detector (E3)253* @param[in] sumoBaseObject sumo base object used for build254* @param[in] id The id of the detector255* @param[in] pos position of the detector in the map256* @param[in] period the aggregation period the values the detector collects shall be summed up.257* @param[in] filename The path to the output file.258* @param[in] vtypes list of vehicle types to be reported259* @param[in] nextEdges list of edge ids that must all be part of the future route of the vehicle to qualify for detection260* @param[in] detectPersons detect persons instead of vehicles (pedestrians or passengers)261* @param[in] name E2 detector name262* @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting263* @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting264* @param[in] openEntry enable or disable open Entry265* @param[in] expectedArrival Whether no warning should be issued when a vehicle arrives within the detector area266* @param[in] parameters generic parameters267*/268bool buildDetectorE3(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const Position& pos, const SUMOTime period,269const std::string& filename, const std::vector<std::string>& vehicleTypes, const std::vector<std::string>& nextEdges,270const std::string& detectPersons, const std::string& name, const SUMOTime timeThreshold, const double speedThreshold,271const bool openEntry, const bool expectedArrival, const Parameterised::Map& parameters);272273/**@brief Builds a entry detector (E3)274* @param[in] sumoBaseObject sumo base object used for build275* @param[in] laneID The lane in which the entry detector is placed on276* @param[in] pos position of the entry detector on the lane277* @param[in] friendlyPos enable or disable friendly position278* @param[in] parameters generic parameters279*/280bool buildDetectorEntry(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& laneID, const double pos, const bool friendlyPos,281const Parameterised::Map& parameters);282283/**@brief Builds a exit detector (E3)284* @param[in] sumoBaseObject sumo base object used for build285* @param[in] laneID The lane in which the exit detector is placed on286* @param[in] pos position of the exit detector on the lane287* @param[in] friendlyPos enable or disable friendly position288* @param[in] parameters generic parameters289*/290bool buildDetectorExit(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& laneID, const double pos, const bool friendlyPos,291const Parameterised::Map& parameters);292293/**@brief Builds a Instant Induction Loop Detector (E1Instant)294* @param[in] sumoBaseObject sumo base object used for build295* @param[in] id The id of the detector296* @param[in] laneID The lane the detector is placed on297* @param[in] pos position of the detector on the lane298* @param[in] filename The path to the output file.299* @param[in] name E2 detector name300* @param[in] vtypes list of vehicle types to be reported301* @param[in] nextEdges list of edge ids that must all be part of the future route of the vehicle to qualify for detection302* @param[in] detectPersons detect persons instead of vehicles (pedestrians or passengers)303* @param[in] friendlyPos enable or disable friendly position304* @param[in] parameters generic parameters305*/306bool buildDetectorE1Instant(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,307const double pos, const std::string& filename, const std::vector<std::string>& vehicleTypes,308const std::vector<std::string>& nextEdges, const std::string& detectPersons, const std::string& name,309const bool friendlyPos, const Parameterised::Map& parameters);310311/**@brief builds a microscopic calibrator over a lane312* @param[in] id The id of the calibrator313* @param[in] laneID The lane the calibrator is placed at314* @param[in] pos The position on the edge the calibrator lies at315* @param[in] name Calibrator name316* @param[in] outfile te file in which write results317* @param[in] jamThreshold A threshold value to detect and clear unexpected jamming318* @param[in] vTypes space separated list of vehicle type ids to consider319* @param[in] parameters generic parameters320*/321bool buildLaneCalibrator(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,322const double pos, const std::string& name, const std::string& outfile, const SUMOTime period, const std::string& routeprobe,323const double jamThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters);324325/**@brief builds a microscopic calibrator over an edge326* @param[in] sumoBaseObject sumo base object used for build327* @param[in] id The id of the calibrator328* @param[in] edgeID The edge the calibrator is placed at329* @param[in] pos The position on the edge the calibrator lies at330* @param[in] name Calibrator name331* @param[in] outfile te file in which write results332* @param[in] routeProbe route probe vinculated with this calibrator333* @param[in] jamThreshold A threshold value to detect and clear unexpected jamming334* @param[in] vTypes space separated list of vehicle type ids to consider335* @param[in] parameters generic parameters336*/337bool buildEdgeCalibrator(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& edgeID,338const double pos, const std::string& name, const std::string& outfile, const SUMOTime period, const std::string& routeprobe,339const double jamThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters);340341/**@brief builds a calibrator flow342* @param[in] sumoBaseObject sumo base object used for build343* @param[in] vehicleParameter calibratorFlow parameter344*/345bool buildCalibratorFlow(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameter) ;346347/**@brief builds a rerouter348* @param[in] sumoBaseObject sumo base object used for build349* @param[in] id The id of the rerouter350* @param[in] pos position of the rerouter in the map351* @param[in] edgeIDs The edges the rerouter is placed at352* @param[in] prob The probability the rerouter reroutes vehicles with353* @param[in] name Calibrator name354* @param[in] parameters generic parameters355*/356bool buildRerouter(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const Position& pos,357const std::vector<std::string>& edgeIDs, const double prob, const std::string& name, const bool off, const bool optional,358const SUMOTime timeThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters);359360/**@brief builds a rerouter interval361* @param[in] sumoBaseObject sumo base object used for build362* @param[in] begin begin of interval363* @param[in] end end of interval364*/365bool buildRerouterInterval(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOTime begin, const SUMOTime end);366367/**@brief builds a closing lane reroute368* @param[in] sumoBaseObject sumo base object used for build369* @param[in] closedLane closed lane370* @param[in] permissions vClasses disallowed for the lane371*/372bool buildClosingLaneReroute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& closedLane, SVCPermissions permissions);373374/**@brief builds a closing edge reroute375* @param[in] sumoBaseObject sumo base object used for build376* @param[in] closedEdgeID closed edge377* @param[in] permissions vClasses disallowed for the lane378*/379bool buildClosingReroute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& closedEdgeID, SVCPermissions permissions);380381/**@brief builds a dest prob reroute382* @param[in] sumoBaseObject sumo base object used for build383* @param[in] newEdgeDestinationID new edge destination ID384* @param[in] probability rerouting probability385*/386bool buildDestProbReroute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& newEdgeDestinationID, const double probability);387388/**@brief builds a parking area reroute389* @param[in] sumoBaseObject sumo base object used for build390* @param[in] newParkignAreaID new parkingArea ID391* @param[in] probability rerouting probability392*/393bool buildParkingAreaReroute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& newParkignAreaID, const double probability, const bool visible);394395/**@brief builds a route prob reroute396* @param[in] sumoBaseObject sumo base object used for build397* @param[in] newRouteID new route ID398* @param[in] probability rerouting probability399*/400bool buildRouteProbReroute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& newRouteID, const double probability);401402/**@brief builds a Route probe403* @param[in] sumoBaseObject sumo base object used for build404* @param[in] id The id of the routeprobe405* @param[in] edgeID The edges the routeprobe is placed at406* @param[in] period the aggregation period the values the routeprobe collects shall be summed up.407* @param[in] name Calibrator name408* @param[in] file The file to read the routeprobe definitions from409* @param[in] begin The time at which to start generating output410* @param[in] vTypes list of vehicle types to be affected411* @param[in] parameters generic parameters412*/413bool buildRouteProbe(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& edgeID, const SUMOTime period,414const std::string& name, const std::string& file, const SUMOTime begin, const std::vector<std::string>& vTypes,415const Parameterised::Map& parameters);416417/**@brief Builds a VariableSpeedSign (lane speed additional)418* @param[in] sumoBaseObject sumo base object used for build419* @param[in] id The id of the lane speed additional420* @param[in] destLanes List of lanes affected by this speed additional421* @param[in] name VSS name422* @param[in] vTypes list of vehicle types to be affected423* @param[in] parameters generic parameters424*/425bool buildVariableSpeedSign(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const Position& pos,426const std::vector<std::string>& laneIDs, const std::string& name, const std::vector<std::string>& vTypes,427const Parameterised::Map& parameters);428429/**@brief Builds a VariableSpeedSign Step430* @param[in] sumoBaseObject sumo base object used for build431* @param[in] time step's time432* @param[in] speed step's speed433*/434bool buildVariableSpeedSignStep(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOTime time, const double speed);435436/**@brief Builds a vaporizer (lane speed additional)437* @param[in] sumoBaseObject sumo base object used for build438* @param[in] edgeID edge in which this vaporizer is placed439* @param[in] from time in which this vaporizer start440* @param[in] endTime time in which this vaporizer ends441* @param[in] name Vaporizer name442* @param[in] parameters generic parameters443*/444bool buildVaporizer(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& edgeID, const SUMOTime from,445const SUMOTime endTime, const std::string& name, const Parameterised::Map& parameters);446447/**@brief Builds a TAZ (Traffic Assignment Zone)448* @param[in] sumoBaseObject sumo base object used for build449* @param[in] id TAZ ID450* @param[in] shape TAZ shape451* @param[in] center shape center452* @param[in] fill Whether the TAZ shall be filled453* @param[in] edgeIDs list of edges (note: This will create GNETAZSourceSinks/Sinks with default values)454* @param[in] name Vaporizer name455* @param[in] parameters generic parameters456*/457bool buildTAZ(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const PositionVector& shape,458const Position& center, const bool fill, const RGBColor& color, const std::vector<std::string>& edgeIDs,459const std::string& name, const Parameterised::Map& parameters);460461/**@brief Builds a TAZSource (Traffic Assignment Zone)462* @param[in] sumoBaseObject sumo base object used for build463* @param[in] TAZ Traffic Assignment Zone in which this TAZSource is palced464* @param[in] edgeID edge in which TAZSource is placed465* @param[in] departWeight depart weight of TAZSource466*/467bool buildTAZSource(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& edgeID, const double departWeight);468469/**@brief Builds a TAZSink (Traffic Assignment Zone)470* @param[in] net net in which element will be inserted471* @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y472* @param[in] TAZ Traffic Assignment Zone in which this TAZSink is palced473* @param[in] edgeID edge in which TAZSink is placed474* @param[in] arrivalWeight arrival weight of TAZSink475*/476bool buildTAZSink(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& edgeID, const double arrivalWeight);477478/**@brief build traction substation479* @param[in] id Traction substation ID480* @param[in] pos Position of traction substation in view (optional)481* @param[in] voltage Voltage of at connection point for the overhead wire482* @param[in] currentLimit Current limit of the feeder line483* @param[in] parameters generic parameters484*/485bool buildTractionSubstation(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const Position& pos,486const double voltage, const double currentLimit, const Parameterised::Map& parameters);487488/** @brief build overhead wire489* @param[in] id Overhead wire ID490* @param[in] lane Lane over which the segment is placed491* @param[in] substationId Substation to which the circuit is connected492* @param[in] laneIDs list of consecutive lanes of the circuit493* @param[in] startPos Starting position in the specified lane494* @param[in] endPos Ending position in the specified lane495* @param[in] friendlyPos enable or disable friendly position496* @param[in] forbiddenInnerLanes Inner lanes, where placing of overhead wire is restricted497* @param[in] parameters generic parameters498*/499bool buildOverheadWire(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& substationId,500const std::vector<std::string>& laneIDs, const double startPos, const double endPos, const bool friendlyPos,501const std::vector<std::string>& forbiddenInnerLanes, const Parameterised::Map& parameters);502503/** @brief build overhead wire clamp504* @param[in] id Overhead wire clamp ID505* @param[in] overheadWireIDStartClamp ID of the overhead wire segment, to the start of which the overhead wire clamp is connected506* @param[in] laneIDStartClamp ID of the overhead wire segment lane of overheadWireIDStartClamp507* @param[in] overheadWireIDEndClamp ID of the overhead wire segment, to the end of which the overhead wire clamp is connected508* @param[in] laneIDEndClamp ID of the overhead wire segment lane of overheadWireIDEndClamp509* @param[in] parameters generic parameters510*/511bool buildOverheadWireClamp(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& overheadWireIDStartClamp,512const std::string& laneIDStartClamp, const std::string& overheadWireIDEndClamp, const std::string& laneIDEndClamp,513const Parameterised::Map& parameters);514515/**@brief Builds a polygon using the given values516* @param[in] sumoBaseObject sumo base object used for build517* @param[in] id The name of the polygon518* @param[in] type The (abstract) type of the polygon519* @param[in] color The color of the polygon520* @param[in] layer The layer of the polygon521* @param[in] angle The rotation of the polygon522* @param[in] imgFile The raster image of the polygon523* @param[in] shape The shape of the polygon524* @param[in] geo specify if shape was loaded as GEO coordinate525* @param[in] fill Whether the polygon shall be filled526* @param[in] lineWidth Line width when drawing unfilled polygon527* @param[in] name polygon name528* @param[in] parameters generic parameters529*/530bool buildPolygon(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& type,531const RGBColor& color, const double layer, const double angle, const std::string& imgFile, const PositionVector& shape,532const bool geo, const bool fill, const double lineWidth, const std::string& name, const Parameterised::Map& parameters);533534/**@brief Builds a POI using the given values535* @param[in] sumoBaseObject sumo base object used for build536* @param[in] id The name of the POI537* @param[in] type The (abstract) type of the POI538* @param[in] color The color of the POI539* @param[in] x POI's x position540* @param[in] y POI's y position541* @param[in] icon The icon of the POI542* @param[in] layer The layer of the POI543* @param[in] angle The rotation of the POI544* @param[in] imgFile The raster image of the POI545* @param[in] width The width of the POI image546* @param[in] height The height of the POI image547* @param[in] name POI name548* @param[in] parameters generic parameters549*/550bool buildPOI(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& type,551const RGBColor& color, const double x, const double y, const std::string& icon, const double layer,552const double angle, const std::string& imgFile, const double width, const double height, const std::string& name,553const Parameterised::Map& parameters);554555/**@brief Builds a POI over lane using the given values556* @param[in] sumoBaseObject sumo base object used for build557* @param[in] id The name of the POI558* @param[in] type The (abstract) type of the POI559* @param[in] color The color of the POI560* @param[in] laneID The Lane in which this POI is placed561* @param[in] posOverLane The position over Lane562* @param[in] friendlyPos enable or disable friendly position563* @param[in] posLat The position lateral over Lane564* @param[in] icon The icon of the POI565* @param[in] layer The layer of the POI566* @param[in] angle The rotation of the POI567* @param[in] imgFile The raster image of the POI568* @param[in] width The width of the POI image569* @param[in] height The height of the POI image570* @param[in] name POI name571* @param[in] parameters generic parameters572*/573bool buildPOILane(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& type, const RGBColor& color,574const std::string& laneID, const double posOverLane, const bool friendlyPos, const double posLat, const std::string& icon,575const double layer, const double angle, const std::string& imgFile, const double width, const double height, const std::string& name,576const Parameterised::Map& parameters);577578/**@brief Builds a POI in GEO coordinaten using the given values579* @param[in] sumoBaseObject sumo base object used for build580* @param[in] id The name of the POI581* @param[in] type The (abstract) type of the POI582* @param[in] color The color of the POI583* @param[in] lon POI's longitude584* @param[in] lat POI's latitude585* @param[in] icon The icon of the POI586* @param[in] layer The layer of the POI587* @param[in] angle The rotation of the POI588* @param[in] imgFile The raster image of the POI589* @param[in] width The width of the POI image590* @param[in] height The height of the POI image591* @param[in] name POI name592* @param[in] parameters generic parameters593*/594bool buildPOIGeo(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& type,595const RGBColor& color, const double lon, const double lat, const std::string& icon, const double layer,596const double angle, const std::string& imgFile, const double width, const double height, const std::string& name,597const Parameterised::Map& parameters);598599/**@brief Builds a JuPedSim walkable area using the given values600* @param[in] sumoBaseObject sumo base object used for build601* @param[in] id The name of the walkable area602* @param[in] shape The shape of the walkable area603* @param[in] geo specify if shape was loaded as GEO604* @param[in] name walkable area name605* @param[in] parameters generic parameters606*/607bool buildJpsWalkableArea(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const PositionVector& shape,608bool geo, const std::string& name, const Parameterised::Map& parameters);609610/**@brief Builds a JuPedSim obstacle using the given values611* @param[in] sumoBaseObject sumo base object used for build612* @param[in] id The name of the obstacle613* @param[in] shape The shape of the obstacle614* @param[in] geo specify if shape was loaded as GEO615* @param[in] name obstacle name616* @param[in] parameters generic parameters617*/618bool buildJpsObstacle(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const PositionVector& shape,619bool geo, const std::string& name, const Parameterised::Map& parameters);620621/// @}622623/// @brief check if a GNEAccess can be created in the given edge624static bool accessExists(const GNEAdditional* stoppingPlaceParent, const GNEEdge* edge);625626protected:627628/// @brief check if an overlapping is produced in rerouter if a interval with certain begin and end is inserted629bool checkOverlappingRerouterIntervals(GNEAdditional* rerouter, const SUMOTime newBegin, const SUMOTime newEnd);630631/**@brief check if the given position over a lane is valid632* @param[in] pos pos position of element over lane633* @param[in] length element's length634* @param[in] laneLength Length of the lane635* @param[in] friendlyPos Attribute of element636* @return true if the element position is valid, false in otherweise637*/638bool checkLanePosition(double pos, const double length, const double laneLength, const bool friendlyPos);639640/**@brief check if enable friendly pos in small lanes641* @param[in] pos pos position of element over lane642* @param[in] length element's length643* @param[in] laneLength Length of the lane644* @param[in] friendlyPos Attribute of element645* @return true if the element position is valid, false in otherweise646*/647bool checkFriendlyPosSmallLanes(double pos, const double length, const double laneLength, const bool friendlyPos);648649/**@brief check if the given positions over a lane is valid650* @param[in] from begin position of element over lane651* @param[in] to end position of element over lane652* @param[in] laneLength Length of the lane653* @param[in] friendlyPos Attribute of element654* @return true if the element positions is valid, false in otherwise655*/656bool checkLaneDoublePosition(double from, const double to, const double laneLength, const bool friendlyPos);657658/**@brief fix the given positions over lane659* @param[in] from begin position of element over lane660* @param[in] to end position of element over lane661* @param[in] laneLength Length of the lane662*/663void fixLaneDoublePosition(double& from, double& to, const double laneLengt);664665/**@brief check if the given positions over two lanes are valid666* @param[in] fromPos position of element over first lane667* @param[in] fromLaneLength length of the first lane668* @param[in] toPos position of element over second lane669* @param[in] toLaneLength length of the second lane670* @param[in] friendlyPos flag for friendlyPos671* @return true if the element positions is valid, false in otherwise672*/673bool checkMultiLanePosition(double fromPos, const double fromLaneLength, const double toPos, const double tolaneLength, const bool friendlyPos);674675/// @brief get additional parent676GNEAdditional* getAdditionalParent(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, SumoXMLTag tag) const;677678/// @brief get rerouter interval parent679GNEAdditional* getRerouterIntervalParent(const CommonXMLStructure::SumoBaseObject* sumoBaseObject) const;680681/// @brief parse edges682std::vector<GNEEdge*> parseEdges(const SumoXMLTag tag, const std::string& id, const std::vector<std::string>& edgeIDs);683684/// @brief parse lanes685std::vector<GNELane*> parseLanes(const SumoXMLTag tag, const std::string& id, const std::vector<std::string>& laneIDs);686687/// @brief get element by ID688GNEAdditional* retrieveAdditionalElement(const std::vector<SumoXMLTag> tags, const std::string& id);689690/// @brief check if element exist, and if overwrite691bool checkElement(const SumoXMLTag tag, GNEAdditional* additional);692693private:694/// @brief pointer to GNENet695GNENet* myNet;696697/// @brief allow undo/redo698const bool myAllowUndoRedo;699700/// @brief invalidate default constructo701GNEAdditionalHandler() = delete;702703/// @brief invalidate copy constructor704GNEAdditionalHandler(const GNEAdditionalHandler& s) = delete;705706/// @brief invalidate assignment operator707GNEAdditionalHandler& operator=(const GNEAdditionalHandler& s) = delete;708};709710711