Eclipse SUMO - Simulation of Urban MObility
NLDetectorBuilder Class Reference

Builds detectors for microsim. More...

#include <NLDetectorBuilder.h>

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

Data Structures

class  E3DetectorDefinition
 Holds the incoming definitions of an e3 detector unless the detector is build. More...
 

Public Member Functions

 NLDetectorBuilder (MSNet &net)
 Constructor. More...
 
virtual ~NLDetectorBuilder ()
 Destructor. More...
 
Value parsing and detector building methods
ParameterisedbuildInductLoop (const std::string &id, const std::string &lane, double pos, double length, SUMOTime splInterval, const std::string &device, bool friendlyPos, const std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons)
 Builds an e1 detector and adds it to the net. More...
 
ParameterisedbuildInstantInductLoop (const std::string &id, const std::string &lane, double pos, const std::string &device, bool friendlyPos, const std::string name, const std::string &vTypes, const std::string &nextEdges)
 Builds an instantenous induction and adds it to the net. More...
 
ParameterisedbuildE2Detector (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 name, const std::string &vTypes, const std::string &nextEdges, int detectPersons, 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 checks for the detector positioning and applies "friendly positioning". More...
 
ParameterisedbuildE2Detector (const std::string &id, std::vector< MSLane * > lanes, double pos, double endPos, const std::string &device, SUMOTime frequency, SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, const std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons, bool friendlyPos, bool showDetector, MSTLLogicControl::TLSLogicVariants *tlls=0, MSLane *toLane=0)
 
ParameterisedbeginE3Detector (const std::string &id, const std::string &device, SUMOTime splInterval, double haltingSpeedThreshold, SUMOTime haltingTimeThreshold, const std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons, bool openEntry, bool expectArrival)
 Stores temporary the initial information about an e3 detector to build. More...
 
void addE3Entry (const std::string &lane, double pos, bool friendlyPos)
 Builds an entry point of an e3 detector. More...
 
void addE3Exit (const std::string &lane, double pos, bool friendlyPos)
 Builds an exit point of an e3 detector. More...
 
void endE3Detector ()
 Builds of an e3 detector using collected values. More...
 
std::string getCurrentE3ID () const
 Returns the id of the currently built e3 detector. More...
 
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. More...
 
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. More...
 
Detector creating methods

Virtual, so they may be overwritten, for generating gui-versions of the detectors, for example.

virtual MSDetectorFileOutputcreateInductLoop (const std::string &id, MSLane *lane, double pos, double length, const std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons, bool show)
 Creates an instance of an e1 detector using the given values. More...
 
virtual MSDetectorFileOutputcreateInstantInductLoop (const std::string &id, MSLane *lane, double pos, const std::string &od, const std::string name, const std::string &vTypes, const std::string &nextEdges)
 Creates an instance of an e1 detector using the given values. More...
 
virtual MSE2CollectorcreateE2Detector (const std::string &id, DetectorUsage usage, MSLane *lane, double pos, double endPos, double length, SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, const std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons, bool showDetector)
 Creates a MSE2Collector instance, overridden by GUIE2Collector::createE2Detector() More...
 
virtual MSE2CollectorcreateE2Detector (const std::string &id, DetectorUsage usage, std::vector< MSLane * > lanes, double pos, double endPos, SUMOTime haltingTimeThreshold, double haltingSpeedThreshold, double jamDistThreshold, const std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons, bool showDetector)
 
virtual MSDetectorFileOutputcreateE3Detector (const std::string &id, const CrossSectionVector &entries, const CrossSectionVector &exits, double haltingSpeedThreshold, SUMOTime haltingTimeThreshold, const std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons, bool openEntry, bool expectArrival)
 Creates an instance of an e3 detector using the given values. More...
 
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 &writeAttributes, std::vector< MSEdge * > edges, bool aggregate, const std::string &device)
 Creates edge based mean data collector using the given specification. More...
 

Protected Member Functions

double getPositionChecking (double pos, MSLane *lane, bool friendlyPos, SumoXMLTag tag, const std::string &detid)
 Computes the position to use. More...
 

Protected Attributes

MSNetmyNet
 The net to fill. More...
 

Private Member Functions

 NLDetectorBuilder (const NLDetectorBuilder &)
 Invalidated copy constructor. More...
 
NLDetectorBuilderoperator= (const NLDetectorBuilder &)
 Invalidated assignment operator. More...
 

Private Attributes

E3DetectorDefinitionmyE3Definition
 definition of the currently parsed e3 detector More...
 

Value checking/adapting methods

MSLanegetLaneChecking (const std::string &laneID, SumoXMLTag type, const std::string &detid)
 Returns the named lane. More...
 
MSEdgegetEdgeChecking (const std::string &edgeID, SumoXMLTag type, const std::string &detid)
 Returns the named edge. More...
 
void checkSampleInterval (SUMOTime splInterval, SumoXMLTag type, const std::string &id)
 Checks whether the given frequency (sample interval) is valid. More...
 

Detailed Description

Builds detectors for microsim.

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

Definition at line 53 of file NLDetectorBuilder.h.

Constructor & Destructor Documentation

◆ NLDetectorBuilder() [1/2]

NLDetectorBuilder::NLDetectorBuilder ( MSNet net)

Constructor.

Parameters
[in]netThe network to which's detector control built detector shall be added

Definition at line 89 of file NLDetectorBuilder.cpp.

◆ ~NLDetectorBuilder()

NLDetectorBuilder::~NLDetectorBuilder ( )
virtual

Destructor.

Definition at line 93 of file NLDetectorBuilder.cpp.

References myE3Definition.

◆ NLDetectorBuilder() [2/2]

NLDetectorBuilder::NLDetectorBuilder ( const NLDetectorBuilder )
private

Invalidated copy constructor.

Member Function Documentation

◆ addE3Entry()

void NLDetectorBuilder::addE3Entry ( const std::string &  lane,
double  pos,
bool  friendlyPos 
)

Builds an entry point of an e3 detector.

If the lane is not known or the position information is not within the lane, an InvalidArgument is thrown. Otherwise a MSCrossSection is built using the obtained values and added to the list of entries of the e3 definition stored in "myE3Definition".

Parameters
[in]laneThe id of the lane the entry shall be placed at
[in]posThe position on the lane the entry shall be placed at
[in]friendlyPosWhether the position information shall be used "friendly" (see user docs)
Exceptions
InvalidArgumentIf one of the values is invalid

Definition at line 328 of file NLDetectorBuilder.cpp.

References getLaneChecking(), getPositionChecking(), myE3Definition, NLDetectorBuilder::E3DetectorDefinition::myEntries, NLDetectorBuilder::E3DetectorDefinition::myID, SUMO_TAG_DET_ENTRY, and SUMO_TAG_E3DETECTOR.

Referenced by NLHandler::addE3Entry().

Here is the caller graph for this function:

◆ addE3Exit()

void NLDetectorBuilder::addE3Exit ( const std::string &  lane,
double  pos,
bool  friendlyPos 
)

Builds an exit point of an e3 detector.

If the lane is not known or the position information is not within the lane, an InvalidArgument is thrown. Otherwise a MSCrossSection is built using the obtained values and added to the list of exits of the e3 definition stored in "myE3Definition".

Parameters
[in]laneThe id of the lane the exit shall be placed at
[in]posThe position on the lane the exit shall be placed at
[in]friendlyPosWhether the position information shall be used "friendly" (see user docs)
Exceptions
InvalidArgumentIf one of the values is invalid

Definition at line 342 of file NLDetectorBuilder.cpp.

References getLaneChecking(), getPositionChecking(), myE3Definition, NLDetectorBuilder::E3DetectorDefinition::myExits, NLDetectorBuilder::E3DetectorDefinition::myID, SUMO_TAG_DET_EXIT, and SUMO_TAG_E3DETECTOR.

Referenced by NLHandler::addE3Exit().

Here is the caller graph for this function:

◆ beginE3Detector()

Parameterised * NLDetectorBuilder::beginE3Detector ( const std::string &  id,
const std::string &  device,
SUMOTime  splInterval,
double  haltingSpeedThreshold,
SUMOTime  haltingTimeThreshold,
const std::string  name,
const std::string &  vTypes,
const std::string &  nextEdges,
int  detectPersons,
bool  openEntry,
bool  expectArrival 
)

Stores temporary the initial information about an e3 detector to build.

If the given sample interval is < 0, an InvalidArgument is thrown. Otherwise, the values are stored in a new instance of E3DetectorDefinition within "myE3Definition".

Parameters
[in]idThe id the detector shall have
[in]deviceThe output device the detector shall write into
[in]splIntervalThe aggregation time span the detector shall use
[in]haltingTimeThresholdDetector parameter: the time a vehicle's speed must be below haltingSpeedThreshold to be assigned as jammed
[in]haltingSpeedThresholdDetector parameter: the speed a vehicle's speed must be below to be assigned as jammed
Exceptions
InvalidArgumentIf one of the values is invalid

Definition at line 313 of file NLDetectorBuilder.cpp.

References checkSampleInterval(), myE3Definition, and SUMO_TAG_E3DETECTOR.

Referenced by NLHandler::beginE3Detector().

Here is the caller graph for this function:

◆ buildE2Detector() [1/2]

Parameterised * NLDetectorBuilder::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  name,
const std::string &  vTypes,
const std::string &  nextEdges,
int  detectPersons,
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 checks for the detector positioning and applies "friendly positioning".

Parameters
[in]tllsTraffic light logic associated to the detector
[in]toLaneLane associated to the detector (only for tlls != 0)
[in]friendlyPosWhether automatic adjustments of the detector position shall be applied in case of erroneous specification
See also
For the other parameters see the MSE2Collector constructors
Todo:
Add parameter showDetector to indicate whether the detector should be visible in the GUI

Definition at line 149 of file NLDetectorBuilder.cpp.

References MSDetectorControl::add(), checkSampleInterval(), createE2Detector(), DU_USER_DEFINED, MSNet::getCurrentTimeStep(), MSNet::getDetectorControl(), OutputDevice::getDevice(), Named::getID(), MSE2Collector::getLastLane(), MSLane::getLength(), MSLane::getLinkTo(), myNet, SUMO_TAG_E2DETECTOR, SUMO_TAG_LANE_AREA_DETECTOR, and WRITE_WARNING.

Referenced by NLHandler::addE2Detector(), and NEMALogic::init().

Here is the caller graph for this function:

◆ buildE2Detector() [2/2]

Parameterised * NLDetectorBuilder::buildE2Detector ( const std::string &  id,
std::vector< MSLane * >  lanes,
double  pos,
double  endPos,
const std::string &  device,
SUMOTime  frequency,
SUMOTime  haltingTimeThreshold,
double  haltingSpeedThreshold,
double  jamDistThreshold,
const std::string  name,
const std::string &  vTypes,
const std::string &  nextEdges,
int  detectPersons,
bool  friendlyPos,
bool  showDetector,
MSTLLogicControl::TLSLogicVariants tlls = 0,
MSLane toLane = 0 
)

◆ buildInductLoop()

Parameterised * NLDetectorBuilder::buildInductLoop ( const std::string &  id,
const std::string &  lane,
double  pos,
double  length,
SUMOTime  splInterval,
const std::string &  device,
bool  friendlyPos,
const std::string  name,
const std::string &  vTypes,
const std::string &  nextEdges,
int  detectPersons 
)

Builds an e1 detector and adds it to the net.

Checks the given values, first. If one of the values is invalid (lane is not known, sampling frequency<=0, position is larger than lane's length, the id is already in use), an InvalidArgument is thrown.

Otherwise the e1 detector is built by calling "createInductLoop".

Internally, there is also a distinction whether a mesosim e1 detector shall be built.

Parameters
[in]idThe id the detector shall have
[in]laneThe name of the lane the detector is placed at
[in]posThe definition of the position on the lane the detector shall be placed at
[in]lengthThe optional length of the detector
[in]splIntervalThe aggregation time span the detector shall use
[in]deviceThe output device the detector shall write into
[in]friendlyPosWhether the position information shall be used "friendly" (see user docs)
[in]vTypeswhich vehicle types are considered
Exceptions
InvalidArgumentIf one of the values is invalid
Returns
The created detector

Definition at line 99 of file NLDetectorBuilder.cpp.

References MSDetectorControl::add(), checkSampleInterval(), createInductLoop(), MSNet::getDetectorControl(), Named::getID(), getLaneChecking(), MSLane::getLength(), getPositionChecking(), MIN2(), myNet, SUMO_TAG_E1DETECTOR, SUMO_TAG_INDUCTION_LOOP, and toString().

Referenced by NLHandler::addE1Detector().

Here is the caller graph for this function:

◆ buildInstantInductLoop()

Parameterised * NLDetectorBuilder::buildInstantInductLoop ( const std::string &  id,
const std::string &  lane,
double  pos,
const std::string &  device,
bool  friendlyPos,
const std::string  name,
const std::string &  vTypes,
const std::string &  nextEdges 
)

Builds an instantenous induction and adds it to the net.

Checks the given values, first. If one of the values is invalid (lane is not known, sampling frequency<=0, position is larger than lane's length, the id is already in use), an InvalidArgument is thrown.

Otherwise the e1 detector is built by calling "createInductLoop".

Parameters
[in]idThe id the detector shall have
[in]laneThe name of the lane the detector is placed at
[in]posThe definition of the position on the lane the detector shall be placed at
[in]deviceThe output device the detector shall write into
[in]friendlyPosWhether the position information shall be used "friendly" (see user docs)
Exceptions
InvalidArgumentIf one of the values is invalid
Returns
The created detector

Definition at line 130 of file NLDetectorBuilder.cpp.

References MSDetectorControl::add(), createInstantInductLoop(), MSNet::getDetectorControl(), getLaneChecking(), getPositionChecking(), myNet, and SUMO_TAG_INSTANT_INDUCTION_LOOP.

Referenced by NLHandler::addInstantE1Detector().

Here is the caller graph for this function:

◆ buildRouteProbe()

void NLDetectorBuilder::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.

Checks the given values, first. If one of the values is invalid (sampling frequency<=0), an InvalidArgument is thrown.

Otherwise the routeProbe is built (directly).

Parameters
[in]idThe id the detector shall have
[in]edgeThe name of the edge the detector shall observe
[in]frequencyThe reporting frequency
[in]beginThe start of the first reporting interval
[in]deviceThe output device the detector shall write into
Exceptions
InvalidArgumentIf one of the values is invalid

Definition at line 403 of file NLDetectorBuilder.cpp.

References MSDetectorControl::add(), checkSampleInterval(), MSNet::getDetectorControl(), getEdgeChecking(), myNet, SUMO_TAG_ROUTEPROBE, and toString().

Referenced by NLHandler::addRouteProbeDetector().

Here is the caller graph for this function:

◆ buildVTypeProbe()

void NLDetectorBuilder::buildVTypeProbe ( const std::string &  id,
const std::string &  vtype,
SUMOTime  frequency,
const std::string &  device 
)

Builds a vTypeProbe and adds it to the net.

Checks the given values, first. If one of the values is invalid (sampling frequency<=0), an InvalidArgument is thrown.

Otherwise the vTypeProbe is built (directly).

Parameters
[in]idThe id the detector shall have
[in]vtypeThe name of the vehicle type the detector shall observe
[in]frequencyThe reporting frequency
[in]deviceThe output device the detector shall write into
Exceptions
InvalidArgumentIf one of the values is invalid

Definition at line 394 of file NLDetectorBuilder.cpp.

References checkSampleInterval(), OutputDevice::getDevice(), and SUMO_TAG_VTYPEPROBE.

Referenced by NLHandler::addVTypeProbeDetector().

Here is the caller graph for this function:

◆ checkSampleInterval()

void NLDetectorBuilder::checkSampleInterval ( SUMOTime  splInterval,
SumoXMLTag  type,
const std::string &  id 
)
protected

Checks whether the given frequency (sample interval) is valid.

Parameters
[in]splIntervalThe sample interval
[in]typeThe type of the detector (for error message generation)
[in]idThe id of the detector (for error message generation)
Exceptions
InvalidArgumentIf the given sample interval is invalid (<=0)
Todo:
Why is splInterval an int???

Definition at line 581 of file NLDetectorBuilder.cpp.

References checkStepLengthMultiple(), and toString().

Referenced by beginE3Detector(), buildE2Detector(), buildInductLoop(), buildRouteProbe(), and buildVTypeProbe().

Here is the caller graph for this function:

◆ createE2Detector() [1/2]

MSE2Collector * NLDetectorBuilder::createE2Detector ( const std::string &  id,
DetectorUsage  usage,
MSLane lane,
double  pos,
double  endPos,
double  length,
SUMOTime  haltingTimeThreshold,
double  haltingSpeedThreshold,
double  jamDistThreshold,
const std::string  name,
const std::string &  vTypes,
const std::string &  nextEdges,
int  detectPersons,
bool  showDetector 
)
virtual

Creates a MSE2Collector instance, overridden by GUIE2Collector::createE2Detector()

Simply calls the MSE2Collector constructor

See also
MSE2Collector Constructor documentation

Reimplemented in GUIDetectorBuilder.

Definition at line 441 of file NLDetectorBuilder.cpp.

Referenced by MSSOTLE2Sensors::buildContinueSensior(), MSSOTLE2Sensors::buildCountSensorForLane(), MSSOTLE2Sensors::buildCountSensorForOutLane(), buildE2Detector(), MSSOTLE2Sensors::buildSensorForLane(), MSSOTLE2Sensors::buildSensorForOutLane(), and MSDelayBasedTrafficLightLogic::init().

Here is the caller graph for this function:

◆ createE2Detector() [2/2]

MSE2Collector * NLDetectorBuilder::createE2Detector ( const std::string &  id,
DetectorUsage  usage,
std::vector< MSLane * >  lanes,
double  pos,
double  endPos,
SUMOTime  haltingTimeThreshold,
double  haltingSpeedThreshold,
double  jamDistThreshold,
const std::string  name,
const std::string &  vTypes,
const std::string &  nextEdges,
int  detectPersons,
bool  showDetector 
)
virtual

Reimplemented in GUIDetectorBuilder.

Definition at line 451 of file NLDetectorBuilder.cpp.

◆ createE3Detector()

MSDetectorFileOutput * NLDetectorBuilder::createE3Detector ( const std::string &  id,
const CrossSectionVector entries,
const CrossSectionVector exits,
double  haltingSpeedThreshold,
SUMOTime  haltingTimeThreshold,
const std::string  name,
const std::string &  vTypes,
const std::string &  nextEdges,
int  detectPersons,
bool  openEntry,
bool  expectArrival 
)
virtual

Creates an instance of an e3 detector using the given values.

Simply calls the MSE3Collector constructor.

Parameters
[in]idThe id the detector shall have
[in]entriesThe list of this detector's entries
[in]exitsThe list of this detector's exits
[in]haltingSpeedThresholdDetector parameter: the speed a vehicle's speed must be below to be assigned as jammed
[in]haltingTimeThresholdDetector parameter: the time a vehicle's speed must be below haltingSpeedThreshold to be assigned as jammed

Reimplemented in GUIDetectorBuilder.

Definition at line 461 of file NLDetectorBuilder.cpp.

Referenced by endE3Detector().

Here is the caller graph for this function:

◆ createEdgeLaneMeanData()

void NLDetectorBuilder::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 &  writeAttributes,
std::vector< MSEdge * >  edges,
bool  aggregate,
const std::string &  device 
)

Creates edge based mean data collector using the given specification.

Parameters
[in]idThe id the detector shall have
[in]frequencyThe aggregation interval the detector shall use
[in]begindump begin time
[in]enddump end time
[in]typeThe type of values to be generated
[in]useLanesInformation whether lane-based or edge-based dump shall be generated
[in]withEmptyInformation whether empty lanes/edges shall be written
[in]withInternalInformation whether internal lanes/edges shall be written
[in]trackVehiclesInformation whether information shall be collected per vehicle
[in]detectPersonsWhether pedestrians shall be detected instead of vehicles
[in]maxTravelTimethe maximum travel time to output
[in]minSamplesthe minimum number of sample seconds before the values are valid
[in]haltSpeedthe maximum speed to consider a vehicle waiting
[in]vTypesthe set of vehicle types to consider
Exceptions
InvalidArgumentIf one of the values is invalid

Definition at line 503 of file NLDetectorBuilder.cpp.

References MSDetectorControl::add(), checkStepLengthMultiple(), MSNet::getDetectorControl(), MSNet::getInstance(), SUMOTime_MAX, TL, and WRITE_WARNING.

Referenced by NLHandler::addEdgeLaneMeanData(), and NLBuilder::buildDefaultMeanData().

Here is the caller graph for this function:

◆ createInductLoop()

MSDetectorFileOutput * NLDetectorBuilder::createInductLoop ( const std::string &  id,
MSLane lane,
double  pos,
double  length,
const std::string  name,
const std::string &  vTypes,
const std::string &  nextEdges,
int  detectPersons,
bool  show 
)
virtual

Creates an instance of an e1 detector using the given values.

Simply calls the MSInductLoop constructor

Parameters
[in]idThe id the detector shall have
[in]laneThe lane the detector is placed at
[in]posThe position on the lane the detector is placed at
[in]lengthThe optional length of the detector
[in]vTypeswhich vehicle types are considered
[in]showWhether to show the detector in the gui if available

Reimplemented in GUIDetectorBuilder.

Definition at line 416 of file NLDetectorBuilder.cpp.

References MSLane::getEdge(), MSGlobals::gMesoNet, and MSGlobals::gUseMesoSim.

Referenced by buildInductLoop(), and MSActuatedTrafficLightLogic::init().

Here is the caller graph for this function:

◆ createInstantInductLoop()

MSDetectorFileOutput * NLDetectorBuilder::createInstantInductLoop ( const std::string &  id,
MSLane lane,
double  pos,
const std::string &  od,
const std::string  name,
const std::string &  vTypes,
const std::string &  nextEdges 
)
virtual

Creates an instance of an e1 detector using the given values.

Simply calls the MSInductLoop constructor

Parameters
[in]idThe id the detector shall have
[in]laneThe lane the detector is placed at
[in]posThe position on the lane the detector is placed at
[in]odThe output device the loop shall use

Reimplemented in GUIDetectorBuilder.

Definition at line 432 of file NLDetectorBuilder.cpp.

References OutputDevice::getDevice().

Referenced by buildInstantInductLoop().

Here is the caller graph for this function:

◆ endE3Detector()

void NLDetectorBuilder::endE3Detector ( )

Builds of an e3 detector using collected values.

The parameter collected are used to build an e3 detector using "createE3Detector". The resulting detector is added to the net.

Parameters
[in]laneThe id of the lane the exit shall be placed at
[in]posThe position on the lane the exit shall be placed at
Exceptions
InvalidArgumentIf one of the values is invalid

Definition at line 365 of file NLDetectorBuilder.cpp.

References MSDetectorControl::add(), createE3Detector(), MSNet::getDetectorControl(), Parameterised::getParametersMap(), NLDetectorBuilder::E3DetectorDefinition::myDetectPersons, NLDetectorBuilder::E3DetectorDefinition::myDevice, myE3Definition, NLDetectorBuilder::E3DetectorDefinition::myEntries, NLDetectorBuilder::E3DetectorDefinition::myExits, NLDetectorBuilder::E3DetectorDefinition::myExpectArrival, NLDetectorBuilder::E3DetectorDefinition::myHaltingSpeedThreshold, NLDetectorBuilder::E3DetectorDefinition::myHaltingTimeThreshold, NLDetectorBuilder::E3DetectorDefinition::myID, NLDetectorBuilder::E3DetectorDefinition::myName, myNet, NLDetectorBuilder::E3DetectorDefinition::myNextEdges, NLDetectorBuilder::E3DetectorDefinition::myOpenEntry, NLDetectorBuilder::E3DetectorDefinition::mySampleInterval, NLDetectorBuilder::E3DetectorDefinition::myVehicleTypes, SUMO_TAG_DET_ENTRY, SUMO_TAG_DET_EXIT, SUMO_TAG_E3DETECTOR, SUMO_TAG_ENTRY_EXIT_DETECTOR, toString(), Parameterised::updateParameters(), and WRITE_WARNING.

Referenced by NLHandler::endE3Detector().

Here is the caller graph for this function:

◆ getCurrentE3ID()

std::string NLDetectorBuilder::getCurrentE3ID ( ) const

Returns the id of the currently built e3 detector.

This is used for error-message generation only. If no id is known, "<unknown>" is returned.

Returns
The id of the currently processed e3 detector

Definition at line 356 of file NLDetectorBuilder.cpp.

References myE3Definition, and NLDetectorBuilder::E3DetectorDefinition::myID.

Referenced by NLHandler::addE3Entry(), and NLHandler::addE3Exit().

Here is the caller graph for this function:

◆ getEdgeChecking()

MSEdge * NLDetectorBuilder::getEdgeChecking ( const std::string &  edgeID,
SumoXMLTag  type,
const std::string &  detid 
)
protected

Returns the named edge.

Parameters
[in]edgeIDThe id of the lane
[in]typeThe type of the detector (for error message generation)
[in]detidThe id of the currently built detector (for error message generation)
Exceptions
InvalidArgumentIf the named edge is not known

Definition at line 557 of file NLDetectorBuilder.cpp.

References MSEdge::dictionary(), and toString().

Referenced by buildRouteProbe().

Here is the caller graph for this function:

◆ getLaneChecking()

MSLane * NLDetectorBuilder::getLaneChecking ( const std::string &  laneID,
SumoXMLTag  type,
const std::string &  detid 
)

Returns the named lane.

Parameters
[in]laneIDThe id of the lane
[in]typeThe type of the detector (for error message generation)
[in]detidThe id of the currently built detector (for error message generation)
Exceptions
InvalidArgumentIf the named lane is not known

Definition at line 569 of file NLDetectorBuilder.cpp.

References MSLane::dictionary(), and toString().

Referenced by NLHandler::addE2Detector(), addE3Entry(), addE3Exit(), buildInductLoop(), and buildInstantInductLoop().

Here is the caller graph for this function:

◆ getPositionChecking()

double NLDetectorBuilder::getPositionChecking ( double  pos,
MSLane lane,
bool  friendlyPos,
SumoXMLTag  tag,
const std::string &  detid 
)
protected

Computes the position to use.

At first, it is checked whether the given position is negative. If so, the position is added to the lane's length to obtain the position counted backwards.

If the resulting position is beyond or in front (<0) of the lane, it is either set to the according lane's boundary (.1 or length-.1) if friendlyPos is set, or, if friendlyPos is not set, an InvalidArgument is thrown.

Parameters
[in]posDefinition of the position on the lane
[in]laneThe lane the position must be valid for
[in]friendlyPosWhether false positions shall be made acceptable
[in]detidThe id of the currently built detector (for error message generation)
Exceptions
InvalidArgumentIf the defined position is invalid

Definition at line 476 of file NLDetectorBuilder.cpp.

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

Referenced by addE3Entry(), addE3Exit(), buildInductLoop(), and buildInstantInductLoop().

Here is the caller graph for this function:

◆ operator=()

NLDetectorBuilder& NLDetectorBuilder::operator= ( const NLDetectorBuilder )
private

Invalidated assignment operator.

Field Documentation

◆ myE3Definition

E3DetectorDefinition* NLDetectorBuilder::myE3Definition
private

definition of the currently parsed e3 detector

Definition at line 494 of file NLDetectorBuilder.h.

Referenced by addE3Entry(), addE3Exit(), beginE3Detector(), endE3Detector(), getCurrentE3ID(), and ~NLDetectorBuilder().

◆ myNet

MSNet& NLDetectorBuilder::myNet
protected

The net to fill.

Definition at line 489 of file NLDetectorBuilder.h.

Referenced by buildE2Detector(), buildInductLoop(), buildInstantInductLoop(), buildRouteProbe(), and endE3Detector().


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