Skip to content

Commit

Permalink
Merge branch 'main' of github.com:eclipse-sumo/sumo into Netedit_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
palvarezlopez committed Aug 25, 2024
2 parents 5d8e56e + fc2e064 commit 33bf3f8
Show file tree
Hide file tree
Showing 16 changed files with 257 additions and 224 deletions.
13 changes: 13 additions & 0 deletions docs/web/docs/Contributed/Cadyts.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ The <REALFLOWS\>-file has to be a XML-file in form of:
<singlelink link="1to22" start="25200" end="32400" value="250" stddev="8" type="COUNT_VEH"/>
</measurements>
```
The definition of each attribute is:

• link: edge ID

• start: the begin of the interval

• end: the end of the interval

• value: the measurement

• stddev: standard deviation of the given data (measurement error); The larger this value is, the less one should believe this value.

• type: measurement type (here: COUNT_VEH für counting data)

The < ROUTEALTERNATIVESFILE\> has to be a XML-file in form of:

Expand Down
274 changes: 137 additions & 137 deletions src/netedit/elements/GNEAttributeCarrier.cpp

Large diffs are not rendered by default.

124 changes: 72 additions & 52 deletions src/netedit/elements/demand/GNEDemandElementPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1016,50 +1016,50 @@ void
GNEDemandElementPlan::updatePlanGeometry() {
// get tag property
const auto& tagProperty = myPlanElement->getTagProperty();
// declare first and last positions
Position firstPos = Position::INVALID;
Position lastPos = Position::INVALID;
// set first position
if (tagProperty.planFromJunction() && tagProperty.planToTAZ()) {
// from junction
firstPos = myPlanElement->getParentJunctions().front()->getPositionInView();
// to TAZ
if (myPlanElement->getParentTAZs().back()->getAttribute(SUMO_ATTR_CENTER).empty()) {
lastPos = myPlanElement->getParentTAZs().back()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
} else {
lastPos = myPlanElement->getParentTAZs().back()->getAttributePosition(SUMO_ATTR_CENTER);
}
} else if (tagProperty.planFromTAZ() && tagProperty.planToJunction()) {
// from TAZ
if (myPlanElement->getParentTAZs().front()->getAttribute(SUMO_ATTR_CENTER).empty()) {
firstPos = myPlanElement->getParentTAZs().front()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
} else {
firstPos = myPlanElement->getParentTAZs().front()->getAttributePosition(SUMO_ATTR_CENTER);
// check if plan start or end in a TAZ (becase in this case has to be inserted in RTREE
if (tagProperty.planFromTAZ() || tagProperty.planToTAZ()) {
// declare first and last positions
Position firstPos = Position::INVALID;
Position lastPos = Position::INVALID;
// set first position
if (tagProperty.planFromEdge()) {
// from junction
firstPos = myPlanElement->getFirstPathLane()->getLaneShape().back();
} else if (tagProperty.planFromJunction()) {
// from junction
firstPos = myPlanElement->getParentJunctions().front()->getPositionInView();
} else if (tagProperty.planFromTAZ()) {
// from TAZ
if (myPlanElement->getParentTAZs().front()->getAttribute(SUMO_ATTR_CENTER).empty()) {
firstPos = myPlanElement->getParentTAZs().front()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
} else {
firstPos = myPlanElement->getParentTAZs().front()->getAttributePosition(SUMO_ATTR_CENTER);
}
}
// to junction
lastPos = myPlanElement->getParentJunctions().back()->getPositionInView();
} else if (tagProperty.planFromTAZ() && tagProperty.planToTAZ()) {
// from TAZ
if (myPlanElement->getParentTAZs().front()->getAttribute(SUMO_ATTR_CENTER).empty()) {
firstPos = myPlanElement->getParentTAZs().front()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
} else {
firstPos = myPlanElement->getParentTAZs().front()->getAttributePosition(SUMO_ATTR_CENTER);
// set last position
if (tagProperty.planToEdge()) {
// from junction
lastPos = myPlanElement->getLastPathLane()->getLaneShape().back();
} else if (tagProperty.planToJunction()) {
// from junction
lastPos = myPlanElement->getParentJunctions().back()->getPositionInView();
} else if (tagProperty.planToTAZ()) {
// from TAZ
if (myPlanElement->getParentTAZs().back()->getAttribute(SUMO_ATTR_CENTER).empty()) {
lastPos = myPlanElement->getParentTAZs().back()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
} else {
lastPos = myPlanElement->getParentTAZs().back()->getAttributePosition(SUMO_ATTR_CENTER);
}
}
// to TAZ
if (myPlanElement->getParentTAZs().back()->getAttribute(SUMO_ATTR_CENTER).empty()) {
lastPos = myPlanElement->getParentTAZs().back()->getAttributePosition(GNE_ATTR_TAZ_CENTROID);
// use both position to calculate a line
if ((firstPos != Position::INVALID) && (lastPos != Position::INVALID)) {
myPlanElement->myDemandElementGeometry.updateGeometry({firstPos, lastPos});
} else {
lastPos = myPlanElement->getParentTAZs().back()->getAttributePosition(SUMO_ATTR_CENTER);
myPlanElement->myDemandElementGeometry.clearGeometry();
}
}
// use both position to calculate a line
if ((firstPos != Position::INVALID) && (lastPos != Position::INVALID)) {
// remove from grid
myPlanElement->getNet()->removeGLObjectFromGrid(myPlanElement);
myPlanElement->myDemandElementGeometry.updateGeometry({firstPos, lastPos});
// add into grid again
myPlanElement->getNet()->addGLObjectIntoGrid(myPlanElement);
}
// update centering boundary
updatePlanCenteringBoundary(true);
// update child demand elements
for (const auto& demandElement : myPlanElement->getChildDemandElements()) {
demandElement->updateGeometry();
Expand All @@ -1076,10 +1076,10 @@ GNEDemandElementPlan::getPlanCenteringBoundary() const {
void
GNEDemandElementPlan::updatePlanCenteringBoundary(const bool updateGrid) {
// remove additional from grid
if (updateGrid) {
if (myPlanBoundary.isInitialised() && updateGrid) {
myPlanElement->getNet()->removeGLObjectFromGrid(myPlanElement);
}
myPlanBoundary.reset();
myPlanBoundary = myPlanElement->getDemandElementGeometry().getShape().getBoxBoundary();
// if this element is over route, add their boundary
if (myPlanElement->getParentDemandElements().size() > 1) {
myPlanBoundary.add(myPlanElement->getParentDemandElements().at(1)->getCenteringBoundary());
Expand Down Expand Up @@ -1107,11 +1107,9 @@ GNEDemandElementPlan::updatePlanCenteringBoundary(const bool updateGrid) {
// check if is valid
if (myPlanBoundary.isInitialised()) {
myPlanBoundary.grow(5);
} else if (myPlanElement->getParentDemandElements().size() > 0) {
myPlanBoundary = myPlanElement->getParentDemandElements().front()->getCenteringBoundary();
}
// add additional into RTREE again
if (updateGrid) {
if (myPlanBoundary.isInitialised() && updateGrid) {
myPlanElement->getNet()->addGLObjectIntoGrid(myPlanElement);
}
}
Expand Down Expand Up @@ -1750,6 +1748,10 @@ GNEDemandElementPlan::drawPlanLanePartial(const bool drawPlan, const GUIVisualiz
const GNEDemandElement* planParent = myPlanElement->getParentDemandElements().front();
// check if draw plan element can be drawn
if (drawPlan && segment->getLane() && myPlanElement->getNet()->getPathManager()->getPathDraw()->checkDrawPathGeometry(s, segment->getLane(), tagProperty.getTag())) {
// draw boundary
if (tagProperty.isPlacedInRTree() && s.drawBoundaries) {
GLHelper::drawBoundary(s, getPlanCenteringBoundary());
}
// get detail level
const auto d = s.getDetailLevel(1);
// get inspected attribute carriers
Expand All @@ -1760,11 +1762,25 @@ GNEDemandElementPlan::drawPlanLanePartial(const bool drawPlan, const GUIVisualiz
GUIGeometry planGeometry;
// update pathGeometry depending of first and last segment
if (segment->isFirstSegment() && segment->isLastSegment()) {
planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
getPlanAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_STARTPOS),
getPlanAttributePosition(GNE_ATTR_PLAN_GEOMETRY_STARTPOS),
getPlanAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS),
getPlanAttributePosition(GNE_ATTR_PLAN_GEOMETRY_ENDPOS));
if (tagProperty.planFromTAZ()) {
planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
getPlanAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_STARTPOS),
Position::INVALID,
getPlanAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS),
getPlanAttributePosition(GNE_ATTR_PLAN_GEOMETRY_ENDPOS));
} else if (tagProperty.planToTAZ()) {
planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
getPlanAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_STARTPOS),
getPlanAttributePosition(GNE_ATTR_PLAN_GEOMETRY_STARTPOS),
getPlanAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS),
Position::INVALID);
} else {
planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
getPlanAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_STARTPOS),
getPlanAttributePosition(GNE_ATTR_PLAN_GEOMETRY_STARTPOS),
getPlanAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_ENDPOS),
getPlanAttributePosition(GNE_ATTR_PLAN_GEOMETRY_ENDPOS));
}
} else if (segment->isFirstSegment()) {
planGeometry.updateGeometry(segment->getLane()->getLaneGeometry().getShape(),
getPlanAttributeDouble(GNE_ATTR_PLAN_GEOMETRY_STARTPOS),
Expand Down Expand Up @@ -1800,8 +1816,6 @@ GNEDemandElementPlan::drawPlanLanePartial(const bool drawPlan, const GUIVisualiz
// draw red arrows
drawFromArrow(s, segment->getLane(), segment);
drawToArrow(s, segment->getLane(), segment);
// draw end position
drawEndPosition(s, d, endPosRadius);
// Pop last matrix
GLHelper::popMatrix();
// Draw name if isn't being drawn for selecting
Expand Down Expand Up @@ -1836,10 +1850,16 @@ GNEDemandElementPlan::drawPlanJunctionPartial(const bool drawPlan, const GUIVisu
const double offsetFront, const double planWidth, const RGBColor& planColor, const RGBColor& planSelectedColor) const {
// get view net
auto viewNet = myPlanElement->getNet()->getViewNet();
// get tag property
const auto& tagProperty = myPlanElement->getTagProperty();
// get plan parent
const GNEDemandElement* planParent = myPlanElement->getParentDemandElements().front();
// check if draw plan elements can be drawn
if (drawPlan && myPlanElement->getNet()->getPathManager()->getPathDraw()->checkDrawPathGeometry(s, segment, myPlanElement->getTagProperty().getTag())) {
if (drawPlan && myPlanElement->getNet()->getPathManager()->getPathDraw()->checkDrawPathGeometry(s, segment, tagProperty.getTag())) {
// draw boundary
if (tagProperty.isPlacedInRTree() && s.drawBoundaries) {
GLHelper::drawBoundary(s, getPlanCenteringBoundary());
}
// get detail level
const auto d = s.getDetailLevel(1);
// get inspected attribute carriers
Expand Down
16 changes: 8 additions & 8 deletions src/utils/gui/div/GUIGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,14 @@ GUIGeometry::updateSinglePosGeometry(const Position& position, const double rota
}


void GUIGeometry::clearGeometry() {
// clear geometry containers
myShape.clear();
myShapeRotations.clear();
myShapeLengths.clear();
}


void
GUIGeometry::moveGeometryToSide(const double amount) {
// move shape
Expand Down Expand Up @@ -551,14 +559,6 @@ GUIGeometry::angleLookup(const double angleDeg) {
}


void GUIGeometry::clearGeometry() {
// clear geometry containers
myShape.clear();
myShapeRotations.clear();
myShapeLengths.clear();
}


void
GUIGeometry::calculateShapeRotationsAndLengths() {
// clear rotations and lengths
Expand Down
6 changes: 3 additions & 3 deletions src/utils/gui/div/GUIGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ class GUIGeometry {
/// @brief update position and rotation
void updateSinglePosGeometry(const Position& position, const double rotation);

/// @brief clear geometry
void clearGeometry();

/// @brief move current shape to side
void moveGeometryToSide(const double amount);

Expand Down Expand Up @@ -124,9 +127,6 @@ class GUIGeometry {
/// @}

protected:
/// @brief clear geometry
void clearGeometry();

/// @brief calculate shape rotations and lengths
void calculateShapeRotationsAndLengths();

Expand Down
8 changes: 4 additions & 4 deletions src/utils/options/OptionsCont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,8 @@ OptionsCont::printHelp(std::ostream& os) {
}
if (!foundTopic) {
// print topic list
os << "Help Topics:" << std::endl;
for (std::string t : mySubTopics) {
os << "Help Topics:" << std::endl;
for (const std::string& t : mySubTopics) {
os << " " << t << std::endl;
}
}
Expand All @@ -819,7 +819,7 @@ OptionsCont::printHelp(std::ostream& os) {
os << "Usage: " << myAppName << " [OPTION]*" << std::endl;
// print additional text if any
if (myAdditionalMessage.length() > 0) {
os << myAdditionalMessage << std::endl << ' ' << std::endl;
os << myAdditionalMessage << std::endl << std::endl;
}
// print the options
for (const auto& subTopic : mySubTopics) {
Expand All @@ -835,7 +835,7 @@ OptionsCont::printHelp(std::ostream& os) {
}
}
os << std::endl;
os << "Report bugs at <https://github.com/eclipse/sumo/issues>." << std::endl;
os << "Report bugs at <https://github.com/eclipse-sumo/sumo/issues>." << std::endl;
os << "Get in contact via <sumo@dlr.de>." << std::endl;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/activitygen/meta/help/output.activitygen
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Eclipse SUMO activitygen Version v1_17_0+2470-b55cba8942c
Eclipse SUMO activitygen Version v1_20_0+1699-94bb18538d6
Copyright (C) 2001-2024 German Aerospace Center (DLR) and others; https://sumo.dlr.de
Copyright (C) 2010-2012 Technische Universitaet Muenchen
Generates trips of persons throughout a day for the microscopic, multi-modal
Expand Down Expand Up @@ -78,5 +78,5 @@ Examples:
activitygen --net-file <INPUT>.net.xml --stat-file <INPUT>.stat.xml --output <OUTPUT>.rou.xml --duration-d <NBR_OF_DAYS>
generate a trips file from a stats file on a given net for numerous days (with fixed random seed)

Report bugs at <https://github.com/eclipse/sumo/issues>.
Report bugs at <https://github.com/eclipse-sumo/sumo/issues>.
Get in contact via <sumo@dlr.de>.
4 changes: 2 additions & 2 deletions tests/dfrouter/meta/help/output.dfrouter
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Eclipse SUMO dfrouter Version v1_17_0+2470-b55cba8942c
Eclipse SUMO dfrouter Version v1_20_0+1699-94bb18538d6
Copyright (C) 2001-2024 German Aerospace Center (DLR) and others; https://sumo.dlr.de
Builds vehicle routes for SUMO using detector values.

Expand Down Expand Up @@ -151,5 +151,5 @@ Examples:
dfrouter -c <CONFIGURATION>
run routing with options from file

Report bugs at <https://github.com/eclipse/sumo/issues>.
Report bugs at <https://github.com/eclipse-sumo/sumo/issues>.
Get in contact via <sumo@dlr.de>.
4 changes: 2 additions & 2 deletions tests/duarouter/meta/help/output.duarouter
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Eclipse SUMO duarouter Version v1_20_0+0837-89657f7d4be
Eclipse SUMO duarouter Version v1_20_0+1699-94bb18538d6
Copyright (C) 2001-2024 German Aerospace Center (DLR) and others; https://sumo.dlr.de
Shortest path router and DUE computer for the microscopic, multi-modal traffic
simulation SUMO.
Expand Down Expand Up @@ -227,5 +227,5 @@ Examples:
duarouter -c <CONFIGURATION>
run routing with options from file

Report bugs at <https://github.com/eclipse/sumo/issues>.
Report bugs at <https://github.com/eclipse-sumo/sumo/issues>.
Get in contact via <sumo@dlr.de>.
4 changes: 2 additions & 2 deletions tests/jtrrouter/meta/help/output.jtrrouter
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Eclipse SUMO jtrrouter Version v1_20_0+0837-89657f7d4be
Eclipse SUMO jtrrouter Version v1_20_0+1699-94bb18538d6
Copyright (C) 2001-2024 German Aerospace Center (DLR) and others; https://sumo.dlr.de
Router for the microscopic, multi-modal traffic simulation SUMO based on
junction turning ratios.
Expand Down Expand Up @@ -159,5 +159,5 @@ Examples:
jtrrouter -c <CONFIGURATION>
run with routing options defined in file

Report bugs at <https://github.com/eclipse/sumo/issues>.
Report bugs at <https://github.com/eclipse-sumo/sumo/issues>.
Get in contact via <sumo@dlr.de>.
4 changes: 2 additions & 2 deletions tests/marouter/meta/help/output.marouter
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Eclipse SUMO marouter Version v1_20_0+0837-89657f7d4be
Eclipse SUMO marouter Version v1_20_0+1699-94bb18538d6
Copyright (C) 2001-2024 German Aerospace Center (DLR) and others; https://sumo.dlr.de
Import O/D-matrices for macroscopic traffic assignment to generate SUMO routes.

Expand Down Expand Up @@ -208,5 +208,5 @@ Examples:
marouter -c <CONFIGURATION>
run routing with options from file

Report bugs at <https://github.com/eclipse/sumo/issues>.
Report bugs at <https://github.com/eclipse-sumo/sumo/issues>.
Get in contact via <sumo@dlr.de>.
4 changes: 2 additions & 2 deletions tests/netconvert/meta/help/output.netconvert
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Eclipse SUMO netconvert Version v1_14_1+14469-45ab8384f8c
Eclipse SUMO netconvert Version v1_20_0+1699-94bb18538d6
Copyright (C) 2001-2024 German Aerospace Center (DLR) and others; https://sumo.dlr.de
Network importer / builder for the microscopic, multi-modal traffic simulation
SUMO.
Expand Down Expand Up @@ -710,5 +710,5 @@ Examples:
netconvert -n ./nodes.xml -e ./edges.xml -v -t ./owntypes.xml
generate net with given nodes, edges, and edge types doing verbose output

Report bugs at <https://github.com/eclipse/sumo/issues>.
Report bugs at <https://github.com/eclipse-sumo/sumo/issues>.
Get in contact via <sumo@dlr.de>.
4 changes: 2 additions & 2 deletions tests/netgen/meta/help/output.netgen
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Eclipse SUMO netgenerate Version v1_14_1+14496-f6b8788bf11
Eclipse SUMO netgenerate Version v1_20_0+1699-94bb18538d6
Copyright (C) 2001-2024 German Aerospace Center (DLR) and others; https://sumo.dlr.de
Synthetic network generator for the microscopic, multi-modal traffic simulation
SUMO.
Expand Down Expand Up @@ -510,5 +510,5 @@ Examples:
netgenerate --rand [random-network options] -o <OUTPUTFILE>
create random net

Report bugs at <https://github.com/eclipse/sumo/issues>.
Report bugs at <https://github.com/eclipse-sumo/sumo/issues>.
Get in contact via <sumo@dlr.de>.
4 changes: 2 additions & 2 deletions tests/od2trips/meta/help/output.od2trips
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Eclipse SUMO od2trips Version v1_17_0+2470-b55cba8942c
Eclipse SUMO od2trips Version v1_20_0+1699-94bb18538d6
Copyright (C) 2001-2024 German Aerospace Center (DLR) and others; https://sumo.dlr.de
Importer of O/D-matrices for the microscopic, multi-modal traffic simulation
SUMO.
Expand Down Expand Up @@ -106,5 +106,5 @@ Examples:
od2trips -c <CONFIGURATION>
run with configuration file

Report bugs at <https://github.com/eclipse/sumo/issues>.
Report bugs at <https://github.com/eclipse-sumo/sumo/issues>.
Get in contact via <sumo@dlr.de>.
Loading

0 comments on commit 33bf3f8

Please sign in to comment.