Skip to content

Commit

Permalink
fix #14375
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Feb 21, 2024
1 parent 3b533ba commit 33f5cfd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/netimport/NIImporter_SUMO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ NIImporter_SUMO::NIImporter_SUMO(NBNetBuilder& nb)
myGeomAvoidOverlap(true),
myJunctionsHigherSpeed(false),
myInternalJunctionsVehicleWidth(OptionsCont::getOptions().getFloat("internal-junctions.vehicle-width")),
myJunctionsMinimalShape(OptionsCont::getOptions().getBool("junctions.minimal-shape")),
myJunctionsEndpointShape(OptionsCont::getOptions().getBool("junctions.endpoint-shape"))
{
}
Expand Down Expand Up @@ -343,6 +344,9 @@ NIImporter_SUMO::_loadNetwork(OptionsCont& oc) {
if (oc.isWriteable("internal-junctions.vehicle-width") && oc.getFloat("internal-junctions.vehicle-width") != myInternalJunctionsVehicleWidth) {
oc.set("internal-junctions.vehicle-width", toString(myInternalJunctionsVehicleWidth));
}
if (oc.isWriteable("junctions.minimal-shape") && oc.getBool("junctions.minimal-shape") != myJunctionsMinimalShape) {
oc.set("junctions.minimal-shape", toString(myJunctionsMinimalShape));
}
if (oc.isWriteable("junctions.endpoint-shape") && oc.getBool("junctions.endpoint-shape") != myJunctionsEndpointShape) {
oc.set("junctions.endpoint-shape", toString(myJunctionsEndpointShape));
}
Expand Down Expand Up @@ -450,6 +454,7 @@ NIImporter_SUMO::myStartElement(int element,
myGeomAvoidOverlap = attrs.getOpt<bool>(SUMO_ATTR_AVOID_OVERLAP, nullptr, ok, myGeomAvoidOverlap);
myJunctionsHigherSpeed = attrs.getOpt<bool>(SUMO_ATTR_HIGHER_SPEED, nullptr, ok, myJunctionsHigherSpeed);
myInternalJunctionsVehicleWidth = attrs.getOpt<double>(SUMO_ATTR_INTERNAL_JUNCTIONS_VEHICLE_WIDTH, nullptr, ok, myInternalJunctionsVehicleWidth);
myJunctionsMinimalShape = attrs.getOpt<bool>(SUMO_ATTR_JUNCTIONS_MINIMAL_SHAPE, nullptr, ok, myJunctionsMinimalShape);
myJunctionsEndpointShape = attrs.getOpt<bool>(SUMO_ATTR_JUNCTIONS_ENDPOINT_SHAPE, nullptr, ok, myJunctionsEndpointShape);
// derived
const OptionsCont& oc = OptionsCont::getOptions();
Expand Down
1 change: 1 addition & 0 deletions src/netimport/NIImporter_SUMO.h
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ class NIImporter_SUMO : public SUMOSAXHandler {
/// @brief custom settings for internal junction computation
double myInternalJunctionsVehicleWidth;
/// @brief custom settings for junction shape computation
bool myJunctionsMinimalShape;
bool myJunctionsEndpointShape;

/// @brief loaded roundabout edges
Expand Down
3 changes: 3 additions & 0 deletions src/netwrite/NWWriter_SUMO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ NWWriter_SUMO::writeNetwork(const OptionsCont& oc, NBNetBuilder& nb) {
if (oc.exists("internal-junctions.vehicle-width") && !oc.isDefault("internal-junctions.vehicle-width")) {
attrs[SUMO_ATTR_INTERNAL_JUNCTIONS_VEHICLE_WIDTH] = toString(oc.getFloat("internal-junctions.vehicle-width"));
}
if (!oc.isDefault("junctions.minimal-shape")) {
attrs[SUMO_ATTR_JUNCTIONS_MINIMAL_SHAPE] = toString(oc.getBool("junctions.minimal-shape"));
}
if (!oc.isDefault("junctions.endpoint-shape")) {
attrs[SUMO_ATTR_JUNCTIONS_ENDPOINT_SHAPE] = toString(oc.getBool("junctions.endpoint-shape"));
}
Expand Down
1 change: 1 addition & 0 deletions src/utils/xml/SUMOXMLDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,7 @@ StringBijection<int>::Entry SUMOXMLDefinitions::attrs[] = {
{ "avoidOverlap", SUMO_ATTR_AVOID_OVERLAP },
{ "junctionHigherSpeed", SUMO_ATTR_HIGHER_SPEED },
{ "internalJunctionsVehicleWidth", SUMO_ATTR_INTERNAL_JUNCTIONS_VEHICLE_WIDTH },
{ "junctionsMinimalShape", SUMO_ATTR_JUNCTIONS_MINIMAL_SHAPE },
{ "junctionsEndpointShape", SUMO_ATTR_JUNCTIONS_ENDPOINT_SHAPE },

{ "actorConfig", SUMO_ATTR_ACTORCONFIG },
Expand Down
1 change: 1 addition & 0 deletions src/utils/xml/SUMOXMLDefinitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,7 @@ enum SumoXMLAttr {
SUMO_ATTR_AVOID_OVERLAP,
SUMO_ATTR_HIGHER_SPEED,
SUMO_ATTR_INTERNAL_JUNCTIONS_VEHICLE_WIDTH,
SUMO_ATTR_JUNCTIONS_MINIMAL_SHAPE,
SUMO_ATTR_JUNCTIONS_ENDPOINT_SHAPE,
SUMO_ATTR_COMMAND,

Expand Down

0 comments on commit 33f5cfd

Please sign in to comment.