265 throw InvalidArgument(
"In preference for routingType '" + routingType +
"', priority must be positve");
269 for (std::string className : st.
getVector()) {
274 myNet.addPreference(routingType,
"", prio);
278 for (std::string typeName : st.
getVector()) {
279 myNet.addPreference(routingType, typeName, prio);
296 const std::string signalID = attrs.
get<std::string>(
SUMO_ATTR_ID,
nullptr, ok);
298 throw InvalidArgument(
"Rail signal '" + signalID +
"' in railSignalConstraints is not known");
302 throw InvalidArgument(
"Traffic light '" + signalID +
"' is not a rail signal");
415 if (from ==
nullptr) {
416 WRITE_ERRORF(
TL(
"Unknown from-node '%' for edge '%'."), it->second.first, it->first);
420 WRITE_ERRORF(
TL(
"Unknown to-node '%' for edge '%'."), it->second.second, it->first);
423 if (edge !=
nullptr) {
494 myEdgeControlBuilder.beginEdgeParsing(
id, func, streetName, edgeType, routingType, priority, bidi, distance);
503 if (!crossingEdges.empty()) {
504 std::vector<std::string> crossingEdgesVector;
507 crossingEdgesVector.push_back(edges.
next());
552 if (std::isnan(length)) {
553 WRITE_ERRORF(
TL(
"Attribute length of lane '%' is invalid (%)"),
id, length);
557 if (std::isnan(maxSpeed)) {
558 WRITE_ERRORF(
TL(
"Attribute maxSpeed of lane '%' is invalid (%)"),
id, maxSpeed);
573 WRITE_ERRORF(
TL(
"Shape of lane '%' is broken.\n Can not build according edge."),
id);
583 std::swap(changeLeft, changeRight);
586 myNet.setPermissionsFound();
591 MSLane* lane =
myEdgeControlBuilder.addLane(
id, maxSpeed, friction, length, shape, width, permissions, changeLeft, changeRight, index, isRampAccel, type, outlineShape);
623 if (shape.size() > 2) {
634 std::vector<MSLane*> incomingLanes;
637 std::vector<MSLane*> internalLanes;
647 WRITE_ERROR(e.what() + std::string(
"\n Can not build according junction."));
656 const std::string& def, std::vector<MSLane*>& into,
bool& ok) {
659 std::string laneID = st.
next();
664 if (lane ==
nullptr) {
665 WRITE_ERRORF(
TL(
"An unknown lane ('%') was tried to be set as incoming to junction '%'."), laneID, junctionID);
669 into.push_back(lane);
777 if (request >= 0 && response.length() > 0) {
822 WRITE_ERRORF(
TL(
"Traffic light '%' has unknown type '%'."),
id, typeS);
889 std::string phaseTypeString;
896 if (phaseTypeString.find(
"decisional") != std::string::npos) {
898 }
else if (phaseTypeString.find(
"transient") != std::string::npos) {
901 MsgHandler::getWarningInstance()->
inform(
"SOTL_ATTL_TYPE_DECISIONAL nor SOTL_ATTL_TYPE_TRANSIENT. Assuming phase type as SUMOSOTL_TagAttrDefinitions::SOTL_ATTL_TYPE_TRANSIENT");
904 phase->
myCommit = (phaseTypeString.find(
"commit") != std::string::npos);
906 if (phaseTypeString.find(
"target") != std::string::npos) {
907 std::string delimiter(
" ,;");
932 const std::string
id = attrs.
get<std::string>(
SUMO_ATTR_ID,
nullptr, ok);
943 const std::string
id = attrs.
get<std::string>(
SUMO_ATTR_ID,
nullptr, ok);
953 const std::string
id = attrs.
get<std::string>(
SUMO_ATTR_ID,
nullptr, ok);
968 const std::string
id = attrs.
get<std::string>(
SUMO_ATTR_ID,
nullptr, ok);
991 friendlyPos, name, vTypes, nextEdges, detectPersons);
1015 const std::string lane = attrs.
get<std::string>(
SUMO_ATTR_LANE,
id.c_str(), ok);
1016 const std::string file = attrs.
get<std::string>(
SUMO_ATTR_FILE,
id.c_str(), ok);
1040 WRITE_WARNING(
TL(
"VTypeProbes are deprecated. Use fcd-output devices (assigned to the vType) instead."));
1088 const std::string
id = attrs.
get<std::string>(
SUMO_ATTR_ID,
nullptr, ok);
1090 const std::string toLane = attrs.
getOpt<std::string>(
SUMO_ATTR_TO,
id.c_str(), ok,
"");
1095 const double length = attrs.
getOpt<
double>(
SUMO_ATTR_LENGTH,
id.c_str(), ok, std::numeric_limits<double>::max());
1099 if (contStr !=
"") {
1100 WRITE_WARNINGF(
TL(
"Ignoring deprecated argument 'cont' for E2 detector '%'"),
id);
1103 const std::string file = attrs.
get<std::string>(
SUMO_ATTR_FILE,
id.c_str(), ok);
1108 double endPosition = attrs.
getOpt<
double>(
SUMO_ATTR_ENDPOS,
id.c_str(), ok, std::numeric_limits<double>::max());
1117 bool lanesGiven = lanes !=
"";
1118 bool laneGiven = lane !=
"";
1119 if (!(lanesGiven || laneGiven)) {
1121 WRITE_WARNING(
TL(
"Trying to specify detector's lane by the given id since the argument 'lane' is missing."))
1125 bool lengthGiven = length != std::numeric_limits<double>::max();
1126 bool posGiven = position != std::numeric_limits<double>::max();
1127 bool endPosGiven = endPosition != std::numeric_limits<double>::max();
1128 bool lsaGiven = lsaid !=
"";
1129 bool toLaneGiven = toLane !=
"";
1132 std::vector<MSLane*> clanes;
1135 std::string seps =
" ,\t\n";
1139 std::string nextLaneID = st.
next();
1141 if (nextLaneID.find_first_of(seps) != nextLaneID.npos) {
1145 clanes.push_back(clane);
1147 if (clanes.size() == 0) {
1148 throw InvalidArgument(
"Malformed argument 'lanes' for E2Detector '" +
id +
"'.\nSpecify 'lanes' as a sequence of lane-IDs separated by whitespace or comma (',')");
1151 WRITE_WARNING(
"Ignoring argument 'lane' for E2Detector '" +
id +
"' since argument 'lanes' was given.\n"
1152 "Usage combinations for positional specification: [lane, pos, length], [lane, endPos, length], or [lanes, pos, endPos]");
1155 WRITE_WARNING(
"Ignoring argument 'length' for E2Detector '" +
id +
"' since argument 'lanes' was given.\n"
1156 "Usage combinations for positional specification: [lane, pos, length], [lane, endPos, length], or [lanes, pos, endPos]");
1161 WRITE_WARNINGF(
TL(
"Missing argument 'pos' for E2Detector '%'. Assuming detector start == lane start of lane '%'."),
id, clanes[0]->getID());
1165 endPosition = clanes[clanes.size() - 1]->getLength();
1166 WRITE_WARNINGF(
TL(
"Missing argument 'endPos' for E2Detector '%'. Assuming detector end == lane end of lane '%'."),
id, clanes[clanes.size() - 1]->getID());
1171 std::stringstream ss;
1172 ss <<
"Missing argument 'lane' for E2Detector '" <<
id <<
"'."
1173 <<
"\nUsage combinations for positional specification: [lane, pos, length], [lane, endPos, length], or [lanes, pos, endPos]";
1180 if (endPosGiven && lengthGiven) {
1181 std::stringstream ss;
1182 ss <<
"Ignoring argument 'endPos' for E2Detector '" <<
id <<
"' since argument 'pos' was given."
1183 <<
"\nUsage combinations for positional specification: [lane, pos, length], [lane, endPos, length], or [lanes, pos, endPos]";
1185 endPosition = std::numeric_limits<double>::max();
1187 if (!lengthGiven && !endPosGiven) {
1188 std::stringstream ss;
1189 ss <<
"Missing arguments 'length'/'endPos' for E2Detector '" <<
id <<
"'. Assuming detector end == lane end of lane '" << lane <<
"'.";
1193 }
else if (endPosGiven) {
1196 std::stringstream ss;
1197 ss <<
"Missing arguments 'length'/'pos' for E2Detector '" <<
id <<
"'. Assuming detector start == lane start of lane '" << lane <<
"'.";
1201 std::stringstream ss;
1202 if (lengthGiven && fabs(length - clane->
getLength()) > NUMERICAL_EPS) {
1203 ss <<
"Incomplete positional specification for E2Detector '" <<
id <<
"'."
1204 <<
"\nUsage combinations for positional specification: [lane, pos, length], [lane, endPos, length], or [lanes, pos, endPos]";
1209 ss <<
"Missing arguments 'pos'/'endPos' for E2Detector '" <<
id <<
"'. Assuming that the detector covers the whole lane '" << lane <<
"'.";
1224 period = attrs.
getPeriod(
id.c_str(), ok,
false);
1232 throw InvalidArgument(
"The detector '" +
id +
"' refers to an unknown lsa '" + lsaid +
"'.");
1235 WRITE_WARNINGF(
TL(
"Ignoring argument 'period' for E2Detector '%' since argument 'tl' was given."),
id);
1241 MSLane* cToLane =
nullptr;
1247 std::string filename;
1258 det =
myDetectorBuilder.buildE2Detector(
id, clanes, position, endPosition, filename, period,
1259 haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold,
1260 name, vTypes, nextEdges, detectPersons, friendlyPos, showDetector,
1264 det =
myDetectorBuilder.buildE2Detector(
id, clane, position, endPosition, length, filename, period,
1265 haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold,
1266 name, vTypes, nextEdges, detectPersons, friendlyPos, showDetector,
1281 const std::string file = attrs.
get<std::string>(
SUMO_ATTR_FILE,
id.c_str(), ok);
1296 period, haltingSpeedThreshold, haltingTimeThreshold, name, vTypes, nextEdges, detectPersons, openEntry, expectArrival);
1345 const std::string file = attrs.
get<std::string>(
SUMO_ATTR_FILE,
id.c_str(), ok);
1346 const std::string type = attrs.
getOpt<std::string>(
SUMO_ATTR_TYPE,
id.c_str(), ok,
"performance");
1352 std::vector<std::string> edgeIDs = attrs.
getOpt<std::vector<std::string> >(
SUMO_ATTR_EDGES,
id.c_str(), ok);
1356 if (aggregateStr ==
"taz") {
1364 int detectPersons = 0;
1365 for (std::string mode :
StringTokenizer(detectPersonsString).getVector()) {
1369 WRITE_ERRORF(
TL(
"Invalid person mode '%' in edgeData definition '%'"), mode,
id);
1373 if (edgesFile !=
"") {
1374 std::ifstream strm(edgesFile.c_str());
1376 throw ProcessError(
"Could not load names of edges for edgeData definition '" +
id +
"' from '" + edgesFile +
"'.");
1378 while (strm.good()) {
1383 edgeIDs.push_back(name.substr(5));
1384 }
else if (name !=
"") {
1385 edgeIDs.push_back(name);
1389 std::vector<MSEdge*> edges;
1390 for (
const std::string& edgeID : edgeIDs) {
1392 if (edge ==
nullptr) {
1393 WRITE_ERRORF(
TL(
"Unknown edge '%' in edgeData definition '%'"), edgeID,
id);
1396 edges.push_back(edge);
1400 WRITE_WARNINGF(
TL(
"LaneData '%' requested for mesoscopic simulation but --meso-lane-queue is not active. Falling back to edgeData."),
id);
1405 type, useLanes, excludeEmpty, withInternal, trackVehicles, detectPersons,
1406 maxTravelTime, minSamples, haltingSpeedThreshold, vtypes, writeAttributes, edges, aggregate,
1420 const std::string toID = attrs.
get<std::string>(
SUMO_ATTR_TO,
nullptr, ok);
1443 if (from ==
nullptr) {
1444 WRITE_ERRORF(
TL(
"Unknown from-edge '%' in connection."), fromID);
1449 if (to ==
nullptr) {
1453 if (fromLaneIdx < 0 || fromLaneIdx >= (
int)from->getLanes().size() ||
1454 toLaneIdx < 0 || toLaneIdx >= (
int)to->
getLanes().size()) {
1455 WRITE_ERRORF(
TL(
"Invalid lane index in connection from '%' to '%'."), from->getID(), to->
getID());
1458 MSLane* fromLane = from->getLanes()[fromLaneIdx];
1469 if ((tlLinkIdx < 0 || tlLinkIdx >= (
int)logic->getCurrentPhaseDef().getState().size())
1473 "' in connection controlled by '" + tlID +
"'");
1485 if (via ==
nullptr) {
1487 "') should be set as a via-lane for lane '" + toLane->
getID() +
"'.");
1496 myCurrentLink =
new MSLink(fromLane, toLane, via, dir, state, length, foeVisibilityDistance, keepClear, logic, tlLinkIdx, indirect);
1497 if (via !=
nullptr) {
1529 const std::string toID = attrs.
get<std::string>(
SUMO_ATTR_TO,
nullptr, ok);
1535 if (from ==
nullptr) {
1540 if (to ==
nullptr) {
1544 if (fromLaneIdx < 0 || fromLaneIdx >= (
int)from->getLanes().size() ||
1545 toLaneIdx < 0 || toLaneIdx >= (
int)to->
getLanes().size()) {
1546 WRITE_ERRORF(
TL(
"Invalid lane index in conflict with '%' to '%'."), from->getID(), to->
getID());
1549 MSLane* fromLane = from->getLanes()[fromLaneIdx];
1553 myCurrentLink->addCustomConflict(fromLane, toLane, startPos, endPos);
1598 WRITE_WARNING(
TL(
"no valid geo projection loaded from network. fcd-output.geo will not work"));
1619 if (sink ==
nullptr) {
1622 sink->
initialize(
new std::vector<MSLane*>());
1630 throw InvalidArgument(
"Another edge with the id '" + sinkID +
"' exists.");
1634 if (source ==
nullptr) {
1637 source->
initialize(
new std::vector<MSLane*>());
1644 throw InvalidArgument(
"Another edge with the id '" + sourceID +
"' exists.");
1650 for (
const std::string& eID : desc) {
1653 if (edge ==
nullptr) {
1669 if (shape.size() != 0) {
1670 if (!
myNet.getShapeContainer().addPolygon(
myCurrentDistrictID,
"taz", color, 0, 0,
"", shape,
false, fill, 1.0,
false, name)) {
1694 if (succ !=
nullptr) {
1710 const std::vector<std::string>& edgeIDs = attrs.
get<std::vector<std::string> >(
SUMO_ATTR_EDGES,
nullptr, ok);
1712 for (
const std::string& eID : edgeIDs) {
1714 if (edge ==
nullptr) {
1727 std::vector<std::string> signalIDs = attrs.
get<std::vector<std::string>>(
SUMO_ATTR_SIGNALS,
nullptr, ok);
1728 std::vector<const MSRailSignal*> signals;
1729 for (
const std::string&
id : signalIDs) {
1732 if (rs !=
nullptr) {
1733 signals.push_back(rs);
1769 if (lane ==
nullptr) {
1770 WRITE_ERRORF(
TL(
"Lane '%' to place poi '%' on is not known."), laneID, poiID);
1776 if ((lanePos < 0) && friendlyPos) {
1779 if ((lanePos > lane->
getLength()) && friendlyPos) {
1782 if (lanePos < 0 || lanePos > lane->
getLength()) {
1791 if (rs ==
nullptr) {
1796 const std::string signalID = attrs.
get<std::string>(
SUMO_ATTR_TLID,
nullptr, ok);
1797 const std::string foesString = attrs.
get<std::string>(
SUMO_ATTR_FOES,
nullptr, ok);
1803 throw InvalidArgument(
"Rail signal '" + signalID +
"' in railSignalConstraints is not known");
1806 if (signal ==
nullptr) {
1807 throw InvalidArgument(
"Traffic light '" + signalID +
"' is not a rail signal");
1831 for (
const std::string& foe : foes) {
1844 int detectPersons = 0;
1845 for (std::string mode :
StringTokenizer(detectPersonsString).getVector()) {
1849 WRITE_ERRORF(
TL(
"Invalid person mode '%' in E1 detector definition '%'"), mode,
id);
1854 return detectPersons;
#define WRITE_WARNINGF(...)
#define WRITE_ERRORF(...)
#define WRITE_WARNING(msg)
const std::string invalid_return< std::string >::value
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
#define SUMOTime_MAX_PERIOD
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
const SVCPermissions SVCAll
all VClasses are allowed
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_TRACTION_SUBSTATION
A traction substation.
@ SUMO_TAG_PHASE
a single phase description
@ SUMO_TAG_RAILSIGNAL_CONSTRAINTS
Constraints on switching a rail signal.
@ SUMO_TAG_BIDI_PREDECESSOR
Predecessor constraint for rail signal before bidirectional section.
@ SUMO_TAG_NET
root element of a network file
@ SUMO_TAG_REROUTER
A rerouter.
@ SUMO_TAG_INSERTION_PREDECESSOR
Predecessor constraint on insertion before rail signal.
@ SUMO_TAG_STOPOFFSET
Information on vClass specific stop offsets at lane end.
@ SUMO_TAG_REQUEST
description of a logic request within the junction
@ SUMO_TAG_ROUTEPROBE
a routeprobe detector
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_TIMEDEVENT
The definition of a periodic event.
@ SUMO_TAG_E2DETECTOR
an e2 detector
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
@ SUMO_TAG_CONFLICT
conflict between two connections
@ SUMO_TAG_ACCESS
An access point for a train stop.
@ SUMO_TAG_CONDITION
a condition for phase switching
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_FUNCTION
a sequence of assignments evaluated in the context of passed arguments
@ SUMO_TAG_MEANDATA_LANE
a lane based mean data detector
@ SUMO_TAG_RESTRICTION
begin/end of the description of an edge restriction
@ SUMO_TAG_OVERHEAD_WIRE_CLAMP
An overhead wire clamp (connection of wires in opposite directions).
@ SUMO_TAG_PREFERENCE
begin/end of the description of an edge preferences
@ SUMO_TAG_CONNECTION
connectioon between two lanes
@ SUMO_TAG_PARKING_AREA
A parking area.
@ SUMO_TAG_ROUNDABOUT
roundabout defined in junction
@ SUMO_TAG_DET_ENTRY
an e3 entry point
@ SUMO_TAG_TLLOGIC
a traffic light logic
@ SUMO_TAG_PARKING_SPACE
A parking space for a single vehicle within a parking area.
@ SUMO_TAG_FOE_INSERTION
Predecessor constraint on switching a rail signal.
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
@ SUMO_TAG_MEANDATA_EDGE
an edge based mean data detector
@ SUMO_TAG_OVERHEAD_WIRE_SECTION
An overhead wire section.
@ SUMO_TAG_VTYPEPROBE
a vtypeprobe detector
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop).
@ SUMO_TAG_OVERHEAD_WIRE_SEGMENT
An overhead wire segment.
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_INSTANT_INDUCTION_LOOP
An instantenous induction loop.
@ SUMO_TAG_PARAM
parameter associated to a certain key
@ SUMO_TAG_E1DETECTOR
an e1 detector
@ SUMO_TAG_INSERTION_ORDER
Predecessor constraint on insertion before rail signal.
@ SUMO_TAG_DET_EXIT
an e3 exit point
@ SUMO_TAG_TYPE
type (edge)
@ SUMO_TAG_VAPORIZER
vaporizer of vehicles
@ SUMO_TAG_LANE_AREA_DETECTOR
alternative tag for e2 detector
@ SUMO_TAG_ASSIGNMENT
a conditional variable assignment for phase switching
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
@ SUMO_TAG_NEIGH
begin/end of the description of a neighboring lane
@ SUMO_TAG_INDUCTION_LOOP
alternative tag for e1 detector
@ SUMO_TAG_DEADLOCK
Saved deadlock information, also for loading as an extra check.
@ SUMO_TAG_CALIBRATOR
A calibrator placed over edge.
@ SUMO_TAG_ENTRY_EXIT_DETECTOR
alternative tag for e3 detector
@ SUMO_TAG_E3DETECTOR
an e3 detector
@ SUMO_TAG_VSS
A variable speed sign.
@ SUMO_TAG_PREDECESSOR
Predecessor constraint on switching a rail signal.
@ SUMO_TAG_EDGE
begin/end of the description of an edge
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
@ LINKSTATE_ZIPPER
This is an uncontrolled, zipper-merge link.
@ LINKSTATE_TL_OFF_BLINKING
The link is controlled by a tls which is off and blinks, has to brake.
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
AggregateType
Numbers representing special SUMO-XML-attribute values Information on edgeData/laneData output should...
@ SUMO_ATTR_EXPECT_ARRIVAL
@ SUMO_ATTR_CONV_BOUNDARY
@ SUMO_ATTR_NARGS
The number of arguments for a condition function.
@ SUMO_ATTR_ORIG_BOUNDARY
@ SUMO_ATTR_LATEST_END
The maximum time within the cycle for switching (for coordinated actuation).
@ SUMO_ATTR_RED
red duration of a phase
@ SUMO_ATTR_INDIRECT
Whether this connection is an indirect (left) turn.
@ SUMO_ATTR_JAM_DIST_THRESHOLD
@ SUMO_ATTR_TRACK_VEHICLES
@ SUMO_ATTR_YELLOW
yellow duration of a phase
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_VEHICLEEXTENSION
vehicle extension time of a phase
@ SUMO_ATTR_WITH_INTERNAL
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_HALTING_TIME_THRESHOLD
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_NEXT
succesor phase index
@ SUMO_ATTR_MAX_TRAVELTIME
@ SUMO_ATTR_FILL
Fill the polygon.
@ SUMO_ATTR_FINAL_TARGET
The condition expression for switching into this phase when the active phase must end.
@ SUMO_ATTR_HALTING_SPEED_THRESHOLD
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
@ SUMO_ATTR_EARLY_TARGET
The condition expression for an early switch into this phase.
@ SUMO_ATTR_SHOW_DETECTOR
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_MAXDURATION
maximum duration of a phase
@ SUMO_ATTR_OUTLINESHAPE
edge: the outline shape in xml-definition
@ SUMO_ATTR_VISIBILITY_DISTANCE
foe visibility distance of a link
@ SUMO_ATTR_CROSSING_EDGES
the edges crossed by a pedestrian crossing
@ SUMO_ATTR_DIR
The abstract direction of a link.
@ SUMO_ATTR_TLLINKINDEX
link: the index of the link within the traffic light
@ SUMO_ATTR_CHECK
The expression for a condition assignment.
@ SUMO_ATTR_KEEP_CLEAR
Whether vehicles must keep the junction clear.
@ SUMO_ATTR_STATE
The state of a link.
@ SUMO_ATTR_TIME
trigger: the time of the step
@ SUMO_ATTR_WRITE_ATTRIBUTES
@ SUMO_ATTR_DETECT_PERSONS
@ SUMO_ATTR_EXCLUDE_EMPTY
@ SUMO_ATTR_EARLIEST_END
The minimum time within the cycle for switching (for coordinated actuation).
const double SUMO_const_laneWidth
std::pair< int, double > MMVersion
(M)ajor/(M)inor version for written networks and default version for loading
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
static std::string checkForRelativity(const std::string &filename, const std::string &basePath)
Returns the path from a configuration so that it is accessible from the current working directory.
const std::string & getFileName() const
returns the current file name
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
static bool init(OptionsCont &oc)
Initialises the processing and the final instance using the given options.
A road/street connecting two junctions.
void setOtherTazConnector(const MSEdge *edge)
void setJunctions(MSJunction *from, MSJunction *to)
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
void addSuccessor(MSEdge *edge, const MSEdge *via=nullptr)
Adds an edge to the list of edges which may be reached from this edge and to the incoming of the othe...
static MSEdge * dictionaryHint(const std::string &id, const int startIdx)
Returns the MSEdge associated to the key id giving a hint with a numerical id.
void initialize(const std::vector< MSLane * > *lanes)
Initialize the edge.
void resetTAZ(MSJunction *junction)
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary....
static bool gLefthand
Whether lefthand-drive is being simulated.
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
The base class for an intersection.
void addOutgoing(MSEdge *edge)
void addIncoming(MSEdge *edge)
Representation of a lane in the micro simulation.
void addApproachingLane(MSLane *lane, bool warnMultiCon)
void addIncomingLane(MSLane *lane, MSLink *viaLink)
void addLink(MSLink *link)
Delayed initialization.
double getLength() const
Returns the lane's length.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
virtual const PositionVector & getShape(bool) const
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
The simulated network and simulation perfomer.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
The definition of a single phase of a tls logic.
std::string name
Optional name or description for the current phase.
std::vector< std::string > myTargetLaneSet
SUMOTime maxDuration
The maximum duration of the phase.
bool myCommit
the phase is a commit, compulsory directive for SOTL policies
static const SUMOTime UNSPECIFIED_DURATION
SUMOTime vehext
for NEMA phase
SUMOTime latestEnd
The maximum time within the cycle for switching (for coordinated actuation).
bool myTransientNotDecisional
the phase is a transient one or a decisional one, compulsory directive for SOTL policies
SUMOTime minDuration
The minimum duration of the phase.
SUMOTime yellow
for NEMA phase
SUMOTime red
for NEMA phase
SUMOTime myLastSwitch
Stores the timestep of the last on-switched of the phase.
SUMOTime duration
The duration of the phase.
std::vector< int > nextPhases
The index of the phase that suceeds this one (or -1).
std::string finalTarget
The condition expression for switching into this phase when the active phase must end.
std::string earlyTarget
The condition expression for an early switch into this phase.
SUMOTime earliestEnd
The minimum time within the cycle for switching (for coordinated actuation).
A base class for constraints.
void addDeadlockCheck(std::vector< const MSRailSignal * > signals)
static MSRailSignalControl & getInstance()
void addConstraint(const std::string &tripId, MSRailSignalConstraint *constraint)
register constraint for signal switching
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs) override
Called on the opening of a tag;.
MSRouteHandler(const std::string &file, bool addVehiclesDirectly)
standard constructor
Storage for all programs of a single tls.
MSTrafficLightLogic * getActive() const
MSTrafficLightLogic * getDefault() const
return the default program (that last used program except TRACI_PROGRAM)
TLSLogicVariants & get(const std::string &id) const
Returns the variants of a named tls.
The parent class for traffic light logics.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
virtual void inform(std::string msg, bool addType=true)
adds a new error to the list
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
Builds detectors for microsim.
Interface for building edges.
void addRequest(const SUMOSAXAttributes &attrs)
adds a request item to the current junction logic
std::vector< Parameterised * > myLastParameterised
virtual void addE2Detector(const SUMOSAXAttributes &attrs)
Builds an e2 detector using the given specification.
MSLink * myCurrentLink
the link element for the connection currently being parsed
void addRoundabout(const SUMOSAXAttributes &attrs)
bool myHaveSeenTLSParams
whether tls params were loaded
void addWAUTSwitch(const SUMOSAXAttributes &attrs)
void addE3Entry(const SUMOSAXAttributes &attrs)
Adds an entry to the currently processed e3 detector.
void beginEdgeParsing(const SUMOSAXAttributes &attrs)
begins the processing of an edge
bool myHaveSeenAdditionalSpeedRestrictions
whether additional files contained type-specific speed limits
std::string myCurrentDistrictID
The id of the current district.
void addPhase(const SUMOSAXAttributes &attrs)
adds a phase to the traffic lights logic currently build
MMVersion myNetworkVersion
the loaded network version
std::string myCurrentTypeID
The id of the currently processed edge type.
void addAssignment(const SUMOSAXAttributes &attrs)
adds a switching condition assignment to the traffic lights logic currently build
static Parameterised * addPredecessorConstraint(int element, const SUMOSAXAttributes &attrs, MSRailSignal *rs)
virtual void addVTypeProbeDetector(const SUMOSAXAttributes &attrs)
Builds a vtype-detector using the given specification.
void addDistrictEdge(const SUMOSAXAttributes &attrs, bool isSource)
std::string myCurrentWAUTID
The id of the currently processed WAUT.
void parseLanes(const std::string &junctionID, const std::string &def, std::vector< MSLane * > &into, bool &ok)
void addFunction(const SUMOSAXAttributes &attrs)
adds a switching condition function to the traffic lights logic currently build
void addLane(const SUMOSAXAttributes &attrs)
adds a lane to the previously opened edge
void initJunctionLogic(const SUMOSAXAttributes &attrs)
begins the reading of a junction row logic
int parseDetectPersons(const std::string &detectPersonsString, const std::string &id, bool &ok)
Parameterised myLastEdgeParameters
virtual void myEndElement(int element)
Called when a closing tag occurs.
bool myHaveSeenDefaultLength
whether the loaded network contains edges with default lengths
NLTriggerBuilder & myTriggerBuilder
The trigger builder to use.
virtual void addInstantE1Detector(const SUMOSAXAttributes &attrs)
Builds an e1 detector using the given specification.
virtual void openJunction(const SUMOSAXAttributes &attrs)
opens a junction for processing
virtual void endE3Detector()
Builds of an e3 detector using collected values.
bool myAmParsingTLLogicOrJunction
internal information whether a tls-logic is currently read
JunctionGraph myJunctionGraph
void addDistrict(const SUMOSAXAttributes &attrs)
bool myCurrentIsInternalToSkip
Information whether the currently parsed edge is internal and not wished, here.
NLEdgeControlBuilder & myEdgeControlBuilder
The edge builder to use.
void initTrafficLightLogic(const SUMOSAXAttributes &attrs)
begins the reading of a traffic lights logic
bool myHaveSeenInternalEdge
whether the loaded network contains internal lanes
NLHandler(const std::string &file, MSNet &net, NLDetectorBuilder &detBuilder, NLTriggerBuilder &triggerBuilder, NLEdgeControlBuilder &edgeBuilder, NLJunctionControlBuilder &junctionBuilder)
Constructor.
void addCondition(const SUMOSAXAttributes &attrs)
adds a switching condition to the traffic lights logic currently build
void setLocation(const SUMOSAXAttributes &attrs)
Parses network location description.
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
bool myHaveSeenNeighs
whether the loaded network contains explicit neighbor lanes
virtual void openWAUT(const SUMOSAXAttributes &attrs)
LinkState parseLinkState(const std::string &state)
Parses the given character into an enumeration typed link state.
NLDiscreteEventBuilder myActionBuilder
A builder for object actions.
NLDetectorBuilder & myDetectorBuilder
The detector builder to use.
void addConflict(const SUMOSAXAttributes &attrs)
NLJunctionControlBuilder & myJunctionControlBuilder
The junction builder to use.
virtual void addE1Detector(const SUMOSAXAttributes &attrs)
Builds an e1 detector using the given specification.
virtual ~NLHandler()
Destructor.
void addE3Exit(const SUMOSAXAttributes &attrs)
Adds an exit to the currently processed e3 detector.
void beginE3Detector(const SUMOSAXAttributes &attrs)
Starts building of an e3 detector using the given specification.
virtual void closeEdge()
Closes the process of building an edge.
void closeFunction()
adds a switching condition function to the traffic lights logic currently build
bool myHaveJunctionHigherSpeeds
Whether the network was built with higher speed on junctions.
MSNet & myNet
The net to fill (preinitialised).
virtual void addDeadlock(const SUMOSAXAttributes &attrs)
Loads deadlock information for preparing additional rail signal checks.
MSRailSignal * myConstrainedSignal
rail signal for which constraints are being loaded
LinkDirection parseLinkDir(const std::string &dir)
Parses the given character into an enumeration typed link direction.
bool myNetIsLoaded
whether the location element was already loadee
void addWAUTJunction(const SUMOSAXAttributes &attrs)
virtual void addRouteProbeDetector(const SUMOSAXAttributes &attrs)
Builds a routeProbe-detector using the given specification.
virtual void addEdgeLaneMeanData(const SUMOSAXAttributes &attrs, int objecttype)
Builds edge or lane base mean data collector using the given specification.
bool myHaveWarnedAboutInvalidTLType
void addParam(const SUMOSAXAttributes &attrs)
void addConnection(const SUMOSAXAttributes &attrs)
adds a connection
Builder of microsim-junctions and tls.
Position getLanePos(const std::string &poiID, const std::string &laneID, double lanePos, bool friendlyPos, double lanePosLat)
get position for a given laneID (Has to be implemented in all child)
Builds trigger objects for microsim.
const std::string & getID() const
Returns the id.
static OptionsCont & getOptions()
Retrieves the options.
An upper class for objects with additional parameters.
virtual void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
void updateParameters(const Parameterised::Map &mapArg)
Adds or updates all given parameters from the map.
A point in 2D or 3D with translation and scaling methods.
static const Position INVALID
used to indicate that a position is valid
void closePolygon()
ensures that the last position equals the first
static RGBColor parseColor(std::string coldef)
Parses a color information.
virtual void myEndElement(int element)
Called when a closing tag occurs.
Encapsulated SAX-Attributes.
virtual std::string getString(int id, bool *isPresent=nullptr) const =0
Returns the string-value of the named (by its enum-value) attribute.
SUMOTime getOptPeriod(const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const
Tries to read the SUMOTime 'period' attribute.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue=T(), bool report=true) const
Tries to read given attribute assuming it is an int.
SUMOTime getOptOffsetReporting(int attr, const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const
Tries to read given attribute assuming it is a tls offset (SUMOTime or "begin").
SUMOTime getOptSUMOTimeReporting(int attr, const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
virtual std::string getStringSecure(int id, const std::string &def) const =0
Returns the string-value of the named (by its enum-value) attribute.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
SUMOTime getPeriod(const char *objectid, bool &ok, bool report=true) const
Tries to read the SUMOTime 'period' attribute.
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
static StringBijection< TrafficLightType > TrafficLightTypes
traffic light types
static StringBijection< PersonMode > PersonModeValues
person modes
static StringBijection< LinkState > LinkStates
link states
static StringBijection< LinkDirection > LinkDirections
link directions
static std::string getJunctionIDFromInternalEdge(const std::string internalEdge)
return the junction id when given an edge of type internal, crossing or WalkingArea
std::vector< std::string > getVector()
return vector of strings
bool hasNext()
returns the information whether further substrings exist
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
static MMVersion toVersion(const std::string &sData)
parse a (network) version string
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter