56 routeID(originalDemandElement->getTagProperty().isRoute() ?
57 originalDemandElement->getID() :
58 originalDemandElement->getViewNet()->getNet()->generateDemandElementID(originalDemandElement->getID(),
SUMO_TAG_ROUTE)),
59 edges(originalDemandElement->getEdgeParents()),
60 color(originalDemandElement->getColor()),
61 VClass(originalDemandElement->getVClass()) {
71 edges = GNEAttributeCarrier::parse<std::vector<GNEEdge*> >(viewNet->
getNet(), edgeIDs);
81 if (fromID.size() + toID.size() > 0) {
86 if (from ==
nullptr) {
87 WRITE_ERROR(
"Invalid 'from' edge used in trip '" + vehicleID +
"'.");
88 }
else if (to ==
nullptr) {
89 WRITE_ERROR(
"Invalid 'to' edge used in trip '" + vehicleID +
"'.");
91 WRITE_ERROR(
"Invalid 'via' edges used in trip '" + vehicleID +
"'.");
94 std::vector<GNEEdge*> viaEdges = GNEAttributeCarrier::parse<std::vector<GNEEdge*> >(viewNet->
getNet(), viaIDs);
96 edges.push_back(from);
97 for (
const auto& i : viaEdges) {
126 WRITE_ERROR(
"There is another " +
toString(vehicleTag) +
" with the same ID='" +
id +
"'.");
138 WRITE_ERROR(
"There is another " +
toString(personTag) +
" with the same ID='" +
id +
"'.");
155 if (vType ==
nullptr) {
156 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
157 }
else if (route ==
nullptr) {
166 if (undoDemandElements) {
170 for (
const auto& i : vehicleParameters.
stops) {
171 buildStop(viewNet,
true, i, vehicle,
false);
179 vehicle->
incRef(
"buildVehicleOverRoute");
181 for (
const auto& i : vehicleParameters.
stops) {
182 buildStop(viewNet,
false, i, vehicle,
false);
199 if (vType ==
nullptr) {
200 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
201 }
else if (route ==
nullptr) {
210 if (undoDemandElements) {
214 for (
const auto& i : vehicleParameters.
stops) {
215 buildStop(viewNet,
true, i, flow,
false);
223 flow->
incRef(
"buildFlowOverRoute");
225 for (
const auto& i : vehicleParameters.
stops) {
226 buildStop(viewNet,
false, i, flow,
false);
242 if (vType ==
nullptr) {
243 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
258 if (undoDemandElements) {
269 vehicle->
incRef(
"buildVehicleWithEmbeddedRoute");
273 i->addDemandElementChild(vehicle);
277 embeddedRoute->
incRef(
"buildVehicleWithEmbeddedRoute");
292 if (vType ==
nullptr) {
293 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
308 if (undoDemandElements) {
319 flow->
incRef(
"buildFlowWithEmbeddedRoute");
323 i->addDemandElementChild(flow);
327 embeddedRoute->
incRef(
"buildFlowWithEmbeddedRoute");
342 if (vType ==
nullptr) {
343 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
350 for (
int i = 1; i < ((int)edges.size() - 1); i++) {
351 vehicleParameters.
via.push_back(edges.at(i)->getID());
354 GNEVehicle* trip =
new GNEVehicle(viewNet, vType, edges.front(), edges.back(), vehicleParameters);
355 if (undoDemandElements) {
359 for (
const auto& i : vehicleParameters.
stops) {
360 buildStop(viewNet,
true, i, trip,
false);
367 trip->
incRef(
"buildTrip");
369 for (
const auto& i : edges) {
370 i->addDemandElementChild(trip);
373 for (
const auto& i : vehicleParameters.
stops) {
374 buildStop(viewNet,
false, i, trip,
false);
390 if (vType ==
nullptr) {
391 WRITE_ERROR(
"Invalid vehicle type '" + vehicleParameters.
vtypeid +
"' used in " +
toString(vehicleParameters.
tag) +
" '" + vehicleParameters.
id +
"'.");
398 for (
int i = 1; i < ((int)edges.size() - 1); i++) {
399 vehicleParameters.
via.push_back(edges.at(i)->getID());
402 GNEVehicle* flow =
new GNEVehicle(viewNet, vType, edges.front(), edges.back(), vehicleParameters);
403 if (undoDemandElements) {
407 for (
const auto& i : vehicleParameters.
stops) {
408 buildStop(viewNet,
true, i, flow,
false);
415 flow->
incRef(
"buildFlow");
417 for (
const auto& i : edges) {
418 i->addDemandElementChild(flow);
421 for (
const auto& i : vehicleParameters.
stops) {
422 buildStop(viewNet,
false, i, flow,
false);
436 bool validDemandElementParent =
true;
437 if (stopParameters.
busstop.size() > 0) {
449 WRITE_ERROR(
"Persons doesn't support stops over container stops");
450 validDemandElementParent =
false;
458 WRITE_ERROR(
"Persons doesn't support stops over charging stations");
459 validDemandElementParent =
false;
463 }
else if (stopParameters.
parkingarea.size() > 0) {
467 WRITE_ERROR(
"Persons doesn't support stops over parking areas");
468 validDemandElementParent =
false;
472 }
else if (stopParameters.
lane.size() > 0) {
482 if (validDemandElementParent) {
484 if (stoppingPlace && lane) {
485 WRITE_ERROR(
"A stop must be defined either over a stoppingPlace or over a lane");
486 }
else if (!stoppingPlace && !lane) {
487 WRITE_ERROR(
"A stop requires a stoppingPlace or a lane");
488 }
else if (stoppingPlace) {
490 GNEStop* stop =
new GNEStop(stopTagType, viewNet, stopParameters, stoppingPlace, stopParent);
492 if (undoDemandElements) {
500 stop->
incRef(
"buildStoppingPlaceStop");
504 GNEStop* stop =
new GNEStop(viewNet, stopParameters, lane, friendlyPosition, stopParent);
506 if (undoDemandElements) {
514 stop->
incRef(
"buildLaneStop");
527 if (pType ==
nullptr) {
532 if (undoDemandElements) {
540 person->
incRef(
"buildPerson");
553 if (pType ==
nullptr) {
554 WRITE_ERROR(
"Invalid personFlow type '" + personFlowParameters.
vtypeid +
"' used in " +
toString(personFlowParameters.
tag) +
" '" + personFlowParameters.
id +
"'.");
558 if (undoDemandElements) {
566 personFlow->
incRef(
"buildPersonFlow");
575 const std::vector<std::string>& types,
const std::vector<std::string>& modes,
double arrivalPos) {
577 if (edges.size() == 0) {
583 if (pathEdges.size() == 0) {
589 if (undoDemandElements) {
597 personTripFromTo->
incRef(
"buildPersonTripFromTo");
608 GNEAdditional* busStop,
const std::vector<std::string>& types,
const std::vector<std::string>& modes) {
610 if (edges.size() == 0) {
616 if (pathEdges.size() == 0) {
622 if (undoDemandElements) {
632 for (
const auto& i : edges) {
633 i->addDemandElementChild(personTripBusStop);
635 personTripBusStop->
incRef(
"buildPersonTripBusStop");
647 if (edges.size() == 0) {
653 if (pathEdges.size() == 0) {
659 if (undoDemandElements) {
668 for (
const auto& i : edges) {
669 i->addDemandElementChild(walkEdges);
671 walkEdges->
incRef(
"buildWalkEdges");
683 if (edges.size() == 0) {
689 if (pathEdges.size() == 0) {
695 if (undoDemandElements) {
704 for (
const auto& i : edges) {
705 i->addDemandElementChild(walkFromTo);
707 walkFromTo->
incRef(
"buildWalkFromTo");
719 if (edges.size() == 0) {
725 if (pathEdges.size() == 0) {
729 GNEWalk* walkBusStop =
new GNEWalk(viewNet, personParent, pathEdges, busStop);
731 if (undoDemandElements) {
741 for (
const auto& i : edges) {
742 i->addDemandElementChild(walkBusStop);
744 walkBusStop->
incRef(
"buildWalkBusStop");
756 GNEWalk* walkRoute =
new GNEWalk(viewNet, personParent, routeParent, arrivalPos);
758 if (undoDemandElements) {
767 walkRoute->
incRef(
"buildWalkRoute");
777 const std::vector<std::string>& lines,
double arrivalPos) {
779 if (edges.size() == 0) {
785 if (pathEdges.size() == 0) {
789 GNERide* rideFromTo =
new GNERide(viewNet, personParent, pathEdges, arrivalPos, lines);
791 if (undoDemandElements) {
800 for (
const auto& i : edges) {
801 i->addDemandElementChild(rideFromTo);
803 rideFromTo->
incRef(
"buildRideFromTo");
814 GNEAdditional* busStop,
const std::vector<std::string>& lines) {
816 if (edges.size() == 0) {
822 if (pathEdges.size() == 0) {
826 GNERide* rideBusStop =
new GNERide(viewNet, personParent, pathEdges, busStop, lines);
828 if (undoDemandElements) {
838 for (
const auto& i : edges) {
839 i->addDemandElementChild(rideBusStop);
841 rideBusStop->
incRef(
"buildRideBusStop");
882 if (createEmbeddedRoute) {
942 if (createEmbeddedRoute) {
999 newVehicleParameters);
1021 if (separatedEmbeddedRoute) {
1059 newVehicleParameters);
1077 if (separatedEmbeddedRoute) {
1128 return vehicleWithoutEmbebbeRoute;
1190 if (vType ==
nullptr) {
1216 vehicleOrRouteFlow->
incRef(
"buildVehicleAndRoute");
1220 i->addDemandElementChild(vehicleOrRouteFlow);
1223 embeddedRoute->
incRef(
"buildVehicleAndRoute");
1254 i->addDemandElementChild(route);
1256 route->
incRef(
"buildRoute");
1309 vType->
incRef(
"buildVType");
1324 if (pType ==
nullptr) {
1328 bool abortPersonPlans =
false;
1344 i->from = (i - 1)->getLastEdge();
1347 WRITE_ERROR(
"The first person plan of type '" +
toString(i->tag) +
"' needs a from edge. Person cannot be created.");
1351 abortPersonPlans =
true;
1360 i->from = (i - 1)->getLastEdge();
1363 WRITE_ERROR(
"The first person plan of type '" +
toString(i->tag) +
"' needs a from edge. Person cannot be created.");
1367 abortPersonPlans =
true;
1376 i->from = (i - 1)->getLastEdge();
1379 WRITE_ERROR(
"The first person plan of type '" +
toString(i->tag) +
"' needs a from edge. Person cannot be created.");
1383 abortPersonPlans =
true;
1392 i->from = (i - 1)->getLastEdge();
1395 WRITE_ERROR(
"The first person plan of type '" +
toString(i->tag) +
"' needs a from edge. Person cannot be created.");
1399 abortPersonPlans =
true;
1411 i->from = (i - 1)->getLastEdge();
1414 WRITE_ERROR(
"The first person plan of type '" +
toString(i->tag) +
"' needs a from edge. Person cannot be created.");
1418 abortPersonPlans =
true;
1427 i->from = (i - 1)->getLastEdge();
1430 WRITE_ERROR(
"The first person plan of type '" +
toString(i->tag) +
"' needs a from edge. Person cannot be created.");
1434 abortPersonPlans =
true;
1451 if (!abortPersonPlans) {
1509 std::string errorSuffix;
1524 if (bs ==
nullptr) {
1550 WRITE_ERROR(
"A stop must be placed on a busStop, a chargingStation, a containerStop a parkingArea or a lane" + errorSuffix);
1556 WRITE_ERROR(
"Deprecated attribute 'pos' in description of stop" + errorSuffix);
1599 bool validValues =
true;
1603 if (personTripValuesLoaded.
from ==
nullptr) {
1605 validValues =
false;
1609 personTripValuesLoaded.
vTypes = GNEAttributeCarrier::parseAttributeFromXML<std::vector<std::string> >(attrs,
"", personTripValuesLoaded.
tag,
SUMO_ATTR_VTYPES,
myAbort);
1610 personTripValuesLoaded.
modes = GNEAttributeCarrier::parseAttributeFromXML<std::vector<std::string> >(attrs,
"", personTripValuesLoaded.
tag,
SUMO_ATTR_MODES,
myAbort);
1615 if (personTripValuesLoaded.
to ==
nullptr) {
1617 validValues =
false;
1620 for (
const auto& i : personTripValuesLoaded.
modes) {
1621 if ((i !=
"public") && (i !=
"car") && (i !=
"bicycle")) {
1622 validValues =
false;
1627 std::sort(personTripValuesLoaded.
modes.begin(), personTripValuesLoaded.
modes.end());
1628 personTripValuesLoaded.
modes.erase(unique(personTripValuesLoaded.
modes.begin(), personTripValuesLoaded.
modes.end()), personTripValuesLoaded.
modes.end());
1630 WRITE_ERROR(
"A person trip mode can be only a combination of 'public', 'car' or 'bicycle'");
1632 for (
const auto& i : personTripValuesLoaded.
vTypes) {
1635 validValues =
false;
1646 bool validValues =
true;
1650 if (personTripValuesLoaded.
from ==
nullptr) {
1652 validValues =
false;
1656 personTripValuesLoaded.
vTypes = GNEAttributeCarrier::parseAttributeFromXML<std::vector<std::string> >(attrs,
"", personTripValuesLoaded.
tag,
SUMO_ATTR_VTYPES,
myAbort);
1657 personTripValuesLoaded.
modes = GNEAttributeCarrier::parseAttributeFromXML<std::vector<std::string> >(attrs,
"", personTripValuesLoaded.
tag,
SUMO_ATTR_MODES,
myAbort);
1662 if (personTripValuesLoaded.
busStop ==
nullptr) {
1664 validValues =
false;
1667 for (
const auto& i : personTripValuesLoaded.
modes) {
1668 if ((i !=
"public") && (i !=
"car") && (i !=
"bicycle")) {
1669 validValues =
false;
1674 std::sort(personTripValuesLoaded.
modes.begin(), personTripValuesLoaded.
modes.end());
1675 personTripValuesLoaded.
modes.erase(unique(personTripValuesLoaded.
modes.begin(), personTripValuesLoaded.
modes.end()), personTripValuesLoaded.
modes.end());
1677 WRITE_ERROR(
"A person trip mode can be only a combination of 'public', 'car' or 'bicycle'");
1679 for (
const auto& i : personTripValuesLoaded.
vTypes) {
1682 validValues =
false;
1690 WRITE_ERROR(
"A personTrip requieres either a from-to edges or a from edge and a busStop");
1707 std::string edgeIDs = GNEAttributeCarrier::parseAttributeFromXML<std::string>(attrs,
"", walkValuesLoaded.
tag,
SUMO_ATTR_EDGES,
myAbort);
1709 walkValuesLoaded.
edges = GNEAttributeCarrier::parse<std::vector<GNEEdge*> >(
myViewNet->
getNet(), edgeIDs);
1716 if (walkValuesLoaded.
edges.empty()) {
1728 if (walkValuesLoaded.
from ==
nullptr) {
1737 if (walkValuesLoaded.
to ==
nullptr) {
1749 if (walkValuesLoaded.
from ==
nullptr) {
1759 if (walkValuesLoaded.
busStop ==
nullptr) {
1774 if (walkValuesLoaded.
route ==
nullptr) {
1781 WRITE_ERROR(
"A walk requieres either a from-to edges, a from edge and a busStop or a route");
1811 if (rideValuesLoaded.
from ==
nullptr) {
1816 rideValuesLoaded.
lines = GNEAttributeCarrier::parseAttributeFromXML<std::vector<std::string> >(attrs,
"", rideValuesLoaded.
tag,
SUMO_ATTR_LINES,
myAbort);
1821 if (rideValuesLoaded.
lines.empty()) {
1822 rideValuesLoaded.
lines.push_back(
"ANY");
1825 if (rideValuesLoaded.
to ==
nullptr) {
1837 if (rideValuesLoaded.
from ==
nullptr) {
1842 rideValuesLoaded.
lines = GNEAttributeCarrier::parseAttributeFromXML<std::vector<std::string> >(attrs,
"", rideValuesLoaded.
tag,
SUMO_ATTR_LINES,
myAbort);
1847 if (rideValuesLoaded.
lines.empty()) {
1848 rideValuesLoaded.
lines.push_back(
"ANY");
1851 if (rideValuesLoaded.
busStop ==
nullptr) {
1858 WRITE_ERROR(
"A ride requieres either a from-to edges or a from edge and a busStop");
1886 friendlyPos(false) {
1892 if (
edges.size() > 0) {
1893 return edges.back();
1908 std::vector<GNEEdge*>
1914 if (edgePath.empty()) {
1922 if (edgePath.empty()) {
stop placed over a parking area (used in netedit)
void closeRouteDistribution()
closes (ends) the building of a distribution
RouteParameter myRouteParameter
NETEDIT Route Parameters.
void closeVehicle()
Ends the processing of a vehicle.
void closeFlow()
Ends the processing of a routeFlow.
SUMOVehicleClass VClass
VClass used by this route.
std::vector< GNEEdge * > calculateDijkstraRoute(SUMOVehicleClass vClass, const std::vector< GNEEdge *> &partialEdges) const
calculate Dijkstra route between a list of partial edges
SumoXMLTag
Numbers representing SUMO-XML - element names.
bool myAbort
flag used for parsing values
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
static void transformToVehicle(GNEVehicle *originalVehicle, bool createEmbeddedRoute)
transform vehicle functions
PersonPlansValues()
default constructor
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
std::string lane
The lane to stop at.
const int VEHPARS_FORCE_REROUTE
description of a vehicle type
~GNERouteHandler()
Destructor.
std::vector< GNEEdge * > calculateEdgePath() const
calculate ege path between from-to edges
struct for saving route parameters
std::string vtypeid
The vehicle's type id.
a flow definitio nusing a from-to edges instead of a route (used by router)
static void buildRideFromTo(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, const std::vector< GNEEdge *> &edges, const std::vector< std::string > &lines, double arrivalPos)
build ride using a from-to edges
SUMOVehicleParameter * myVehicleParameter
Parameter of the current vehicle, trip, person, container or flow.
static bool isPersonIdDuplicated(GNEViewNet *viewNet, const std::string &id)
check if there is already a person (Person or PersonFlow) with the given ID
static void buildTrip(GNEViewNet *viewNet, bool undoDemandElements, const SUMOVehicleParameter &vehicleParameters, const std::vector< GNEEdge *> &edges)
build trip
GNEAdditional * busStop
busStop
a flow definition nusing a route instead of a from-to edges route (used in NETEDIT) ...
std::vector< std::string > modes
modes
DepartLaneDefinition departLaneProcedure
Information how the vehicle shall choose the lane to depart from.
void setEdges(GNEViewNet *viewNet, const std::string &edgeIDs)
set edges (list of consecutive edges)
static void overwriteVType(GNEDemandElement *vType, SUMOVTypeParameter *newVTypeParameter, GNEUndoList *undoList)
overwrite all values of GNEVehicleType with a SUMOVTypeParameter
void openVehicleTypeDistribution(const SUMOSAXAttributes &attrs)
opens a type distribution for reading
static void transformToTrip(GNEVehicle *originalVehicle)
transform to trip
virtual void updateGeometry()=0
update pre-computed geometry information
int parametersSet
Information for the router which parameter were set, TraCI may modify this (whe changing color) ...
SUMOVTypeParameter * myCurrentVType
The currently parsed vehicle type.
RGBColor color
string for saving parsed route colors
static void embebbeRoute(GNEVehicle *vehicle, GNEUndoList *undoList)
embebbe route within a vehicle
void openTrip(const SUMOSAXAttributes &attrs)
opens a trip for reading
stop placed over a lane (used in netedit)
SUMOVehicleClass vehicleClass
The vehicle's class.
void closeContainer()
Ends the processing of a container.
std::string busstop
(Optional) bus stop if one is assigned to the stop
SUMOVehicleParameter::Stop stopParameters
stop parameters
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
static void transformToPerson(GNEPerson *originalPerson)
transform person functions
virtual double getAttributeDouble(SumoXMLAttr key) const =0
const std::string & getObjectType() const
return the objecttype to which these attributes belong
std::vector< std::string > lines
lines
const std::string DEFAULT_BIKETYPE_ID
static bool isVehicleIdDuplicated(GNEViewNet *viewNet, const std::string &id)
check if there is already a vehicle (Vehicle, Trip, Flow or Flow) with the given ID ...
std::string myActiveRouteID
The id of the current route.
struct used for load person plans (Rides, Walks, etc.)
static void buildFlow(GNEViewNet *viewNet, bool undoDemandElements, const SUMOVehicleParameter &vehicleParameters, const std::vector< GNEEdge *> &edges)
build flow
std::string parkingarea
(Optional) parking area if one is assigned to the stop
Parameterised genericParameters
generic parameters
const std::string DEFAULT_VTYPE_ID
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
static RouteCalculator * getRouteCalculatorInstance()
obtain instance of RouteCalculator
begin/end of the description of a route
static void buildRideBusStop(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, const std::vector< GNEEdge *> &edges, GNEAdditional *busStop, const std::vector< std::string > &lines)
build ride using a from edge and a busStop
void addRide(const SUMOSAXAttributes &attrs)
Processing of a ride.
const std::vector< GNEEdge * > & getEdgeParents() const
get edge parents
std::vector< Stop > stops
List of the stops the vehicle will make, TraCI may add entries here.
const std::vector< GNEDemandElement * > & getDemandElementChildren() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
static void transformToFlow(GNEVehicle *originalVehicle)
transform to flow
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
void closePersonFlow()
Ends the processing of a personFlow.
double departSpeed
(optional) The initial speed of the vehicle
the function-object for an editing operation (abstract base)
std::vector< GNEEdge * > edges
edges
void openFlow(const SUMOSAXAttributes &attrs)
opens a routeFlow for reading
GNEUndoList * getUndoList() const
get the undoList object
double getLaneParametricLength() const
returns the parameteric length of the lane
virtual SUMOVehicleClass getVClass() const =0
obtain VClass related with this demand element
DepartSpeedDefinition departSpeedProcedure
Information how the vehicle's initial speed shall be chosen.
stop placed over a charging station (used in netedit)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
std::vector< GNEEdge * > edges
list of edges
GNEEdge & getParentEdge()
Returns underlying parent edge.
std::string routeid
The vehicle's route id.
Encapsulated SAX-Attributes.
GNEDemandElement * retrieveDemandElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named demand element.
const int VEHPARS_DEPARTSPEED_SET
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
void addTranship(const SUMOSAXAttributes &attrs)
Processing of a tranship.
void markSegmentGeometryDeprecated()
mark demand element segment geometry as deprecated
GNEEdge * getLastEdge() const
return last valid edge (used to create consecutive person plans)
bool isPerson() const
return true if tag correspond to a person element
const std::vector< GNELane * > & getLaneParents() const
get lanes of VSS
stop placed over a containerStop (used in netedit)
stop placed over a busStop (used in netedit)
static void buildPerson(GNEViewNet *viewNet, bool undoDemandElements, const SUMOVehicleParameter &personParameters)
build person
void closePerson()
Ends the processing of a person.
void openRoute(const SUMOSAXAttributes &attrs)
opens a route for reading
A lane area vehicles can halt at (netedit-version)
GNEViewNet * myViewNet
pointer to View's Net
bool myUndoDemandElements
flag to check if created demand elements must be undo and redo
const std::string getID() const
function to support debugging
double arrivalPos
arrival pos
static void buildWalkFromTo(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, const std::vector< GNEEdge *> &edges, double arrivalPos)
build walk using a from-to edges
void closeRoute(const bool mayBeDisconnected=false)
double endPos
The stopping position end.
static void buildPersonFlow(GNEViewNet *viewNet, bool undoDemandElements, const SUMOVehicleParameter &personFlowParameters)
build person flow
void incRef(const std::string &debugMsg="")
Increarse reference.
std::string generateDemandElementID(const std::string &prefix, SumoXMLTag type) const
generate demand element id
void p_abortLastCommandGroup()
reverts last command group
vehicle is a passenger car (a "normal" car)
int departLane
(optional) The lane the vehicle shall depart from (index in edge)
double arrivalPos
(optional) The position the vehicle shall arrive on
Definition of vehicle stop (position and duration)
void addStop(const SUMOSAXAttributes &attrs)
Processing of a stop.
Parser for routes during their loading.
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
std::vector< std::string > via
List of the via-edges the vehicle must visit.
A road/street connecting two junctions (netedit-version)
void addDemandElementChild(GNEDemandElement *demandElement)
const std::vector< GNEDemandElement * > & getDemandElementParents() const
return vector of demand elements that have as Parent this edge (For example, Calibrators) ...
static void transformToPersonFlow(GNEPerson *originalPerson)
transform routeFlow over an existent route
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
double startPos
The stopping position start.
static bool checkStopPos(double &startPos, double &endPos, const double laneLength, const double minLength, const bool friendlyPos)
check start and end position of a stop
std::vector< SUMOVehicleParameter::Stop > myActiveRouteStops
List of the stops on the parsed route.
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.
Structure representing possible vehicle parameter.
static void transformToRouteFlow(GNEVehicle *originalVehicle, bool createEmbeddedRoute)
transform routeFlow over an existent route
void addPerson(const SUMOSAXAttributes &attrs)
Processing of a person.
static void buildWalkRoute(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, GNEDemandElement *routeParent, double arrivalPos)
build walk using a list of consecutive edges
std::string getAttribute(SumoXMLAttr key) const
An Element which don't belongs to GNENet but has influency in the simulation.
const std::string DEFAULT_PEDTYPE_ID
static void buildStop(GNEViewNet *viewNet, bool undoDemandElements, const SUMOVehicleParameter::Stop &stopParameters, GNEDemandElement *stopParent, bool friendlyPosition)
build stop
const std::string & getTagStr() const
get tag assigned to this object in string format
static GNEVehicle * separateEmbeddedRoute(GNEVehicle *vehicle, GNEUndoList *undoList)
separate vehicle and embedded route
bool parseStop(SUMOVehicleParameter::Stop &stop, const SUMOSAXAttributes &attrs, std::string errorSuffix, MsgHandler *const errorOutput)
parses attributes common to all stops
GNELane * laneStop
laneStop
void closeVType()
Ends the processing of a vehicle Type.
SumoXMLTag tag
The vehicle tag.
void addPersonTrip(const SUMOSAXAttributes &attrs)
add a routing request for a walking or intermodal person
std::vector< PersonPlansValues > myPersonPlanValues
container for person trips loaded values
const int VEHPARS_DEPARTLANE_SET
std::string id
The vehicle type's id.
void closeVehicleTypeDistribution()
closes (ends) the building of a distribution
void openRouteDistribution(const SUMOSAXAttributes &attrs)
opens a route distribution for reading
Parameterised myLoadedParameterised
Parameterised used for saving loaded generic parameters that aren't saved in Vehicles or Vehicle Type...
GNENet * getNet() const
get the net object
RouteParameter()
constructor
bool wasSet(int what) const
Returns whether the given parameter was set.
static void buildWalkBusStop(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, const std::vector< GNEEdge *> &edges, GNEAdditional *busStop)
build walk using a form edge an a busStop
static void buildVehicleWithEmbeddedRoute(GNEViewNet *viewNet, bool undoDemandElements, SUMOVehicleParameter vehicleParameters, GNEDemandElement *embeddedRouteCopy)
build vehicle with a embedded route
GNEViewNet * getViewNet() const
Returns a pointer to GNEViewNet in which demand element element is located.
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
description of a person type (used in NETEDIT)
static void buildFlowOverRoute(GNEViewNet *viewNet, bool undoDemandElements, const SUMOVehicleParameter &vehicleParameters)
build a flow over an existent route
a single trip definition (used by router)
static void buildPersonTripFromTo(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, const std::vector< GNEEdge *> &edges, const std::vector< std::string > &types, const std::vector< std::string > &modes, double arrivalPos)
build trip using a from-to edges
std::string chargingStation
(Optional) charging station if one is assigned to the stop
static bool isValidTypeID(const std::string &value)
whether the given string is a valid id for an edge or vehicle type
std::string containerstop
(Optional) container stop if one is assigned to the stop
GNEDemandElement * route
arrival route
static void buildWalkEdges(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, const std::vector< GNEEdge *> &edges, double arrivalPos)
build walk using a list of consecutive edges
std::vector< std::string > vTypes
vehicle types
GNERouteHandler(const std::string &file, GNEViewNet *viewNet, bool undoDemandElements=true)
Constructor.
void addWalk(const SUMOSAXAttributes &attrs)
add a fully specified walk
std::string routeID
string for saving parsed Route ID
void addTransport(const SUMOSAXAttributes &attrs)
Processing of a transport.
GNELane * retrieveLane(const std::string &id, bool failHard=true, bool checkVolatileChange=false)
get lane by id
void insertDemandElement(GNEDemandElement *demandElement)
Insert a demand element element int GNENet container.
void addContainer(const SUMOSAXAttributes &attrs)
Processing of a container.
static bool isValidVehicleID(const std::string &value)
whether the given string is a valid id for a vehicle or flow
void closeTrip()
Ends the processing of a trip.
static void buildVehicleOverRoute(GNEViewNet *viewNet, bool undoDemandElements, const SUMOVehicleParameter &vehicleParameters)
build functions
std::string id
The vehicle's id.
An Element which don't belongs to GNENet but has influency in the simulation.
static void buildFlowWithEmbeddedRoute(GNEViewNet *viewNet, bool undoDemandElements, SUMOVehicleParameter vehicleParameters, GNEDemandElement *embeddedRouteCopy)
build flow with a embedded route
static void buildPersonTripBusStop(GNEViewNet *viewNet, bool undoDemandElements, GNEDemandElement *personParent, const std::vector< GNEEdge *> &edges, GNEAdditional *busStop, const std::vector< std::string > &types, const std::vector< std::string > &modes)
build trip using a from edge and a busStop