SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIDetectorBuilder Class Reference

Builds detectors for guisim. More...

#include <GUIDetectorBuilder.h>

Inheritance diagram for GUIDetectorBuilder:
NLDetectorBuilder

Public Member Functions

MSDetectorFileOutputbuildMultiLaneE2Det (const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal pos, SUMOReal length, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold)
 Builds an e2 detector that continues on preceeding lanes. More...
 
MSDetectorFileOutputbuildSingleLaneE2Det (const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal pos, SUMOReal length, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold)
 Builds an e2 detector that lies on only one lane. More...
 
 GUIDetectorBuilder (MSNet &net)
 Constructor. More...
 
 ~GUIDetectorBuilder ()
 Destructor. More...
 
Detector creating methods

Override NLDetectorBuilder methods.

virtual MSDetectorFileOutputcreateInductLoop (const std::string &id, MSLane *lane, SUMOReal pos, bool splitByType)
 Creates an instance of an e1 detector using the given values. More...
 
virtual MSDetectorFileOutputcreateInstantInductLoop (const std::string &id, MSLane *lane, SUMOReal pos, const std::string &od)
 Creates an instance of an e1 detector using the given values. More...
 
virtual MSDetectorFileOutputcreateSingleLaneE2Detector (const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal pos, SUMOReal length, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold)
 Creates an instance of an e2-detector (areal detector) using the given values. More...
 
virtual MSDetectorFileOutputcreateMultiLaneE2Detector (const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal pos, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold)
 Creates an instance of an e2ol-detector using the given values. More...
 
virtual MSDetectorFileOutputcreateE3Detector (const std::string &id, const CrossSectionVector &entries, const CrossSectionVector &exits, SUMOReal haltingSpeedThreshold, SUMOTime haltingTimeThreshold)
 Creates an instance of an e3 detector using the given values. More...
 
Value parsing and detector building methods
void buildInductLoop (const std::string &id, const std::string &lane, SUMOReal pos, int splInterval, const std::string &device, bool friendlyPos, bool splitByType)
 Builds an e1 detector and adds it to the net. More...
 
void buildInstantInductLoop (const std::string &id, const std::string &lane, SUMOReal pos, const std::string &device, bool friendlyPos)
 Builds an instantenous induction and adds it to the net. More...
 
void buildE2Detector (const std::string &id, const std::string &lane, SUMOReal pos, SUMOReal length, bool cont, int splInterval, const std::string &device, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold, bool friendlyPos)
 Builds an e2 detector with a fixed interval and adds it to the net. More...
 
void buildE2Detector (const std::string &id, const std::string &lane, SUMOReal pos, SUMOReal length, bool cont, MSTLLogicControl::TLSLogicVariants &tlls, const std::string &device, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold, bool friendlyPos)
 Builds an e2 detector connected to a lsa. More...
 
void buildE2Detector (const std::string &id, const std::string &lane, SUMOReal pos, SUMOReal length, bool cont, MSTLLogicControl::TLSLogicVariants &tlls, const std::string &tolane, const std::string &device, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold, bool friendlyPos)
 Builds an e2 detector connected to a link's state. More...
 
void beginE3Detector (const std::string &id, const std::string &device, int splInterval, SUMOReal haltingSpeedThreshold, SUMOTime haltingTimeThreshold)
 Stores temporary the initial information about an e3 detector to build. More...
 
void addE3Entry (const std::string &lane, SUMOReal pos, bool friendlyPos)
 Builds an entry point of an e3 detector. More...
 
void addE3Exit (const std::string &lane, SUMOReal 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)
 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.

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 SUMOReal maxTravelTime, const SUMOReal minSamples, const SUMOReal haltSpeed, const std::string &vTypes, const std::string &device)
 Creates edge based mean data collector using the given specification. More...
 

Protected Member Functions

void convContE2PosLength (const std::string &id, MSLane *clane, SUMOReal &pos, SUMOReal &length, bool frinedly_pos)
 Converts the length and the position information for an e2ol-detector. More...
 
void convUncontE2PosLength (const std::string &id, MSLane *clane, SUMOReal &pos, SUMOReal &length, bool frinedly_pos)
 Converts the length and the position information for an e2 detector. More...
 
SUMOReal getPositionChecking (SUMOReal pos, MSLane *lane, bool friendlyPos, const std::string &detid)
 Computes the position to use. More...
 
Value checking/adapting methods
MSEdgegetEdgeChecking (const std::string &edgeID, SumoXMLTag type, const std::string &detid)
 Returns the named edge. More...
 
MSLanegetLaneChecking (const std::string &laneID, SumoXMLTag type, const std::string &detid)
 Returns the named lane. More...
 
void checkSampleInterval (int splInterval, SumoXMLTag type, const std::string &id)
 Checks whether the given frequency (sample interval) is valid. More...
 

Protected Attributes

MSNetmyNet
 The net to fill. More...
 

Detailed Description

Builds detectors for guisim.

This class overrides NLDetectorBuilder's detector creation methods in order to build guisim-classes instead of microsim-classes.

See also
NLDetectorBuilder

Definition at line 56 of file GUIDetectorBuilder.h.

Constructor & Destructor Documentation

GUIDetectorBuilder::GUIDetectorBuilder ( MSNet net)

Constructor.

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

Definition at line 58 of file GUIDetectorBuilder.cpp.

GUIDetectorBuilder::~GUIDetectorBuilder ( )

Destructor.

Definition at line 62 of file GUIDetectorBuilder.cpp.

Member Function Documentation

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

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 300 of file NLDetectorBuilder.cpp.

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

Referenced by NLHandler::addE3Entry().

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

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 314 of file NLDetectorBuilder.cpp.

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

Referenced by NLHandler::addE3Exit().

void NLDetectorBuilder::beginE3Detector ( const std::string &  id,
const std::string &  device,
int  splInterval,
SUMOReal  haltingSpeedThreshold,
SUMOTime  haltingTimeThreshold 
)
inherited

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 290 of file NLDetectorBuilder.cpp.

References NLDetectorBuilder::checkSampleInterval(), NLDetectorBuilder::myE3Definition, and SUMO_TAG_E3DETECTOR.

Referenced by NLHandler::beginE3Detector().

void NLDetectorBuilder::buildE2Detector ( const std::string &  id,
const std::string &  lane,
SUMOReal  pos,
SUMOReal  length,
bool  cont,
int  splInterval,
const std::string &  device,
SUMOTime  haltingTimeThreshold,
SUMOReal  haltingSpeedThreshold,
SUMOReal  jamDistThreshold,
bool  friendlyPos 
)
inherited

Builds an e2 detector with a fixed interval 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, length is too large, the id is already in use), an InvalidArgument is thrown.

Otherwise the e2 detector is built, either by calling "buildMultiLaneE2Det" if the detector shall continue on consecutive lanes, or by calling "buildSingleLaneE2Det" if it is a one-lane detector.

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 definition of the length the detector shall have
[in]contWhether the detector shall continue on predeceeding lanes
[in]splIntervalThe aggregation time span the detector shall use
[in]deviceThe output device the detector shall write into
[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
[in]jamDistThresholdDetector parameter: the distance between two vehicles in order to not count them to one jam
[in]friendlyPosWhether the position information shall be used "friendly" (see user docs)
Exceptions
InvalidArgumentIf one of the values is invalid

Definition at line 160 of file NLDetectorBuilder.cpp.

References MSDetectorControl::add(), NLDetectorBuilder::buildMultiLaneE2Det(), NLDetectorBuilder::buildSingleLaneE2Det(), NLDetectorBuilder::checkSampleInterval(), NLDetectorBuilder::convContE2PosLength(), NLDetectorBuilder::convUncontE2PosLength(), DU_USER_DEFINED, MSNet::getDetectorControl(), NLDetectorBuilder::getLaneChecking(), NLDetectorBuilder::myNet, SUMO_TAG_E2DETECTOR, and SUMO_TAG_LANE_AREA_DETECTOR.

Referenced by NLHandler::addE2Detector().

void NLDetectorBuilder::buildE2Detector ( const std::string &  id,
const std::string &  lane,
SUMOReal  pos,
SUMOReal  length,
bool  cont,
MSTLLogicControl::TLSLogicVariants tlls,
const std::string &  device,
SUMOTime  haltingTimeThreshold,
SUMOReal  haltingSpeedThreshold,
SUMOReal  jamDistThreshold,
bool  friendlyPos 
)
inherited

Builds an e2 detector connected to a lsa.

Checks the given values, first. If one of the values is invalid (lane is not known, position is larger than lane's length, length is too large, the tls is not known, the id is already in use), an InvalidArgument is thrown.

Otherwise the e2 detector is built, either by calling "buildMultiLaneE2Det" if the detector shall continue on consecutive lanes, or by calling "buildSingleLaneE2Det" if it is a one-lane detector.

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 definition of the length the detector shall have
[in]contWhether the detector shall continue on predeceeding lanes
[in]tllsThe tls the detector is assigned to
[in]deviceThe output device the detector shall write into
[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
[in]jamDistThresholdDetector parameter: the distance between two vehicles in order to not count them to one jam
[in]friendlyPosWhether the position information shall be used "friendly" (see user docs)
Exceptions
InvalidArgumentIf one of the values is invalid

Definition at line 184 of file NLDetectorBuilder.cpp.

References MSDetectorControl::add(), NLDetectorBuilder::buildMultiLaneE2Det(), NLDetectorBuilder::buildSingleLaneE2Det(), NLDetectorBuilder::convContE2PosLength(), NLDetectorBuilder::convUncontE2PosLength(), DU_USER_DEFINED, MSTLLogicControl::TLSLogicVariants::getActive(), MSNet::getCurrentTimeStep(), MSNet::getDetectorControl(), OutputDevice::getDevice(), NLDetectorBuilder::getLaneChecking(), NLDetectorBuilder::myNet, SUMO_TAG_E2DETECTOR, and SUMO_TAG_LANE_AREA_DETECTOR.

void NLDetectorBuilder::buildE2Detector ( const std::string &  id,
const std::string &  lane,
SUMOReal  pos,
SUMOReal  length,
bool  cont,
MSTLLogicControl::TLSLogicVariants tlls,
const std::string &  tolane,
const std::string &  device,
SUMOTime  haltingTimeThreshold,
SUMOReal  haltingSpeedThreshold,
SUMOReal  jamDistThreshold,
bool  friendlyPos 
)
inherited

Builds an e2 detector connected to a link's state.

Checks the given values, first. If one of the values is invalid (lane is not known, position is larger than lane's length, length is too large, the tls or the destination lane is not known, the id is already in use), an InvalidArgument is thrown.

Otherwise the e2 detector is built, either by calling "buildMultiLaneE2Det" if the detector shall continue on consecutive lanes, or by calling "buildSingleLaneE2Det" if it is a one-lane detector.

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 definition of the length the detector shall have
[in]contWhether the detector shall continue on predeceeding lanes
[in]tllsThe tls the detector is assigned to
[in]tolaneThe name of the lane to which the link to which the detector to build shall be assigned to points
[in]deviceThe output device the detector shall write into
[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
[in]jamDistThresholdDetector parameter: the distance between two vehicles in order to not count them to one jam
[in]friendlyPosWhether the position information shall be used "friendly" (see user docs)
Exceptions
InvalidArgumentIf one of the values is invalid

Definition at line 213 of file NLDetectorBuilder.cpp.

References MSDetectorControl::add(), NLDetectorBuilder::buildMultiLaneE2Det(), NLDetectorBuilder::buildSingleLaneE2Det(), NLDetectorBuilder::convContE2PosLength(), NLDetectorBuilder::convUncontE2PosLength(), DU_USER_DEFINED, MSTLLogicControl::TLSLogicVariants::getActive(), MSLinkContHelper::getConnectingLink(), MSNet::getCurrentTimeStep(), MSNet::getDetectorControl(), OutputDevice::getDevice(), NLDetectorBuilder::getLaneChecking(), NLDetectorBuilder::myNet, SUMO_TAG_E2DETECTOR, and SUMO_TAG_LANE_AREA_DETECTOR.

void NLDetectorBuilder::buildInductLoop ( const std::string &  id,
const std::string &  lane,
SUMOReal  pos,
int  splInterval,
const std::string &  device,
bool  friendlyPos,
bool  splitByType 
)
inherited

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]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]splitByTypeWhether vehicle types shall be disaggregated
Exceptions
InvalidArgumentIf one of the values is invalid

Definition at line 102 of file NLDetectorBuilder.cpp.

References MSDetectorControl::add(), NLDetectorBuilder::checkSampleInterval(), NLDetectorBuilder::createInductLoop(), MSNet::getDetectorControl(), MSLane::getEdge(), NLDetectorBuilder::getLaneChecking(), MSLane::getLength(), NLDetectorBuilder::getPositionChecking(), MSGlobals::gUseMesoSim, NLDetectorBuilder::myNet, SUMO_TAG_E1DETECTOR, SUMO_TAG_INDUCTION_LOOP, and SUMOReal.

Referenced by NLHandler::addE1Detector().

void NLDetectorBuilder::buildInstantInductLoop ( const std::string &  id,
const std::string &  lane,
SUMOReal  pos,
const std::string &  device,
bool  friendlyPos 
)
inherited

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

Definition at line 145 of file NLDetectorBuilder.cpp.

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

Referenced by NLHandler::addInstantE1Detector().

MSDetectorFileOutput * NLDetectorBuilder::buildMultiLaneE2Det ( const std::string &  id,
DetectorUsage  usage,
MSLane lane,
SUMOReal  pos,
SUMOReal  length,
SUMOTime  haltingTimeThreshold,
SUMOReal  haltingSpeedThreshold,
SUMOReal  jamDistThreshold 
)
inherited

Builds an e2 detector that continues on preceeding lanes.

Parameters
[in]idThe id the detector shall have
[in]usageInformation how the detector is used within the simulation
[in]laneThe lane the detector is placed at
[in]posThe position on the lane the detector is placed at
[in]lengthThe length the detector has
[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
[in]jamDistThresholdDetector parameter: the distance between two vehicles in order to not count them to one jam
Todo:
Check whether this method is really needful

Definition at line 388 of file NLDetectorBuilder.cpp.

References NLDetectorBuilder::createMultiLaneE2Detector().

Referenced by NLDetectorBuilder::buildE2Detector(), and MSAgentbasedTrafficLightLogic::init().

void NLDetectorBuilder::buildRouteProbe ( const std::string &  id,
const std::string &  edge,
SUMOTime  frequency,
SUMOTime  begin,
const std::string &  device 
)
inherited

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 362 of file NLDetectorBuilder.cpp.

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

Referenced by NLHandler::addRouteProbeDetector().

MSDetectorFileOutput * NLDetectorBuilder::buildSingleLaneE2Det ( const std::string &  id,
DetectorUsage  usage,
MSLane lane,
SUMOReal  pos,
SUMOReal  length,
SUMOTime  haltingTimeThreshold,
SUMOReal  haltingSpeedThreshold,
SUMOReal  jamDistThreshold 
)
inherited

Builds an e2 detector that lies on only one lane.

Parameters
[in]idThe id the detector shall have
[in]usageInformation how the detector is used within the simulation
[in]laneThe lane the detector is placed at
[in]posThe position on the lane the detector is placed at
[in]lengthThe length the detector has
[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
[in]jamDistThresholdDetector parameter: the distance between two vehicles in order to not count them to one jam
Todo:
Check whether this method is really needful

Definition at line 375 of file NLDetectorBuilder.cpp.

References NLDetectorBuilder::createSingleLaneE2Detector().

Referenced by NLDetectorBuilder::buildE2Detector().

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

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 353 of file NLDetectorBuilder.cpp.

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

Referenced by NLHandler::addVTypeProbeDetector().

void NLDetectorBuilder::checkSampleInterval ( int  splInterval,
SumoXMLTag  type,
const std::string &  id 
)
protectedinherited

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 554 of file NLDetectorBuilder.cpp.

References toString().

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

void NLDetectorBuilder::convContE2PosLength ( const std::string &  id,
MSLane clane,
SUMOReal pos,
SUMOReal length,
bool  frinedly_pos 
)
protectedinherited

Converts the length and the position information for an e2ol-detector.

Parameters
[in]idThe id of the currently built detector (for error message generation)
[in]claneThe lane the detector is placed at
[in,out]posThe position definition to convert
[in,out]lengthThe length definition to convert
Exceptions
InvalidArgumentIf the defined position or the defined length is invalid

Definition at line 280 of file NLDetectorBuilder.cpp.

References NLDetectorBuilder::getPositionChecking().

Referenced by NLDetectorBuilder::buildE2Detector().

void NLDetectorBuilder::convUncontE2PosLength ( const std::string &  id,
MSLane clane,
SUMOReal pos,
SUMOReal length,
bool  frinedly_pos 
)
protectedinherited

Converts the length and the position information for an e2 detector.

Parameters
[in]idThe id of the currently built detector (for error message generation)
[in]claneThe lane the detector is placed at
[in,out]posThe position definition to convert
[in,out]lengthThe length definition to convert
Exceptions
InvalidArgumentIf the defined position or the defined length is invalid

Definition at line 253 of file NLDetectorBuilder.cpp.

References Named::getID(), MSLane::getLength(), NLDetectorBuilder::getPositionChecking(), and SUMOReal.

Referenced by NLDetectorBuilder::buildE2Detector().

MSDetectorFileOutput * GUIDetectorBuilder::createE3Detector ( const std::string &  id,
const CrossSectionVector entries,
const CrossSectionVector exits,
SUMOReal  haltingSpeedThreshold,
SUMOTime  haltingTimeThreshold 
)
virtual

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

Simply calls the GUIE3Collector 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 from NLDetectorBuilder.

Definition at line 109 of file GUIDetectorBuilder.cpp.

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 SUMOReal  maxTravelTime,
const SUMOReal  minSamples,
const SUMOReal  haltSpeed,
const std::string &  vTypes,
const std::string &  device 
)
inherited

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]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 477 of file NLDetectorBuilder.cpp.

References MSDetectorControl::add(), MSNet::getDetectorControl(), MSNet::getInstance(), StringTokenizer::hasNext(), StringTokenizer::next(), SUMOTime_MAX, and WRITE_WARNING.

Referenced by NLHandler::addEdgeLaneMeanData().

MSDetectorFileOutput * GUIDetectorBuilder::createInductLoop ( const std::string &  id,
MSLane lane,
SUMOReal  pos,
bool  splitByType 
)
virtual

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

Simply calls the GUIInductLoop 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]splitByTypeWhether additional information split by vehicle classes shall be generated

Reimplemented from NLDetectorBuilder.

Definition at line 66 of file GUIDetectorBuilder.cpp.

MSDetectorFileOutput * GUIDetectorBuilder::createInstantInductLoop ( const std::string &  id,
MSLane lane,
SUMOReal  pos,
const std::string &  od 
)
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 from NLDetectorBuilder.

Definition at line 73 of file GUIDetectorBuilder.cpp.

References OutputDevice::getDevice().

MSDetectorFileOutput * GUIDetectorBuilder::createMultiLaneE2Detector ( const std::string &  id,
DetectorUsage  usage,
MSLane lane,
SUMOReal  pos,
SUMOTime  haltingTimeThreshold,
SUMOReal  haltingSpeedThreshold,
SUMOReal  jamDistThreshold 
)
virtual

Creates an instance of an e2ol-detector using the given values.

Simply calls the GUI_E2_ZS_CollectorOverLanes constructor. After this call, the detector must be initialised.

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 length the detector has
[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
[in]jamDistThresholdDetector parameter: the distance between two vehicles in order to not count them to one jam

Reimplemented from NLDetectorBuilder.

Definition at line 99 of file GUIDetectorBuilder.cpp.

MSDetectorFileOutput * GUIDetectorBuilder::createSingleLaneE2Detector ( const std::string &  id,
DetectorUsage  usage,
MSLane lane,
SUMOReal  pos,
SUMOReal  length,
SUMOTime  haltingTimeThreshold,
SUMOReal  haltingSpeedThreshold,
SUMOReal  jamDistThreshold 
)
virtual

Creates an instance of an e2-detector (areal detector) using the given values.

Simply calls the GUI_E2_ZS_Collector 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 length the detector has
[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
[in]jamDistThresholdDetector parameter: the distance between two vehicles in order to not count them to one jam

Reimplemented from NLDetectorBuilder.

Definition at line 89 of file GUIDetectorBuilder.cpp.

void NLDetectorBuilder::endE3Detector ( )
inherited

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 337 of file NLDetectorBuilder.cpp.

References MSDetectorControl::add(), NLDetectorBuilder::createE3Detector(), MSNet::getDetectorControl(), NLDetectorBuilder::E3DetectorDefinition::myDevice, NLDetectorBuilder::myE3Definition, NLDetectorBuilder::E3DetectorDefinition::myEntries, NLDetectorBuilder::E3DetectorDefinition::myExits, NLDetectorBuilder::E3DetectorDefinition::myHaltingSpeedThreshold, NLDetectorBuilder::E3DetectorDefinition::myHaltingTimeThreshold, NLDetectorBuilder::E3DetectorDefinition::myID, NLDetectorBuilder::myNet, NLDetectorBuilder::E3DetectorDefinition::mySampleInterval, and SUMO_TAG_ENTRY_EXIT_DETECTOR.

Referenced by NLHandler::endE3Detector().

std::string NLDetectorBuilder::getCurrentE3ID ( ) const
inherited

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 328 of file NLDetectorBuilder.cpp.

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

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

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

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 530 of file NLDetectorBuilder.cpp.

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

Referenced by NLDetectorBuilder::buildRouteProbe().

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

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 542 of file NLDetectorBuilder.cpp.

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

Referenced by NLDetectorBuilder::addE3Entry(), NLDetectorBuilder::addE3Exit(), NLDetectorBuilder::buildE2Detector(), NLDetectorBuilder::buildInductLoop(), and NLDetectorBuilder::buildInstantInductLoop().

SUMOReal NLDetectorBuilder::getPositionChecking ( SUMOReal  pos,
MSLane lane,
bool  friendlyPos,
const std::string &  detid 
)
protectedinherited

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 451 of file NLDetectorBuilder.cpp.

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

Referenced by NLDetectorBuilder::addE3Entry(), NLDetectorBuilder::addE3Exit(), NLDetectorBuilder::buildInductLoop(), NLDetectorBuilder::buildInstantInductLoop(), NLDetectorBuilder::convContE2PosLength(), and NLDetectorBuilder::convUncontE2PosLength().

Field Documentation


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