Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
NLTriggerBuilder Class Reference

Builds trigger objects for microsim. More...

#include <NLTriggerBuilder.h>

Inheritance diagram for NLTriggerBuilder:
[legend]
Collaboration diagram for NLTriggerBuilder:
[legend]

Public Member Functions

void buildVaporizer (const SUMOSAXAttributes &attrs)
 Builds a vaporization.
 
 NLTriggerBuilder ()
 Constructor.
 
void setHandler (NLHandler *handler)
 Sets the parent handler to use for nested parsing.
 
virtual ~NLTriggerBuilder ()
 Destructor.
 
parsing methods

These methods parse the attributes for each of the described trigger and call the according methods to build the trigger

void parseAndBuildLaneSpeedTrigger (MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
 Parses his values and builds a lane speed trigger.
 
void parseAndBuildRerouter (MSNet &net, const SUMOSAXAttributes &attrs)
 Parses his values and builds a rerouter.
 
void parseAndBuildStoppingPlace (MSNet &net, const SUMOSAXAttributes &attrs, const SumoXMLTag element)
 Parses the values and builds a stopping places for busses, trains or container vehicles.
 
virtual void beginParkingArea (MSNet &net, const std::string &id, const std::vector< std::string > &lines, const std::vector< std::string > &badges, MSLane *lane, double frompos, double topos, unsigned int capacity, double width, double length, double angle, const std::string &name, bool onRoad, const std::string &departPos, bool lefthand)
 Begin a parking area.
 
void addLotEntry (double x, double y, double z, double width, double length, double angle, double slope)
 Add a lot entry to current parking area.
 
void addAccess (MSNet &net, const SUMOSAXAttributes &attrs)
 Parses the values and adds an access point to the currently parsed stopping place.
 
void parseAndBeginParkingArea (MSNet &net, const SUMOSAXAttributes &attrs)
 Parses his values and builds a parking area.
 
void parseAndAddLotEntry (const SUMOSAXAttributes &attrs)
 Parses his values and adds a lot entry to current parking area.
 
virtual void endParkingArea ()
 End a parking area.
 
virtual void endStoppingPlace ()
 End a stopping place.
 
void parseAndBuildChargingStation (MSNet &net, const SUMOSAXAttributes &attrs)
 Parses his values and builds a charging station.
 
void parseAndBuildOverheadWireSegment (MSNet &net, const SUMOSAXAttributes &attrs)
 Parses its values and builds an overhead wire segment.
 
void parseAndBuildOverheadWireSection (MSNet &net, const SUMOSAXAttributes &attrs)
 Parses its values and builds an overhead wire section.
 
void parseAndBuildTractionSubstation (MSNet &net, const SUMOSAXAttributes &attrs)
 Parses its values and builds a traction substation.
 
void parseAndBuildOverheadWireClamp (MSNet &net, const SUMOSAXAttributes &attrs)
 Parses its values and builds an overhead wire clamp.
 
void parseAndBuildCalibrator (MSNet &net, const SUMOSAXAttributes &attrs, const std::string &base)
 Parses his values and builds a mesoscopic or microscopic calibrator.
 
void updateParkingAreaDefaultCapacity ()
 updates the parkingArea default capacity
 
MSStoppingPlacegetCurrentStop ()
 

Protected Member Functions

building methods

Called with parsed values, these methods build the trigger.

These methods should be overriden for the gui loader in order to build visualizable versions of the triggers.

In most cases, these methods only call the constructor.

virtual MSLaneSpeedTriggerbuildLaneSpeedTrigger (MSNet &net, const std::string &id, const std::vector< MSLane * > &destLanes, const std::string &file)
 Builds a lane speed trigger.
 
virtual void buildStoppingPlace (MSNet &net, std::string id, std::vector< std::string > lines, MSLane *lane, double frompos, double topos, const SumoXMLTag element, std::string string, int personCapacity, double parkingLength, RGBColor &color)
 Builds a stopping place.
 
virtual void buildChargingStation (MSNet &net, const std::string &id, MSLane *lane, double frompos, double topos, const std::string &name, double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, std::string chargeType, SUMOTime waitingTime, MSParkingArea *parkingArea)
 Builds a charging station.
 
virtual void buildOverheadWireSegment (MSNet &net, const std::string &id, MSLane *lane, double frompos, double topos, bool voltageSource)
 Builds an overhead wire segment.
 
void buildInnerOverheadWireSegments (MSNet &net, const MSLane *connection, const MSLane *frontConnection, const MSLane *behindConnection)
 Builds an overhead wire inner segments.
 
void buildTractionSubstation (MSNet &net, std::string id, double voltage, double currentLimit)
 Builds a traction substation.
 
virtual void buildOverheadWireClamp (MSNet &net, const std::string &id, MSLane *lane_start, MSLane *lane_end)
 
virtual MSCalibratorbuildCalibrator (const std::string &id, MSEdge *edge, MSLane *lane, MSJunction *node, double pos, const std::string &file, const std::string &outfile, const SUMOTime freq, const MSRouteProbe *probe, const double invalidJamThreshold, const std::string &vTypes, const bool local)
 builds a microscopic calibrator
 
virtual METriggeredCalibratorbuildMECalibrator (const std::string &id, MSEdge *edge, double pos, const std::string &file, const std::string &outfile, const SUMOTime freq, MSRouteProbe *probe, const double invalidJamThreshold, const std::string &vTypes)
 builds a mesoscopic calibrator
 
virtual MSTriggeredRerouterbuildRerouter (MSNet &net, const std::string &id, MSEdgeVector &edges, double prob, bool off, bool optional, SUMOTime timeThreshold, const std::string &vTypes, const Position &pos, const double radius)
 builds an rerouter
 
helper method for obtaining and checking values
std::string getFileName (const SUMOSAXAttributes &attrs, const std::string &base, const bool allowEmpty=false)
 Helper method to obtain the filename.
 
MSLanegetLane (const SUMOSAXAttributes &attrs, const std::string &tt, const std::string &tid)
 Returns the lane defined by attribute "lane".
 
MSParkingAreagetParkingArea (const SUMOSAXAttributes &attrs, const std::string &tt, const std::string &tid)
 Returns the parking area defined by attribute "parkingArea".
 
double getPosition (const SUMOSAXAttributes &attrs, MSLane *lane, const std::string &tt, const std::string &tid, MSEdge *edge=0)
 returns the position on the lane checking it
 

Protected Attributes

MSStoppingPlacemyCurrentStop
 The currently parsed stop to add access points to.
 
NLHandlermyHandler
 The parent handler to set for subhandlers.
 
bool myHaveWarnedAboutEigen = false
 
MSParkingAreamyParkingArea
 definition of the currently parsed parking area
 
bool myParkingAreaCapacitySet = false
 

Detailed Description

Builds trigger objects for microsim.

The building methods may be overridden, to build guisim-instances of the triggers, for example.

Definition at line 60 of file NLTriggerBuilder.h.

Constructor & Destructor Documentation

◆ NLTriggerBuilder()

NLTriggerBuilder::NLTriggerBuilder ( )

Constructor.

Definition at line 60 of file NLTriggerBuilder.cpp.

◆ ~NLTriggerBuilder()

NLTriggerBuilder::~NLTriggerBuilder ( )
virtual

Destructor.

Definition at line 64 of file NLTriggerBuilder.cpp.

Member Function Documentation

◆ addAccess()

void NLTriggerBuilder::addAccess ( MSNet net,
const SUMOSAXAttributes attrs 
)

Parses the values and adds an access point to the currently parsed stopping place.

Parameters
[in]netThe network the stop belongs to
[in]attrsSAX-attributes which define the access
Exceptions
InvalidArgumentIf a parameter (lane/position) is not valid

Definition at line 526 of file NLTriggerBuilder.cpp.

References MSStoppingPlace::addAccess(), MSLane::allowsVehicleClass(), MSStoppingPlace::CARRIAGE, SUMORouteHandler::checkStopPos(), MSStoppingPlace::DOORS, Named::getID(), getLane(), MSLane::getLength(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::getString(), myCurrentStop, myHandler, MSStoppingPlace::PLATFORM, SUMORouteHandler::STOPPOS_VALID, SUMO_ATTR_FRIENDLY_POS, SUMO_ATTR_LENGTH, SUMO_ATTR_POSITION, SVC_PEDESTRIAN, TL, and WRITE_WARNINGF.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ addLotEntry()

void NLTriggerBuilder::addLotEntry ( double  x,
double  y,
double  z,
double  width,
double  length,
double  angle,
double  slope 
)

Add a lot entry to current parking area.

Simply calls the addLotEntry method for current parking area.

Parameters
[in]xX position of the lot center
[in]yY position of the lot center
[in]zZ position of the lot center
[in]widthWidth of the lot rectangle
[in]lengthLength of the lot rectangle
[in]angleAngle of the lot rectangle
[in]slopeSlope of the lot rectangle
Exceptions
InvalidArgumentIf the current parking area is 0

Definition at line 839 of file NLTriggerBuilder.cpp.

References MSParkingArea::addLotEntry(), myParkingArea, myParkingAreaCapacitySet, and MSParkingArea::parkOnRoad().

Referenced by parseAndAddLotEntry().

Here is the caller graph for this function:

◆ beginParkingArea()

void NLTriggerBuilder::beginParkingArea ( MSNet net,
const std::string &  id,
const std::vector< std::string > &  lines,
const std::vector< std::string > &  badges,
MSLane lane,
double  frompos,
double  topos,
unsigned int  capacity,
double  width,
double  length,
double  angle,
const std::string &  name,
bool  onRoad,
const std::string &  departPos,
bool  lefthand 
)
virtual

Begin a parking area.

Simply calls the MSParkingArea constructor.

Parameters
[in]netThe net the parking area belongs to
[in]idThe id of the parking area
[in]linesNames of the lines that halt on this parking area
[in]badgesNames which grant access to this parking area
[in]laneThe lane the parking area is placed on
[in]fromposBegin position of the parking area on the lane
[in]toposEnd position of the parking area on the lane
[in]capacityCapacity of the parking area
[in]widthWidth of the default lot rectangle
[in]lengthLength of the default lot rectangle
[in]angleAngle of the default lot rectangle
Exceptions
InvalidArgumentIf the parking area can not be added to the net (is duplicate)

Reimplemented in GUITriggerBuilder.

Definition at line 818 of file NLTriggerBuilder.cpp.

References MSNet::addStoppingPlace(), myParkingArea, and SUMO_TAG_PARKING_AREA.

Referenced by parseAndBeginParkingArea().

Here is the caller graph for this function:

◆ buildCalibrator()

MSCalibrator * NLTriggerBuilder::buildCalibrator ( const std::string &  id,
MSEdge edge,
MSLane lane,
MSJunction node,
double  pos,
const std::string &  file,
const std::string &  outfile,
const SUMOTime  freq,
const MSRouteProbe probe,
const double  invalidJamThreshold,
const std::string &  vTypes,
const bool  local 
)
protectedvirtual

builds a microscopic calibrator

Simply calls the MSCalibrator constructor.

Parameters
[in]idThe id of the calibrator
[in]edgeThe edge the calibrator is placed at
[in]laneThe lane the calibrator is placed at if it is lane specific, nullptr otherwise
[in]posThe position on the edge the calibrator lies at
[in]fileThe file to read the flows from
[in]outfileThe file to write calibrator statistics to
[in]freqThe frequency for the statistics output
[in]probean optional route probe to get distributions from
[in]invalidJamThresholdstop calibrating if the relative speed drops below the threshold
[in]vTypesto which vehicle types the calibrator applies
Todo:
Is the position correct/needed

Definition at line 778 of file NLTriggerBuilder.cpp.

References MSEdge::getLength().

Referenced by parseAndBuildCalibrator().

Here is the caller graph for this function:

◆ buildChargingStation()

void NLTriggerBuilder::buildChargingStation ( MSNet net,
const std::string &  id,
MSLane lane,
double  frompos,
double  topos,
const std::string &  name,
double  chargingPower,
double  efficiency,
bool  chargeInTransit,
SUMOTime  chargeDelay,
std::string  chargeType,
SUMOTime  waitingTime,
MSParkingArea parkingArea 
)
protectedvirtual

Builds a charging station.

Simply calls the MSChargingStation constructor and adds the result to the network.

Parameters
[in]netThe net the charging station belongs to
[in]idThe id of the charging station
[in]laneThe lane the charging station is placed on
[in]fromposBegin position of the charging station on the lane
[in]toposEnd position of the charging station on the lane
[in]chargingPowerenergy charged in every timeStep
[in]efficiencyefficiency of the charge
[in]chargeInTransitenable or disable charge in transit
[in]chargeDelaydelay in the charge
[in]chargeTypecharge type (normal, electric or fuel)
[in]waitingTimewaiting time until start charging
[in]parkingAreaThe associated parking area
Exceptions
InvalidArgumentIf the charging station can not be added to the net (is duplicate)

Reimplemented in GUITriggerBuilder.

Definition at line 877 of file NLTriggerBuilder.cpp.

References MSNet::addStoppingPlace(), myCurrentStop, and SUMO_TAG_CHARGING_STATION.

Referenced by parseAndBuildChargingStation().

Here is the caller graph for this function:

◆ buildInnerOverheadWireSegments()

void NLTriggerBuilder::buildInnerOverheadWireSegments ( MSNet net,
const MSLane connection,
const MSLane frontConnection,
const MSLane behindConnection 
)
protected

Builds an overhead wire inner segments.

Simply calls the buildOverheadWireSegment for inner edges connection, frontConnection and behindConnection if exists.

Parameters
[in]netThe net the overhead wire inner segments belongs to
[in]connectionThe inner lane that connects two regular lanes, or a regular lane with the inner "behindConnection" lane, or the inner "frontConnection" lane with a regular lane, or the inner "frontConnection" lane with the inner "behindConnection" lane
[in]frontConnectionThe inner lane that connects a regular lane with the inner "connection" lane
[in]behindConnectionThe inner lane that connects the inner "connection" lane with a regular lane
Exceptions
InvalidArgumentIf the over can not be added to the net (is duplicate according to the id)

Definition at line 902 of file NLTriggerBuilder.cpp.

References buildOverheadWireSegment(), Named::getID(), and MSLane::getLength().

Referenced by parseAndBuildOverheadWireSection().

Here is the caller graph for this function:

◆ buildLaneSpeedTrigger()

MSLaneSpeedTrigger * NLTriggerBuilder::buildLaneSpeedTrigger ( MSNet net,
const std::string &  id,
const std::vector< MSLane * > &  destLanes,
const std::string &  file 
)
protectedvirtual

Builds a lane speed trigger.

Simply calls the MSLaneSpeedTrigger constructor.

Parameters
[in]netThe net the lane speed trigger belongs to
[in]idThe id of the lane speed trigger
[in]destLanesList of lanes affected by this speed trigger
[in]fileName of the file to read the speeds to set from
See also
MSLaneSpeedTrigger
Exceptions
ProcessErrorIf the XML definition file is errornous

Reimplemented in GUITriggerBuilder.

Definition at line 754 of file NLTriggerBuilder.cpp.

Referenced by parseAndBuildLaneSpeedTrigger().

Here is the caller graph for this function:

◆ buildMECalibrator()

METriggeredCalibrator * NLTriggerBuilder::buildMECalibrator ( const std::string &  id,
MSEdge edge,
double  pos,
const std::string &  file,
const std::string &  outfile,
const SUMOTime  freq,
MSRouteProbe probe,
const double  invalidJamThreshold,
const std::string &  vTypes 
)
protectedvirtual

builds a mesoscopic calibrator

Simply calls the METriggeredCalibrator constructor.

Parameters
[in]idThe id of the calibrator
[in]edgeThe edge the calibrator is placed at
[in]posThe position on the edge the calibrator lies at
[in]fileThe file to read the flows from
[in]outfileThe file to write calibrator statistics to
[in]freqThe frequency for the statistics output
[in]probean optional route probe to get distributions from
[in]invalidJamThresholdstop calibrating if the relative speed drops below the threshold
[in]vTypesto which vehicle types the calibrator applies
Todo:
Is the position correct/needed

Definition at line 762 of file NLTriggerBuilder.cpp.

References MESegment::getLength(), MELoop::getSegmentForEdge(), and MSGlobals::gMesoNet.

Referenced by parseAndBuildCalibrator().

Here is the caller graph for this function:

◆ buildOverheadWireClamp()

void NLTriggerBuilder::buildOverheadWireClamp ( MSNet net,
const std::string &  id,
MSLane lane_start,
MSLane lane_end 
)
protectedvirtual

Reimplemented in GUITriggerBuilder.

Definition at line 928 of file NLTriggerBuilder.cpp.

Referenced by parseAndBuildOverheadWireSection().

Here is the caller graph for this function:

◆ buildOverheadWireSegment()

void NLTriggerBuilder::buildOverheadWireSegment ( MSNet net,
const std::string &  id,
MSLane lane,
double  frompos,
double  topos,
bool  voltageSource 
)
protectedvirtual

Builds an overhead wire segment.

Simply calls the MSOverheadWire constructor and adds the result to the network.

Parameters
[in]netThe net the overhead wire segment belongs to
[in]idThe id of the overhead wire segment
[in]laneThe lane the overhead wire segment is placed on
[in]fromposBegin position of the overhead wire segment on the lane
[in]toposEnd position of the overhead wire segment on the lane
[in]voltageSourcedefault voltage of overhead wire segment (unused) TODORICE
Exceptions
InvalidArgumentIf the overhead wire segment can not be added to the net (is duplicate according to the id)

Reimplemented in GUITriggerBuilder.

Definition at line 892 of file NLTriggerBuilder.cpp.

References MSNet::addStoppingPlace(), and SUMO_TAG_OVERHEAD_WIRE_SEGMENT.

Referenced by buildInnerOverheadWireSegments(), and parseAndBuildOverheadWireSegment().

Here is the caller graph for this function:

◆ buildRerouter()

MSTriggeredRerouter * NLTriggerBuilder::buildRerouter ( MSNet net,
const std::string &  id,
MSEdgeVector edges,
double  prob,
bool  off,
bool  optional,
SUMOTime  timeThreshold,
const std::string &  vTypes,
const Position pos,
const double  radius 
)
protectedvirtual

builds an rerouter

Simply calls the MSTriggeredRerouter constructor.

Parameters
[in]netThe net the rerouter belongs to
[in]idThe id of the rerouter
[in]edgesThe edges the rerouter is placed at
[in]probThe probability the rerouter reoutes vehicles with

Reimplemented in GUITriggerBuilder.

Definition at line 797 of file NLTriggerBuilder.cpp.

Referenced by parseAndBuildRerouter().

Here is the caller graph for this function:

◆ buildStoppingPlace()

void NLTriggerBuilder::buildStoppingPlace ( MSNet net,
std::string  id,
std::vector< std::string >  lines,
MSLane lane,
double  frompos,
double  topos,
const SumoXMLTag  element,
std::string  string,
int  personCapacity,
double  parkingLength,
RGBColor color 
)
protectedvirtual

Builds a stopping place.

Simply calls the MSStoppingPlace constructor.

Parameters
[in]netThe net the stop belongs to
[in]idThe id of the stop
[in]linesNames of the lines that halt on this bus stop
[in]laneThe lane the stop is placed on
[in]fromposBegin position of the stop on the lane
[in]toposEnd position of the stop on the lane
[in]elementwhich kind of stop is to be built
Exceptions
InvalidArgumentIf the stop can not be added to the net (is duplicate)

Reimplemented in GUITriggerBuilder.

Definition at line 805 of file NLTriggerBuilder.cpp.

References MSNet::addStoppingPlace(), myCurrentStop, and toString().

Referenced by parseAndBuildStoppingPlace().

Here is the caller graph for this function:

◆ buildTractionSubstation()

void NLTriggerBuilder::buildTractionSubstation ( MSNet net,
std::string  id,
double  voltage,
double  currentLimit 
)
protected

Builds a traction substation.

Simply calls the MSTractionSubstaion cosnstructor and adds the substation to the list of substations in the net.

Parameters
[in]netThe net the traction substation belongs to
[in]idThe id of the traction substation
[in]voltageThe voltage level of the voltage source representing the traction substation
[in]currentLimitThe electric current limit(max current flowing from(through) the traction substation)
Exceptions
InvalidArgumentIf the over can not be added to the net (is duplicate according to the id)

Definition at line 919 of file NLTriggerBuilder.cpp.

References MSNet::addTractionSubstation().

Referenced by parseAndBuildTractionSubstation().

Here is the caller graph for this function:

◆ buildVaporizer()

void NLTriggerBuilder::buildVaporizer ( const SUMOSAXAttributes attrs)

Builds a vaporization.

Parses the attributes, reporting errors if the time values are false or the edge is not known. Instatiates events for enabling and disabling the vaporization otherwise.

Parameters
[in]attrsSAX-attributes which define the vaporizer
Note
recheck throwing the exception

Definition at line 73 of file NLTriggerBuilder.cpp.

References MSEventControl::addEvent(), MSEdge::decVaporization(), MSEdge::dictionary(), SUMOSAXAttributes::get(), MSNet::getBeginOfTimestepEvents(), MSNet::getInstance(), OptionsCont::getOptions(), SUMOSAXAttributes::getSUMOTimeReporting(), MSEdge::incVaporization(), string2time(), SUMO_ATTR_BEGIN, SUMO_ATTR_END, SUMO_ATTR_ID, TL, WRITE_ERRORF, and WRITE_WARNING.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ endParkingArea()

void NLTriggerBuilder::endParkingArea ( )
virtual

End a parking area.

Exceptions
InvalidArgumentIf the current parking area is 0

Reimplemented in GUITriggerBuilder.

Definition at line 856 of file NLTriggerBuilder.cpp.

References myParkingArea, and myParkingAreaCapacitySet.

Referenced by NLHandler::myEndElement().

Here is the caller graph for this function:

◆ endStoppingPlace()

void NLTriggerBuilder::endStoppingPlace ( )
virtual

End a stopping place.

Exceptions
InvalidArgumentIf the current stopping place is 0

Reimplemented in GUITriggerBuilder.

Definition at line 867 of file NLTriggerBuilder.cpp.

References myCurrentStop.

Referenced by NLHandler::myEndElement().

Here is the caller graph for this function:

◆ getCurrentStop()

MSStoppingPlace * NLTriggerBuilder::getCurrentStop ( )

Definition at line 1030 of file NLTriggerBuilder.cpp.

References myCurrentStop, and myParkingArea.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ getFileName()

std::string NLTriggerBuilder::getFileName ( const SUMOSAXAttributes attrs,
const std::string &  base,
const bool  allowEmpty = false 
)
protected

Helper method to obtain the filename.

Retrieves "file" from attributes, checks whether it is absolute and extends it by the given base path if not. Returns this information.

Parameters
[in]attrsThe attributes to obtain the file name from
[in]baseThe base path (the path the loaded additional file lies in)
Returns
The (expanded) path to the named file
Todo:
Recheck usage of the helper class

Definition at line 932 of file NLTriggerBuilder.cpp.

References FileHelpers::getConfigurationRelative(), SUMOSAXAttributes::getOpt(), FileHelpers::isAbsolute(), and SUMO_ATTR_FILE.

Referenced by parseAndBuildCalibrator(), and parseAndBuildLaneSpeedTrigger().

Here is the caller graph for this function:

◆ getLane()

MSLane * NLTriggerBuilder::getLane ( const SUMOSAXAttributes attrs,
const std::string &  tt,
const std::string &  tid 
)
protected

Returns the lane defined by attribute "lane".

Retrieves the lane id from the given attrs. Tries to retrieve the lane, throws an InvalidArgument if it does not exist.

Parameters
[in]attrsThe attributes to obtain the lane id from
[in]ttThe trigger type (for user output)
[in]tidThe trigger id (for user output)
Returns
The named lane if it is known
Exceptions
InvalidArgumentIf the named lane does not exist or a lane is not named

Definition at line 953 of file NLTriggerBuilder.cpp.

References MSLane::dictionary(), SUMOSAXAttributes::get(), MSGlobals::gUsingInternalLanes, and SUMO_ATTR_LANE.

Referenced by addAccess(), parseAndBeginParkingArea(), parseAndBuildCalibrator(), parseAndBuildChargingStation(), parseAndBuildOverheadWireSegment(), and parseAndBuildStoppingPlace().

Here is the caller graph for this function:

◆ getParkingArea()

MSParkingArea * NLTriggerBuilder::getParkingArea ( const SUMOSAXAttributes attrs,
const std::string &  tt,
const std::string &  tid 
)
protected

Returns the parking area defined by attribute "parkingArea".

Retrieves the parking area id from the given attrs. Tries to retrieve the parking area, throws an InvalidArgument if it does not exist.

Parameters
[in]attrsThe attributes to obtain the parking area id from
[in]ttThe trigger type (for user output)
[in]tidThe trigger id (for user output)
Returns
The named parking area if it is known, nullptr if empty ID is given
Exceptions
InvalidArgumentIf the named parking area does not exist

Definition at line 974 of file NLTriggerBuilder.cpp.

References MSNet::getInstance(), SUMOSAXAttributes::getOpt(), MSNet::getStoppingPlace(), SUMO_ATTR_PARKING_AREA, and SUMO_TAG_PARKING_AREA.

Referenced by parseAndBuildChargingStation().

Here is the caller graph for this function:

◆ getPosition()

double NLTriggerBuilder::getPosition ( const SUMOSAXAttributes attrs,
MSLane lane,
const std::string &  tt,
const std::string &  tid,
MSEdge edge = 0 
)
protected

returns the position on the lane checking it

This method extracts the position, checks whether it shall be mirrored and checks whether it is within the lane. If not, an error is reported and a InvalidArgument is thrown.

Parameters
[in]attrsThe attributes to obtain the position from
[in]laneThe lane the position shall be valid for
[in]ttThe trigger type (for user output)
[in]tidThe trigger id (for user output)
Returns
The position on the lane
Exceptions
InvalidArgumentIf the position is beyond the lane

Definition at line 991 of file NLTriggerBuilder.cpp.

References SUMOSAXAttributes::get(), Named::getID(), MSEdge::getLength(), MSLane::getLength(), SUMOSAXAttributes::getOpt(), SUMO_ATTR_FRIENDLY_POS, and SUMO_ATTR_POSITION.

Referenced by parseAndBuildCalibrator().

Here is the caller graph for this function:

◆ parseAndAddLotEntry()

void NLTriggerBuilder::parseAndAddLotEntry ( const SUMOSAXAttributes attrs)

Parses his values and adds a lot entry to current parking area.

Parameters
[in]attrsSAX-attributes which define the lot entry

Definition at line 596 of file NLTriggerBuilder.cpp.

References addLotEntry(), SUMOSAXAttributes::get(), MSParkingArea::getAngle(), MSParkingArea::getLength(), SUMOSAXAttributes::getOpt(), MSParkingArea::getWidth(), myParkingArea, SUMO_ATTR_ANGLE, SUMO_ATTR_LENGTH, SUMO_ATTR_SLOPE, SUMO_ATTR_WIDTH, SUMO_ATTR_X, SUMO_ATTR_Y, and SUMO_ATTR_Z.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ parseAndBeginParkingArea()

void NLTriggerBuilder::parseAndBeginParkingArea ( MSNet net,
const SUMOSAXAttributes attrs 
)

Parses his values and builds a parking area.

Parameters
[in]netThe network the parking area belongs to
[in]attrsSAX-attributes which define the trigger
Exceptions
InvalidArgumentIf a parameter (lane/position) is not valid

Definition at line 561 of file NLTriggerBuilder.cpp.

References beginParkingArea(), SUMORouteHandler::checkStopPos(), SUMOSAXAttributes::get(), getLane(), MSLane::getLength(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::hasAttribute(), myHandler, myParkingAreaCapacitySet, SUMORouteHandler::STOPPOS_VALID, SUMO_ATTR_ACCEPTED_BADGES, SUMO_ATTR_ANGLE, SUMO_ATTR_DEPARTPOS, SUMO_ATTR_ENDPOS, SUMO_ATTR_FRIENDLY_POS, SUMO_ATTR_ID, SUMO_ATTR_LEFTHAND, SUMO_ATTR_LENGTH, SUMO_ATTR_LINES, SUMO_ATTR_NAME, SUMO_ATTR_ONROAD, SUMO_ATTR_ROADSIDE_CAPACITY, SUMO_ATTR_STARTPOS, and SUMO_ATTR_WIDTH.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ parseAndBuildCalibrator()

void NLTriggerBuilder::parseAndBuildCalibrator ( MSNet net,
const SUMOSAXAttributes attrs,
const std::string &  base 
)

Parses his values and builds a mesoscopic or microscopic calibrator.

Parameters
[in]netThe network the calibrator belongs to
[in]attrsSAX-attributes which define the trigger
[in]baseThe base path
Exceptions
InvalidArgumentIf a parameter (edge/position) is not valid

Definition at line 622 of file NLTriggerBuilder.cpp.

References buildCalibrator(), buildMECalibrator(), DELTA_T, MSEdge::dictionary(), NamedObjectCont< T >::get(), SUMOSAXAttributes::get(), MSNet::getDetectorControl(), MSLane::getEdge(), getFileName(), Named::getID(), MSNet::getJunctionControl(), getLane(), MSEdge::getLanes(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::getOptPeriod(), getPosition(), MSDetectorControl::getTypedDetectors(), MSGlobals::gUseMesoSim, SUMOSAXAttributes::hasAttribute(), myHandler, GenericSAXHandler::registerParent(), SUMO_ATTR_EDGE, SUMO_ATTR_ID, SUMO_ATTR_JAM_DIST_THRESHOLD, SUMO_ATTR_LANE, SUMO_ATTR_LOCAL, SUMO_ATTR_NODE, SUMO_ATTR_OUTPUT, SUMO_ATTR_ROUTEPROBE, SUMO_ATTR_VTYPES, SUMO_TAG_CALIBRATOR, SUMO_TAG_ROUTEPROBE, and WRITE_WARNING.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ parseAndBuildChargingStation()

void NLTriggerBuilder::parseAndBuildChargingStation ( MSNet net,
const SUMOSAXAttributes attrs 
)

Parses his values and builds a charging station.

Parameters
[in]netThe network the charging station belongs to
[in]attrsSAXattributes which define the trigger
Exceptions
InvalidArgumentIf a parameter (lane/position) is not valid

Definition at line 147 of file NLTriggerBuilder.cpp.

References buildChargingStation(), SUMORouteHandler::checkStopPos(), SUMOSAXAttributes::get(), getLane(), MSLane::getLength(), SUMOSAXAttributes::getOpt(), SUMOSAXAttributes::getOptSUMOTimeReporting(), getParkingArea(), myHandler, SUMORouteHandler::STOPPOS_VALID, SUMO_ATTR_CHARGEDELAY, SUMO_ATTR_CHARGEINTRANSIT, SUMO_ATTR_CHARGETYPE, SUMO_ATTR_CHARGINGPOWER, SUMO_ATTR_EFFICIENCY, SUMO_ATTR_ENDPOS, SUMO_ATTR_FRIENDLY_POS, SUMO_ATTR_ID, SUMO_ATTR_NAME, SUMO_ATTR_STARTPOS, and SUMO_ATTR_WAITINGTIME.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ parseAndBuildLaneSpeedTrigger()

void NLTriggerBuilder::parseAndBuildLaneSpeedTrigger ( MSNet net,
const SUMOSAXAttributes attrs,
const std::string &  base 
)

Parses his values and builds a lane speed trigger.

If one of the declaration values is errornous, an InvalidArgument is thrown.

If the XML-file parsed during initialisation is errornous, and the MSLaneSpeedTrigger-constructor throws a ProcessError due to this, this exception is catched and an InvalidArgument with the message given in the ProcessError is thrown.

Parameters
[in]netThe network the lane speed trigger belongs to
[in]attrsSAX-attributes which define the trigger
[in]baseThe base path
Exceptions
InvalidArgumentIf a parameter (lane/position) is not valid or the read definition is errornous
See also
buildLaneSpeedTrigger

Definition at line 109 of file NLTriggerBuilder.cpp.

References buildLaneSpeedTrigger(), MSLane::dictionary(), SUMOSAXAttributes::get(), getFileName(), myHandler, GenericSAXHandler::registerParent(), SUMO_ATTR_ID, SUMO_ATTR_LANES, and SUMO_TAG_VSS.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ parseAndBuildOverheadWireClamp()

void NLTriggerBuilder::parseAndBuildOverheadWireClamp ( MSNet net,
const SUMOSAXAttributes attrs 
)

Parses its values and builds an overhead wire clamp.

An overhead wire clamp is a conductive connection of wires in the opposite direction over the road

Parameters
[in]netThe network the overhead wire clamp belongs to
[in]attrsSAXattributes which define the trigger
Exceptions
InvalidArgumentIf the traction substation is not found in the net or if the start or end segment belongs to a different traction substation

Definition at line 426 of file NLTriggerBuilder.cpp.

References MSTractionSubstation::addClamp(), MSTractionSubstation::findClamp(), MSNet::findTractionSubstation(), SUMOSAXAttributes::get(), MSNet::getInstance(), MSNet::getStoppingPlace(), MSGlobals::gOverheadWireSolver, SUMO_ATTR_ID, SUMO_ATTR_OVERHEAD_WIRE_CLAMP_END, SUMO_ATTR_OVERHEAD_WIRE_CLAMP_START, SUMO_ATTR_SUBSTATIONID, SUMO_TAG_OVERHEAD_WIRE_SEGMENT, TL, UNUSED_PARAMETER, WRITE_ERROR, and WRITE_WARNING.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ parseAndBuildOverheadWireSection()

void NLTriggerBuilder::parseAndBuildOverheadWireSection ( MSNet net,
const SUMOSAXAttributes attrs 
)

Parses its values and builds an overhead wire section.

Parameters
[in]netThe network the overhead wire segment belongs to
[in]attrsSAXattributes which define the trigger
Exceptions
InvalidArgumentIf a substationId is not known, a segment is not known or is assigned to another overheadWireSection
Todo:
for cycle abbreviation?

Definition at line 229 of file NLTriggerBuilder.cpp.

References MSTractionSubstation::addForbiddenLane(), MSTractionSubstation::addOverheadWireClampToCircuit(), MSTractionSubstation::addOverheadWireSegmentToCircuit(), buildInnerOverheadWireSegments(), buildOverheadWireClamp(), MSLane::dictionary(), MSTractionSubstation::OverheadWireClamp::end, MSTractionSubstation::findClamp(), MSNet::findTractionSubstation(), SUMOSAXAttributes::get(), Named::getID(), MSNet::getInstance(), MSLane::getInternalFollowingLane(), MSStoppingPlace::getLane(), MSLane::getNormalIncomingLanes(), SUMOSAXAttributes::getOpt(), MSLane::getOutgoingViaLanes(), MSNet::getStoppingPlace(), MSNet::getStoppingPlaceID(), MSOverheadWire::getTractionSubstation(), MSGlobals::gOverheadWireSolver, MSTractionSubstation::OverheadWireClamp::id, MSTractionSubstation::isAnySectionPreviouslyDefined(), MSTractionSubstation::isForbidden(), MSOverheadWire::setTractionSubstation(), MSTractionSubstation::OverheadWireClamp::start, SUMO_ATTR_OVERHEAD_WIRE_CLAMPS, SUMO_ATTR_OVERHEAD_WIRE_FORBIDDEN, SUMO_ATTR_OVERHEAD_WIRE_SEGMENTS, SUMO_ATTR_SUBSTATIONID, SUMO_TAG_OVERHEAD_WIRE_SEGMENT, TL, MSTractionSubstation::OverheadWireClamp::usage, WRITE_WARNING, and WRITE_WARNINGF.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ parseAndBuildOverheadWireSegment()

void NLTriggerBuilder::parseAndBuildOverheadWireSegment ( MSNet net,
const SUMOSAXAttributes attrs 
)

Parses its values and builds an overhead wire segment.

Parameters
[in]netThe network the overhead wire segment belongs to
[in]attrsSAXattributes which define the trigger
Exceptions
InvalidArgumentIf a parameter (lane/position) is not valid

Definition at line 183 of file NLTriggerBuilder.cpp.

References buildOverheadWireSegment(), SUMORouteHandler::checkStopPos(), SUMOSAXAttributes::get(), getLane(), MSLane::getLength(), SUMOSAXAttributes::getOpt(), MSGlobals::gOverheadWireSolver, MSLane::isInternal(), myHandler, myHaveWarnedAboutEigen, SUMORouteHandler::STOPPOS_VALID, SUMO_ATTR_ENDPOS, SUMO_ATTR_FRIENDLY_POS, SUMO_ATTR_ID, SUMO_ATTR_STARTPOS, SUMO_ATTR_VOLTAGESOURCE, TL, WRITE_MESSAGEF, and WRITE_WARNING.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ parseAndBuildRerouter()

void NLTriggerBuilder::parseAndBuildRerouter ( MSNet net,
const SUMOSAXAttributes attrs 
)

Parses his values and builds a rerouter.

Parameters
[in]netThe network the rerouter belongs to
[in]attrsSAX-attributes which define the trigger
Exceptions
InvalidArgumentIf a parameter (edge) is not valid

Definition at line 697 of file NLTriggerBuilder.cpp.

References buildRerouter(), MSEdge::dictionary(), SUMOSAXAttributes::get(), MSTriggeredRerouter::getInstances(), SUMOSAXAttributes::getOpt(), StringTokenizer::getVector(), Position::INVALID, myHandler, GenericSAXHandler::registerParent(), SUMO_ATTR_EDGES, SUMO_ATTR_HALTING_TIME_THRESHOLD, SUMO_ATTR_ID, SUMO_ATTR_OFF, SUMO_ATTR_OPTIONAL, SUMO_ATTR_POSITION, SUMO_ATTR_PROB, SUMO_ATTR_RADIUS, SUMO_ATTR_VTYPES, SUMO_TAG_REROUTER, TIME2STEPS, and StringUtils::toDouble().

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ parseAndBuildStoppingPlace()

void NLTriggerBuilder::parseAndBuildStoppingPlace ( MSNet net,
const SUMOSAXAttributes attrs,
const SumoXMLTag  element 
)

Parses the values and builds a stopping places for busses, trains or container vehicles.

Parameters
[in]netThe network the stop belongs to
[in]attrsSAX-attributes which define the stop
[in]elementwhich kind of stop is to be built
Exceptions
InvalidArgumentIf a parameter (lane/position) is not valid

Definition at line 485 of file NLTriggerBuilder.cpp.

References buildStoppingPlace(), SUMORouteHandler::checkStopPos(), SUMOSAXAttributes::get(), getLane(), SUMOSAXAttributes::getOpt(), MSStoppingPlace::getTransportablesAbreast(), RGBColor::INVISIBLE, MAX2(), myHandler, SUMORouteHandler::STOPPOS_VALID, SUMO_ATTR_COLOR, SUMO_ATTR_CONTAINER_CAPACITY, SUMO_ATTR_ENDPOS, SUMO_ATTR_FRIENDLY_POS, SUMO_ATTR_ID, SUMO_ATTR_LINES, SUMO_ATTR_NAME, SUMO_ATTR_PARKING_LENGTH, SUMO_ATTR_PERSON_CAPACITY, SUMO_ATTR_STARTPOS, SUMO_TAG_CONTAINER_STOP, and toString().

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ parseAndBuildTractionSubstation()

void NLTriggerBuilder::parseAndBuildTractionSubstation ( MSNet net,
const SUMOSAXAttributes attrs 
)

Parses its values and builds a traction substation.

Parameters
[in]netThe network the overhead wire segment belongs to
[in]attrsSAXattributes which define the trigger
Exceptions
InvalidArgumentIf the id is not given or is empty...

Definition at line 410 of file NLTriggerBuilder.cpp.

References buildTractionSubstation(), SUMOSAXAttributes::get(), SUMOSAXAttributes::getOpt(), SUMO_ATTR_CURRENTLIMIT, SUMO_ATTR_ID, and SUMO_ATTR_VOLTAGE.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ setHandler()

void NLTriggerBuilder::setHandler ( NLHandler handler)

Sets the parent handler to use for nested parsing.

Parameters
[in]handlerThe netload handler to set

Definition at line 67 of file NLTriggerBuilder.cpp.

References myHandler.

Referenced by NLBuilder::init(), and GUILoadThread::run().

Here is the caller graph for this function:

◆ updateParkingAreaDefaultCapacity()

void NLTriggerBuilder::updateParkingAreaDefaultCapacity ( )

updates the parkingArea default capacity

Definition at line 1022 of file NLTriggerBuilder.cpp.

References myParkingArea, myParkingAreaCapacitySet, and MSParkingArea::setRoadsideCapacity().

Referenced by NLHandler::myEndElement().

Here is the caller graph for this function:

Field Documentation

◆ myCurrentStop

MSStoppingPlace* NLTriggerBuilder::myCurrentStop
protected

◆ myHandler

◆ myHaveWarnedAboutEigen

bool NLTriggerBuilder::myHaveWarnedAboutEigen = false
protected

Definition at line 526 of file NLTriggerBuilder.h.

Referenced by parseAndBuildOverheadWireSegment().

◆ myParkingArea

MSParkingArea* NLTriggerBuilder::myParkingArea
protected

◆ myParkingAreaCapacitySet

bool NLTriggerBuilder::myParkingAreaCapacitySet = false
protected

The documentation for this class was generated from the following files: