 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
62 myNet(net), myActionBuilder(net),
63 myCurrentIsInternalToSkip(false),
64 myDetectorBuilder(detBuilder), myTriggerBuilder(triggerBuilder),
65 myEdgeControlBuilder(edgeBuilder), myJunctionControlBuilder(junctionBuilder),
66 myAmParsingTLLogicOrJunction(false), myCurrentIsBroken(false),
67 myHaveWarnedAboutInvalidTLType(false),
68 myHaveSeenInternalEdge(false),
69 myHaveSeenNeighs(false),
70 myHaveSeenAdditionalSpeedRestrictions(false),
73 myNetIsLoaded(false) {
308 if (from ==
nullptr) {
309 WRITE_ERROR(
"Unknown from-node '" + it->second.first +
"' for edge '" + it->first +
"'.");
313 WRITE_ERROR(
"Unknown to-node '" + it->second.second +
"' for edge '" + it->first +
"'.");
316 if (edge !=
nullptr) {
365 WRITE_ERROR(
"Edge '" +
id +
"' has an invalid type.");
394 if (!crossingEdges.empty()) {
395 std::vector<std::string> crossingEdgesVector;
398 crossingEdgesVector.push_back(edges.
next());
448 if (shape.size() < 2) {
449 WRITE_ERROR(
"Shape of lane '" +
id +
"' is broken.\n Can not build according edge.");
454 if (permissions !=
SVCAll) {
464 WRITE_ERROR(
"Another lane with the id '" +
id +
"' exists.");
492 if (shape.size() > 2) {
502 WRITE_ERROR(
"An unknown or invalid junction type occurred in junction '" +
id +
"'.");
507 std::vector<MSLane*> incomingLanes;
510 std::vector<MSLane*> internalLanes;
520 WRITE_ERROR(e.what() + std::string(
"\n Can not build according junction."));
529 const std::string& def, std::vector<MSLane*>& into,
bool& ok) {
532 std::string laneID = st.
next();
537 if (lane ==
nullptr) {
538 WRITE_ERROR(
"An unknown lane ('" + laneID +
"') was tried to be set as incoming to junction '" + junctionID +
"'.");
542 into.push_back(lane);
647 if (request >= 0 && response.length() > 0) {
692 WRITE_ERROR(
"Traffic light '" +
id +
"' has unknown type '" + typeS +
"'.");
744 std::string phaseTypeString;
745 bool transient_notdecisional_bit;
752 transient_notdecisional_bit =
false;
754 if (phaseTypeString.find(
"decisional") != std::string::npos) {
755 transient_notdecisional_bit =
false;
756 }
else if (phaseTypeString.find(
"transient") != std::string::npos) {
757 transient_notdecisional_bit =
true;
759 MsgHandler::getWarningInstance()->
inform(
"SOTL_ATTL_TYPE_DECISIONAL nor SOTL_ATTL_TYPE_TRANSIENT. Assuming phase type as SUMOSOTL_TagAttrDefinitions::SOTL_ATTL_TYPE_TRANSIENT");
760 transient_notdecisional_bit =
false;
762 commit_bit = (phaseTypeString.find(
"commit") != std::string::npos);
764 if (phaseTypeString.find(
"target") != std::string::npos) {
765 std::string delimiter(
" ,;");
773 std::string::size_type firstPos = targetLanesString.find_first_not_of(delimiter, 0);
775 std::string::size_type pos = targetLanesString.find_first_of(delimiter, firstPos);
777 while (std::string::npos != pos || std::string::npos != firstPos) {
779 targetLanesVector.push_back(targetLanesString.substr(firstPos, pos - firstPos));
782 firstPos = targetLanesString.find_first_not_of(delimiter, pos);
785 pos = targetLanesString.find_first_of(delimiter, firstPos);
788 myJunctionControlBuilder.
addPhase(duration, state, nextPhases, minDuration, maxDuration, name, transient_notdecisional_bit, commit_bit, &targetLanesVector);
824 friendlyPos, vTypes);
861 WRITE_WARNING(
"VTypeProbes are deprecated. Use fcd-output devices (assigned to the vType) instead.");
909 const std::string
id = attrs.
get<std::string>(
SUMO_ATTR_ID,
nullptr, ok);
911 const std::string toLane = attrs.
getOpt<std::string>(
SUMO_ATTR_TO,
id.c_str(), ok,
"");
916 const double length = attrs.
getOpt<
double>(
SUMO_ATTR_LENGTH,
id.c_str(), ok, std::numeric_limits<double>::max());
921 WRITE_WARNING(
"Ignoring deprecated argument 'cont' for E2 detector '" +
id +
"'");
927 double endPosition = attrs.
getOpt<
double>(
SUMO_ATTR_ENDPOS,
id.c_str(), ok, std::numeric_limits<double>::max());
933 bool lanesGiven = lanes !=
"";
934 bool laneGiven = lane !=
"";
935 if (!(lanesGiven || laneGiven)) {
937 WRITE_WARNING(
"Trying to specify detector's lane by the given id since the argument 'lane' is missing.")
941 bool lengthGiven = length != std::numeric_limits<double>::max();
942 bool posGiven = position != std::numeric_limits<double>::max();
943 bool endPosGiven = endPosition != std::numeric_limits<double>::max();
944 bool lsaGiven = lsaid !=
"";
945 bool toLaneGiven = toLane !=
"";
948 std::vector<MSLane*> clanes;
951 std::string seps =
" ,\t\n";
955 std::string nextLaneID = st.
next();
957 if (nextLaneID.find_first_of(seps) != nextLaneID.npos) {
961 clanes.push_back(clane);
963 if (clanes.size() == 0) {
964 throw InvalidArgument(
"Malformed argument 'lanes' for E2Detector '" +
id +
"'.\nSpecify 'lanes' as a sequence of lane-IDs seperated by whitespace or comma (',')");
967 WRITE_WARNING(
"Ignoring argument 'lane' for E2Detector '" +
id +
"' since argument 'lanes' was given.\n"
968 "Usage combinations for positional specification: [lane, pos, length], [lane, endPos, length], or [lanes, pos, endPos]");
971 WRITE_WARNING(
"Ignoring argument 'length' for E2Detector '" +
id +
"' since argument 'lanes' was given.\n"
972 "Usage combinations for positional specification: [lane, pos, length], [lane, endPos, length], or [lanes, pos, endPos]");
977 WRITE_WARNING(
"Missing argument 'pos' for E2Detector '" +
id +
"'. Assuming detector start == lane start of lane '" + clanes[0]->getID() +
"'.");
981 endPosition = clanes[clanes.size() - 1]->getLength();
982 WRITE_WARNING(
"Missing argument 'endPos' for E2Detector '" +
id +
"'. Assuming detector end == lane end of lane '" + clanes[clanes.size() - 1]->getID() +
"'.");
987 std::stringstream ss;
988 ss <<
"Missing argument 'lane' for E2Detector '" <<
id <<
"'."
989 <<
"\nUsage combinations for positional specification: [lane, pos, length], [lane, endPos, length], or [lanes, pos, endPos]";
996 if (endPosGiven && lengthGiven) {
997 std::stringstream ss;
998 ss <<
"Ignoring argument 'endPos' for E2Detector '" <<
id <<
"' since argument 'pos' was given."
999 <<
"\nUsage combinations for positional specification: [lane, pos, length], [lane, endPos, length], or [lanes, pos, endPos]";
1001 endPosition = std::numeric_limits<double>::max();
1003 if (!lengthGiven && !endPosGiven) {
1004 std::stringstream ss;
1005 ss <<
"Missing arguments 'length'/'endPos' for E2Detector '" <<
id <<
"'. Assuming detector end == lane end of lane '" << lane <<
"'.";
1009 }
else if (endPosGiven) {
1012 std::stringstream ss;
1013 ss <<
"Missing arguments 'length'/'pos' for E2Detector '" <<
id <<
"'. Assuming detector start == lane start of lane '" << lane <<
"'.";
1017 std::stringstream ss;
1019 ss <<
"Incomplete positional specification for E2Detector '" <<
id <<
"'."
1020 <<
"\nUsage combinations for positional specification: [lane, pos, length], [lane, endPos, length], or [lanes, pos, endPos]";
1025 ss <<
"Missing arguments 'pos'/'endPos' for E2Detector '" <<
id <<
"'. Assuming that the detector covers the whole lane '" << lane <<
"'.";
1047 throw InvalidArgument(
"The detector '" +
id +
"' refers to an unknown lsa '" + lsaid +
"'.");
1049 if (frequency != -1) {
1050 WRITE_WARNING(
"Ignoring argument 'frequency' for E2Detector '" +
id +
"' since argument 'tl' was given.");
1056 MSLane* cToLane =
nullptr;
1062 std::string filename;
1073 haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold,
1074 vTypes, friendlyPos, showDetector,
1079 haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold,
1080 vTypes, friendlyPos, showDetector,
1094 const std::string file = attrs.
get<std::string>(
SUMO_ATTR_FILE,
id.c_str(), ok);
1103 frequency, haltingSpeedThreshold, haltingTimeThreshold, vTypes, openEntry);
1149 const std::string file = attrs.
get<std::string>(
SUMO_ATTR_FILE,
id.c_str(), ok);
1150 const std::string type = attrs.
getOpt<std::string>(
SUMO_ATTR_TYPE,
id.c_str(), ok,
"performance");
1158 int detectPersons = 0;
1163 WRITE_ERROR(
"Invalid person mode '" + mode +
"' in edgeData definition '" +
id +
"'");
1171 excludeEmpty[0] !=
't' && excludeEmpty[0] !=
'T' && excludeEmpty[0] !=
'1' && excludeEmpty[0] !=
'x',
1172 excludeEmpty ==
"defaults", withInternal, trackVehicles, detectPersons,
1173 maxTravelTime, minSamples, haltingSpeedThreshold, vtypes,
1187 const std::string toID = attrs.
get<std::string>(
SUMO_ATTR_TO,
nullptr, ok);
1209 if (from ==
nullptr) {
1210 WRITE_ERROR(
"Unknown from-edge '" + fromID +
"' in connection.");
1214 if (to ==
nullptr) {
1215 WRITE_ERROR(
"Unknown to-edge '" + toID +
"' in connection.");
1218 if (fromLaneIdx < 0 || fromLaneIdx >= (
int)from->getLanes().size() ||
1219 toLaneIdx < 0 || toLaneIdx >= (
int)to->
getLanes().size()) {
1220 WRITE_ERROR(
"Invalid lane index in connection from '" + from->getID() +
"' to '" + to->
getID() +
"'.");
1223 MSLane* fromLane = from->getLanes()[fromLaneIdx];
1234 if ((tlLinkIdx < 0 || tlLinkIdx >= (
int)logic->getCurrentPhaseDef().getState().size())
1238 "' in connection controlled by '" + tlID +
"'");
1250 if (via ==
nullptr) {
1252 "') should be set as a via-lane for lane '" + toLane->
getID() +
"'.");
1259 link =
new MSLink(fromLane, toLane, via, dir, state, length, foeVisibilityDistance, keepClear, logic, tlLinkIdx);
1260 if (via !=
nullptr) {
1323 WRITE_WARNING(
"no valid geo projection loaded from network. fcd-output.geo will not work");
1345 sink->
initialize(
new std::vector<MSLane*>());
1351 source->
initialize(
new std::vector<MSLane*>());
1354 for (std::vector<std::string>::const_iterator i = desc.begin(); i != desc.end(); ++i) {
1357 if (edge ==
nullptr) {
1370 if (shape.size() != 0) {
1371 if (!
myNet.
getShapeContainer().
addPolygon(
myCurrentDistrictID,
"taz", color, 0, 0,
"",
false, shape,
false,
false, 1.0)) {
1392 if (succ !=
nullptr) {
1409 for (std::vector<std::string>::iterator it = edgeIDs.begin(); it != edgeIDs.end(); ++it) {
1411 if (edge ==
nullptr) {
1412 WRITE_ERROR(
"Unknown edge '" + (*it) +
"' in roundabout");
1451 if (lane ==
nullptr) {
1452 WRITE_ERROR(
"Lane '" + laneID +
"' to place poi '" + poiID +
"' on is not known.");
1458 if (lanePos < 0 || lanePos > lane->
getLength()) {
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop)
virtual void openJunction(const SUMOSAXAttributes &attrs)
opens a junction for processing
void addWAUTSwitch(const std::string &wautid, SUMOTime when, const std::string &to)
Adds a WAUT switch step to a previously built WAUT.
void initTrafficLightLogic(const std::string &id, const std::string &programID, TrafficLightType type, SUMOTime offset)
Begins the reading of a traffic lights logic.
bool myHaveSeenInternalEdge
whether the loaded network contains internal lanes
const std::vector< std::string > getStringVector(int attr) const
Tries to read given attribute assuming it is a string vector.
Parameterised myLastEdgeParameters
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SUMO_TAG_STOPOFFSET
Information on vClass specific stop offsets at lane end.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
MSLane * getLaneChecking(const std::string &laneID, SumoXMLTag type, const std::string &detid)
Returns the named lane.
@ SUMO_ATTR_HALTING_SPEED_THRESHOLD
virtual MSLane * addLane(const std::string &id, double maxSpeed, double length, const PositionVector &shape, double width, SVCPermissions permissions, int index, bool isRampAccel, const std::string &type)
Adds a lane to the current edge.
SUMOVehicleClass getVehicleClassID(const std::string &name)
Returns the class id of the abstract class given by its name.
#define WRITE_WARNING(msg)
void addRequest(const SUMOSAXAttributes &attrs)
adds a request item to the current junction logic
static StringBijection< LinkState > LinkStates
link states
Representation of a lane in the micro simulation.
virtual void addNeigh(const std::string id)
Adds a neighbor to the current lane.
@ LINKSTATE_TL_OFF_BLINKING
The link is controlled by a tls which is off and blinks, has to brake.
virtual std::string getString(int id) const =0
Returns the string-value of the named (by its enum-value) attribute.
void parseAndBeginParkingArea(MSNet &net, const SUMOSAXAttributes &attrs)
Parses his values and builds a parking area.
Interface for building edges.
void buildInductLoop(const std::string &id, const std::string &lane, double pos, SUMOTime splInterval, const std::string &device, bool friendlyPos, const std::string &vTypes)
Builds an e1 detector and adds it to the net.
The base class for an intersection.
bool myLefthand
whether the loaded network was built for left hand traffic
ShapeContainer & getShapeContainer()
Returns the shapes container.
void addE3Entry(const std::string &lane, double pos, bool friendlyPos)
Builds an entry point of an e3 detector.
static const Position INVALID
used to indicate that a position is valid
@ SUMO_TAG_PARAM
parameter associated to a certain key
bool hasNext()
returns the information whether further substrings exist
std::string myCurrentDistrictID
The id of the current district.
bool myHaveSeenNeighs
whether the loaded network contains explicit neighbor lanes
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
void addAccess(MSNet &net, const SUMOSAXAttributes &attrs)
Parses the values and adds an access point to the currently parsed stopping place.
const std::vector< int > getOptIntVector(int attr, const char *objectid, bool &ok, bool report=true) const
convenience function to avoid the default argument and the template stuff at getOpt<>
@ SUMO_TAG_TAZSOURCE
a source within a district (connection road)
The simulated network and simulation perfomer.
NLTriggerBuilder & myTriggerBuilder
The trigger builder to use.
@ SUMO_TAG_CONTAINER_STOP
A container stop.
@ SUMO_TAG_LANE_AREA_DETECTOR
alternative tag for e2 detector
void closeJunctionLogic()
Ends the building of a junction logic (row-logic)
virtual void addInstantE1Detector(const SUMOSAXAttributes &attrs)
Builds an e1 detector using the given specification.
void addWAUTJunction(const std::string &wautid, const std::string &tls, const std::string &proc, bool synchron)
Adds a tls to the list of tls to be switched by the named WAUT.
virtual void addRouteProbeDetector(const SUMOSAXAttributes &attrs)
Builds a routeProbe-detector using the given specification.
void beginE3Detector(const SUMOSAXAttributes &attrs)
Starts building of an e3 detector using the given specification.
void setLocation(const SUMOSAXAttributes &attrs)
Parses network location description.
@ SUMO_TAG_LANE
begin/end of the description of a single lane
virtual void inform(std::string msg, bool addType=true)
adds a new error to the list
virtual void addE2Detector(const SUMOSAXAttributes &attrs)
Builds an e2 detector using the given specification.
@ SUMO_ATTR_TLID
link,node: the traffic light id responsible for this link
virtual void addCrossingEdges(const std::vector< std::string > &)
add the crossingEdges in a crossing edge if present
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
void addDistrictEdge(const SUMOSAXAttributes &attrs, bool isSource)
void addParam(const SUMOSAXAttributes &attrs)
void addDistrict(const SUMOSAXAttributes &attrs)
void addOutgoing(MSEdge *edge)
@ SUMO_ATTR_COLOR
A color information.
static OptionsCont & getOptions()
Retrieves the options.
std::string next()
returns the next substring when it exists. Otherwise the behaviour is undefined
static std::string checkForRelativity(const std::string &filename, const std::string &basePath)
Returns the path from a configuration so that it is accessable from the current working directory.
const double SUMO_const_laneWidth
virtual MSEdge * buildEdge(const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, const int priority, const double distance)
Builds an edge instance (MSEdge in this case)
Builds trigger objects for microsim.
@ SUMO_ATTR_VISIBILITY_DISTANCE
foe visibility distance of a link
void setJunctions(MSJunction *from, MSJunction *to)
void addIncoming(MSEdge *edge)
std::vector< std::string > LaneIdVector
@ SUMO_TAG_DET_ENTRY
an e3 entry point
void parseAndAddLotEntry(const SUMOSAXAttributes &attrs)
Parses his values and adds a lot entry to current parking area.
virtual void openWAUT(const SUMOSAXAttributes &attrs)
bool myNetIsLoaded
whether the location element was already loadee
void addPhase(const SUMOSAXAttributes &attrs)
adds a phase to the traffic lights logic currently build
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
std::vector< Parameterised * > myLastParameterised
virtual void closeEdge()
Closes the process of building an edge.
@ SUMO_TAG_PHASE
a single phase description
LinkState parseLinkState(const std::string &state)
Parses the given character into an enumeration typed link state.
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
NLEdgeControlBuilder & myEdgeControlBuilder
The edge builder to use.
@ SUMO_TAG_PARKING_SPACE
A parking space for a single vehicle within a parking area.
void addStopOffsets(const std::map< SVCPermissions, double > &stopOffsets)
process a stopOffset element (originates either from the active edge or lane).
JunctionGraph myJunctionGraph
static bool init(OptionsCont &oc)
Initialises the processing and the final instance using the given options.
const std::string & getActiveSubKey() const
Returns the active sub key.
virtual void myEndElement(int element)
Called when a closing tag occurs.
@ SUMO_ATTR_DIR
The abstract direction of a link.
void addLink(MSLink *link)
Delayed initialization.
static StringBijection< LinkDirection > LinkDirections
link directions
SumoXMLTag
Numbers representing SUMO-XML - element names.
bool myHaveWarnedAboutInvalidTLType
@ SUMO_TAG_MEANDATA_EDGE
an edge based mean data detector
MSTrafficLightLogic * getActive() const
void addConnection(const SUMOSAXAttributes &attrs)
adds a connection
void closeJunction(const std::string &basePath)
Closes (ends) the processing of the current junction.
@ SUMO_ATTR_ORIG_BOUNDARY
@ SUMO_ATTR_EXCLUDE_EMPTY
@ SUMO_ATTR_NEXT
succesor phase index
@ SUMO_ATTR_BEGIN
weights: time range begin
Builder of microsim-junctions and tls.
@ SUMO_ATTR_TRACK_VEHICLES
void parseAndBuildStoppingPlace(MSNet &net, const SUMOSAXAttributes &attrs, const SumoXMLTag element)
Parses the values and builds a stopping places for busses, trains or container vehicles.
void createEdgeLaneMeanData(const std::string &id, SUMOTime frequency, SUMOTime begin, SUMOTime end, const std::string &type, const bool useLanes, const bool withEmpty, const bool printDefaults, const bool withInternal, const bool trackVehicles, const int detectPersons, const double maxTravelTime, const double minSamples, const double haltSpeed, const std::string &vTypes, const std::string &device)
Creates edge based mean data collector using the given specification.
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
NLDiscreteEventBuilder myActionBuilder
A builder for object actions.
virtual void addEdgeLaneMeanData(const SUMOSAXAttributes &attrs, int objecttype)
Builds edge or lane base mean data collector using the given specification.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
@ SUMO_TAG_NEIGH
begin/end of the description of a neighboring lane
int getNumberOfLoadedPhases() const
return the number of phases loaded so far (for error reporting)
MSTLLogicControl::TLSLogicVariants & getTLLogic(const std::string &id) const
Returns a previously build tls logic.
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
void updateParameters(const std::map< std::string, std::string > &mapArg)
Adds or updates all given parameters from the map.
TLSLogicVariants & get(const std::string &id) const
Returns the variants of a named tls.
@ SUMO_TAG_CHARGING_STATION
A Charging Station.
void parseAndBuildLaneSpeedTrigger(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a lane speed trigger.
LinkDirection parseLinkDir(const std::string &dir)
Parses the given character into an enumeration typed link direction.
void addAction(const SUMOSAXAttributes &attrs, const std::string &basePath)
Builds an action and saves it for further use.
void addLink(MSLink *link, MSLane *lane, int pos)
@ SUMO_ATTR_KEEP_CLEAR
Whether vehicles must keep the junction clear.
static const GeoConvHelper & getFinal()
the coordinate transformation for writing the location element and for tracking the original coordina...
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
void closeLane()
Closes the building of a lane; The edge is completely described by now and may not be opened again.
void setPermissionsFound()
Labels the network to contain vehicle class permissions.
static MsgHandler * getWarningInstance()
Returns the instance to add warnings to.
@ SUMO_TAG_VSS
A variable speed sign.
void beginEdgeParsing(const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, int priority, const std::string &bidi, double distance)
Begins building of an MSEdge.
@ SUMO_TAG_REQUEST
description of a logic request within the junction
virtual void closeTrafficLightLogic(const std::string &basePath)
Ends the building of a traffic lights logic.
SumoXMLNodeType
Numbers representing special SUMO-XML-attribute values for representing node- (junction-) types used ...
T get(const std::string &str) const
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....
std::string myCurrentWAUTID
The id of the currently processed WAUT.
virtual void addE1Detector(const SUMOSAXAttributes &attrs)
Builds an e1 detector using the given specification.
NLJunctionControlBuilder & myJunctionControlBuilder
The junction builder to use.
void closePolygon()
ensures that the last position equals the first
static RGBColor parseColor(std::string coldef)
Parses a color information.
void initialize(const std::vector< MSLane * > *lanes)
Initialize the edge.
NLHandler(const std::string &file, MSNet &net, NLDetectorBuilder &detBuilder, NLTriggerBuilder &triggerBuilder, NLEdgeControlBuilder &edgeBuilder, NLJunctionControlBuilder &junctionBuilder)
Constructor.
@ SUMO_ATTR_EDGES
the edges of a route
A class that stores a 2D geometrical boundary.
void addWAUT(SUMOTime refTime, const std::string &id, const std::string &startProg)
Adds a WAUT definition.
@ SUMO_TAG_PARKING_AREA
A parking area.
double getLength() const
Returns the lane's length.
void openJunction(const std::string &id, const std::string &key, const SumoXMLNodeType type, const Position pos, const PositionVector &shape, const std::vector< MSLane * > &incomingLanes, const std::vector< MSLane * > &internalLanes)
Begins the processing of the named junction.
virtual void myEndElement(int element)
Called when a closing tag occurs.
@ SUMO_ATTR_SHOW_DETECTOR
@ SUMO_TAG_EDGE
begin/end of the description of an edge
void addLane(const SUMOSAXAttributes &attrs)
adds a lane to the previously opened edge
static StringBijection< PersonMode > PersonModeValues
person modes
A point in 2D or 3D with translation and scaling methods.
virtual ~NLHandler()
Destructor.
MSJunction * retrieve(const std::string id)
try to retrieve junction by id
void addApproachingLane(MSLane *lane, bool warnMultiCon)
A road/street connecting two junctions.
@ SUMO_TAG_REROUTER
A rerouter.
void buildInstantInductLoop(const std::string &id, const std::string &lane, double pos, const std::string &device, bool friendlyPos, const std::string &vTypes)
Builds an instantenous induction and adds it to the net.
void addWAUTJunction(const SUMOSAXAttributes &attrs)
void addParam(const std::string &key, const std::string &value)
Adds a parameter.
The parent class for traffic light logics.
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.
@ SUMO_TAG_MEANDATA_LANE
a lane based mean data detector
MSStoppingPlace * getCurrentStop()
bool myCurrentIsInternalToSkip
Information whether the currently parsed edge is internal and not wished, here.
virtual void endStoppingPlace()
End a stopping place.
void beginE3Detector(const std::string &id, const std::string &device, SUMOTime splInterval, double haltingSpeedThreshold, SUMOTime haltingTimeThreshold, const std::string &vTypes, bool openEntry)
Stores temporary the initial information about an e3 detector to build.
@ SUMO_ATTR_TIME
trigger: the time of the step
SUMOTime string2time(const std::string &r)
@ SUMO_ATTR_DETECT_PERSONS
void endE3Detector()
Builds of an e3 detector using collected values.
MSTLLogicControl & getTLLogicControlToUse() const
Returns the used tls control.
MSNet & myNet
The net to fill (preinitialised)
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
@ SUMO_TAG_RESTRICTION
begin/end of the description of an edge restriction
@ SUMO_TAG_TLLOGIC
a traffic light logic
@ SUMO_TAG_TAZ
a traffic assignment zone
virtual bool addPolygon(const std::string &id, const std::string &type, const RGBColor &color, double layer, double angle, const std::string &imgFile, bool relativePath, const PositionVector &shape, bool geo, bool fill, double lineWidth, bool ignorePruning=false)
Builds a polygon using the given values and adds it to the container.
void buildE2Detector(const std::string &id, MSLane *lane, double pos, double endPos, double length, const std::string &device, SUMOTime frequency, SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, const std::string &vTypes, bool friendlyPos, bool showDetector, MSTLLogicControl::TLSLogicVariants *tlls=0, MSLane *toLane=0)
Builds a new E2 detector and adds it to the net's detector control. Also performs some consistency ch...
void addIncomingLane(MSLane *lane, MSLink *viaLink)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void addE3Entry(const SUMOSAXAttributes &attrs)
Adds an entry to the currently processed e3 detector.
NLDetectorBuilder & myDetectorBuilder
The detector builder to use.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_ENTRY_EXIT_DETECTOR
alternative tag for e3 detector
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
@ SUMO_TAG_TAZSINK
a sink within a district (connection road)
const PositionVector & getShape() const
Returns this lane's shape.
@ SUMO_ATTR_STATE
The state of a link.
void closeWAUT(const std::string &wautid)
Closes loading of a WAUT.
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.
std::string myCurrentTypeID
The id of the currently processed edge type.
@ SUMO_ATTR_HALTING_TIME_THRESHOLD
void initJunctionLogic(const SUMOSAXAttributes &attrs)
begins the reading of a junction row logic
virtual void addVTypeProbeDetector(const SUMOSAXAttributes &attrs)
Builds a vtype-detector using the given specification.
@ SUMO_ATTR_TLLINKINDEX
link: the index of the link within the traffic light
@ SUMO_ATTR_CONV_BOUNDARY
void ignoreLinkIndex(int pos)
@ SUMO_TAG_NET
root element of a network file
const std::string & getFileName() const
returns the current file name
@ SUMO_TAG_VAPORIZER
vaporizer of vehicles
Position getLanePos(const std::string &poiID, const std::string &laneID, double lanePos, double lanePosLat)
get position for a given laneID (Has to be implemented in all child)
@ SUMO_ATTR_WITH_INTERNAL
void addPhase(SUMOTime duration, const std::string &state, const std::vector< int > &nextPhases, SUMOTime min, SUMOTime max, const std::string &name)
Adds a phase to the currently built traffic lights logic.
const SVCPermissions SVCAll
all VClasses are allowed
@ SUMO_ATTR_MAX_TRAVELTIME
virtual void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
virtual SumoXMLNodeType getNodeType(bool &ok) const =0
Returns the value of the named attribute.
Parser and container for routes during their loading.
std::string getCurrentE3ID() const
Returns the id of the currently built e3 detector.
@ SUMO_TAG_TIMEDEVENT
The definition of a periodic event.
@ SUMO_TAG_CONNECTION
connectio between two lanes
std::map< SVCPermissions, double > parseStopOffsets(const SUMOSAXAttributes &attrs, bool &ok)
Extract stopOffsets from attributes of stopOffset element.
void initJunctionLogic(const std::string &id)
Initialises a junction logic.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
static StringBijection< TrafficLightType > TrafficLightTypes
traffic light types
@ SUMO_TAG_ROUTEPROBE
a routeprobe detector
Storage for all programs of a single tls.
void beginEdgeParsing(const SUMOSAXAttributes &attrs)
begins the processing of an edge
virtual void endE3Detector()
Builds of an e3 detector using collected values.
@ SUMO_ATTR_JAM_DIST_THRESHOLD
void clearParameter()
Clears the parameter map.
@ SUMO_ATTR_MAXDURATION
maximum duration of a phase
std::vector< std::string > getVector()
return vector of strings
void parseAndBuildChargingStation(MSNet &net, const SUMOSAXAttributes &attrs)
Parses his values and builds a charging station.
@ SUMO_TAG_E3DETECTOR
an e3 detector
virtual void endParkingArea()
End a parking area.
void initTrafficLightLogic(const SUMOSAXAttributes &attrs)
begins the reading of a traffic lights logic
std::string reportCurrentEdgeOrLane() const
Return info about currently processed edge or lane.
void buildVTypeProbe(const std::string &id, const std::string &vtype, SUMOTime frequency, const std::string &device)
Builds a vTypeProbe and adds it to the net.
virtual MSEdge * closeEdge()
Closes the building of an edge; The edge is completely described by now and may not be opened again.
@ SUMO_ATTR_END
weights: time range end
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
void parseAndBuildRerouter(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a rerouter.
static std::string getJunctionIDFromInternalEdge(const std::string internalEdge)
return the junction id when given an edge of type internal, crossing or WalkingArea
void addE3Exit(const std::string &lane, double pos, bool friendlyPos)
Builds an exit point of an e3 detector.
@ SUMO_ATTR_CROSSING_EDGES
the edges crossed by a pedestrian crossing
void addRestriction(const std::string &id, const SUMOVehicleClass svc, const double speed)
Adds a restriction for an edge type.
virtual SumoXMLEdgeFunc getEdgeFunc(bool &ok) const =0
Returns the value of the named attribute.
virtual std::string getStringSecure(int id, const std::string &def) const =0
Returns the string-value of the named (by its enum-value) attribute.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
@ SUMO_TAG_ROUNDABOUT
roundabout defined in junction
@ SUMO_TAG_ACCESS
An access point for a train stop.
@ SUMO_TAG_INDUCTION_LOOP
alternative tag for e1 detector
bool myAmParsingTLLogicOrJunction
internal information whether a tls-logic is currently read
void buildVaporizer(const SUMOSAXAttributes &attrs)
Builds a vaporization.
@ SUMO_TAG_CALIBRATOR
A calibrator placed over edge.
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...
@ SUMO_TAG_E1DETECTOR
an e1 detector
Encapsulated SAX-Attributes.
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
const std::string & getID() const
Returns the id.
@ SUMO_TAG_E2DETECTOR
an e2 detector
void addWAUTSwitch(const SUMOSAXAttributes &attrs)
@ SUMO_TAG_DET_EXIT
an e3 exit point
bool myHaveSeenAdditionalSpeedRestrictions
whether additional files contained type-specific speed limits
double myNetworkVersion
the loaded network version
Builds detectors for microsim.
const std::string & getActiveKey() const
Returns the active key.
void buildRouteProbe(const std::string &id, const std::string &edge, SUMOTime frequency, SUMOTime begin, const std::string &device, const std::string &vTypes)
Builds a routeProbe and adds it to the net.
@ SUMO_TAG_INSTANT_INDUCTION_LOOP
An instantenous induction loop.
void addLogicItem(int request, const std::string &response, const std::string &foes, bool cont)
Adds a logic item.
void parseLanes(const std::string &junctionID, const std::string &def, std::vector< MSLane * > &into, bool &ok)
void parseAndBuildCalibrator(MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
Parses his values and builds a mesoscopic or microscopic calibrator.
@ SUMO_TAG_JUNCTION
begin/end of the description of a junction
void addRoundabout(const SUMOSAXAttributes &attrs)
@ SUMO_TAG_VTYPEPROBE
a vtypeprobe detector
void addE3Exit(const SUMOSAXAttributes &attrs)
Adds an exit to the currently processed e3 detector.