66 #ifdef CHECK_MEMORY_LEAKS
68 #endif // CHECK_MEMORY_LEAKS
78 const std::string& device,
SUMOReal haltingSpeedThreshold,
80 const std::string& vTypes)
81 : myID(id), myDevice(device),
82 myHaltingSpeedThreshold(haltingSpeedThreshold),
83 myHaltingTimeThreshold(haltingTimeThreshold),
84 mySampleInterval(splInterval),
85 myVehicleTypes(vTypes) {}
106 const std::string& device,
bool friendlyPos,
107 const std::string& vTypes) {
122 const std::string& lane,
SUMOReal pos,
123 const std::string& device,
bool friendlyPos,
124 const std::string& vTypes) {
140 const std::string& device,
143 SUMOReal jamDistThreshold,
bool friendlyPos,
144 const std::string& vTypes) {
166 const std::string& device,
169 SUMOReal jamDistThreshold,
bool friendlyPos,
170 const std::string& vTypes) {
172 throw InvalidArgument(
"The detector '" +
id +
"' refers to the unknown lsa.");
196 const std::string& tolane,
197 const std::string& device,
200 SUMOReal jamDistThreshold,
bool friendlyPos,
201 const std::string& vTypes) {
203 throw InvalidArgument(
"The detector '" +
id +
"' refers to the unknown lsa.");
210 "The detector output can not be build as no connection between lanes '"
211 + lane +
"' and '" + tolane +
"' exists.");
250 throw InvalidArgument(
"The length of detector '" +
id +
"' reaches beyond the lane's '" + clane->
getID() +
"' length.");
268 const std::string& device,
SUMOTime splInterval,
271 const std::string& vTypes) {
338 const std::string& vtype,
SUMOTime frequency,
339 const std::string& device) {
348 const std::string& device,
349 const std::string& vTypes) {
366 const std::string& vTypes) {
368 length, haltingTimeThreshold, haltingSpeedThreshold,
369 jamDistThreshold, vTypes);
379 const std::string& vTypes) {
381 lane, pos, haltingTimeThreshold, haltingSpeedThreshold,
382 jamDistThreshold, vTypes);
391 const std::string& vTypes,
bool) {
402 const std::string& vTypes) {
411 const std::string& vTypes) {
412 return new MSE2Collector(
id, usage, lane, pos, length, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, vTypes);
420 const std::string& vTypes) {
421 return new MS_E2_ZS_CollectorOverLanes(
id, usage, lane, pos, haltingTimeThreshold, haltingSpeedThreshold, jamDistThreshold, vTypes);
431 const std::string& vTypes) {
432 return new MSE3Collector(
id, entries, exits, haltingSpeedThreshold, haltingTimeThreshold, vTypes);
438 const std::string& detid) {
448 throw InvalidArgument(
"The position of detector '" + detid +
"' lies beyond the lane's '" + lane->
getID() +
"' end.");
455 throw InvalidArgument(
"The position of detector '" + detid +
"' lies before the lane's '" + lane->
getID() +
"' begin.");
465 const bool useLanes,
const bool withEmpty,
const bool printDefaults,
466 const bool withInternal,
const bool trackVehicles,
468 const SUMOReal haltSpeed,
const std::string& vTypes,
469 const std::string& device) {
471 throw InvalidArgument(
"Negative begin time for meandata dump '" +
id +
"'.");
477 throw InvalidArgument(
"End before or at begin for meandata dump '" +
id +
"'.");
480 if (type ==
"" || type ==
"performance" || type ==
"traffic") {
482 printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, haltSpeed, vTypes);
483 }
else if (type ==
"emissions" || type ==
"hbefa") {
484 if (type ==
"hbefa") {
485 WRITE_WARNING(
"The netstate type 'hbefa' is deprecated. Please use the type 'emissions' instead.");
488 printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, vTypes);
489 }
else if (type ==
"harmonoise") {
491 printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, vTypes);
492 }
else if (type ==
"amitran") {
494 printDefaults, withInternal, trackVehicles, maxTravelTime, minSamples, haltSpeed, vTypes);
496 throw InvalidArgument(
"Invalid type '" + type +
"' for meandata dump '" +
id +
"'.");
500 frequency = end - begin;
512 const std::string& detid) {
516 throw InvalidArgument(
"The lane with the id '" + edgeID +
"' is not known (while building " +
toString(type) +
" '" + detid +
"').");
524 const std::string& detid) {
528 throw InvalidArgument(
"The lane with the id '" + laneID +
"' is not known (while building " +
toString(type) +
" '" + detid +
"').");
536 if (splInterval < 0) {
539 if (splInterval == 0) {
Data collector for edges/lanes.
SumoXMLTag
Numbers representing SUMO-XML - element names.
MSEdge & getEdge() const
Returns the lane's edge.
virtual MSDetectorFileOutput * createInstantInductLoop(const std::string &id, MSLane *lane, SUMOReal pos, const std::string &od, const std::string &vTypes)
Creates an instance of an e1 detector using the given values.
Storage for all programs of a single tls.
MSLane * getLaneChecking(const std::string &laneID, SumoXMLTag type, const std::string &detid)
Returns the named lane.
A simple description of a position on a lane (crossing of a lane)
An areal (along a single lane) detector.
void addE3Entry(const std::string &lane, SUMOReal pos, bool friendlyPos)
Builds an entry point of an e3 detector.
Network state mean data collector for edges/lanes.
A detector which joins E2Collectors over consecutive lanes (backward)
Writes routes of vehicles passing a certain edge.
SUMOReal getLength() const
Returns the lane's length.
const std::string myID
The id of the detector.
MSDetectorFileOutput * buildMultiLaneE2Det(const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal pos, SUMOReal length, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold, const std::string &vTypes)
Builds an e2 detector that continues on preceeding lanes.
void addE3Exit(const std::string &lane, SUMOReal pos, bool friendlyPos)
Builds an exit point of an e3 detector.
std::vector< MSCrossSection > CrossSectionVector
An instantaneous induction loop.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
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.
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary...
void buildInstantInductLoop(const std::string &id, const std::string &lane, SUMOReal pos, const std::string &device, bool friendlyPos, const std::string &vTypes)
Builds an instantenous induction and adds it to the net.
~E3DetectorDefinition()
Destructor.
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.
void buildInductLoop(const std::string &id, const std::string &lane, SUMOReal pos, SUMOTime splInterval, const std::string &device, bool friendlyPos, const std::string &vTypes)
Builds an e1 detector and adds it to the net.
Noise data collector for edges/lanes.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
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.
void endE3Detector()
Builds of an e3 detector using collected values.
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.
#define WRITE_WARNING(msg)
The simulated network and simulation perfomer.
virtual MSDetectorFileOutput * createE3Detector(const std::string &id, const CrossSectionVector &entries, const CrossSectionVector &exits, SUMOReal haltingSpeedThreshold, SUMOTime haltingTimeThreshold, const std::string &vTypes)
Creates an instance of an e3 detector using the given values.
const std::string myVehicleTypes
The device the detector shall use.
const std::string & getID() const
Returns the id.
A road/street connecting two junctions.
Holds the incoming definitions of an e3 detector unless the detector is build.
MSTrafficLightLogic * getActive() const
MSE2Collector * buildSingleLaneE2Det(const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal pos, SUMOReal length, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold, const std::string &vTypes)
Builds an e2 detector that lies on only one lane.
Writes positions of vehicles that have a certain (named) type.
An instantenous induction loop.
std::string getCurrentE3ID() const
Returns the id of the currently built e3 detector.
Writes e2 state on each tls switch.
void buildE2Detector(const std::string &id, const std::string &lane, SUMOReal pos, SUMOReal length, bool cont, SUMOTime splInterval, const std::string &device, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold, bool friendlyPos, const std::string &vTypes)
Builds an e2 detector with a fixed interval and adds it to the net.
virtual MSDetectorFileOutput * createInductLoop(const std::string &id, MSLane *lane, SUMOReal pos, const std::string &vTypes, bool show=true)
Creates an instance of an e1 detector using the given values.
SUMOReal myHaltingSpeedThreshold
The speed a vehicle's speed must be below to be assigned as jammed.
void add(SumoXMLTag type, MSDetectorFileOutput *d, const std::string &device, SUMOTime splInterval, SUMOTime begin=-1)
Adds a detector/output combination into the containers.
Emission data collector for edges/lanes.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
MSDetectorControl & getDetectorControl()
Returns the detector control.
CrossSectionVector myExits
List of detector's exits.
MSEdge * getEdgeChecking(const std::string &edgeID, SumoXMLTag type, const std::string &detid)
Returns the named edge.
SUMOTime mySampleInterval
The aggregation interval.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
virtual MSDetectorFileOutput * createMultiLaneE2Detector(const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal pos, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold, const std::string &vTypes)
Creates an instance of an e2ol-detector using the given values.
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.
static MSLink * getConnectingLink(const MSLane &from, const MSLane &to)
Returns the link connecting both lanes Both lanes have to be non-internal; 0 may be returned if no co...
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
NLDetectorBuilder(MSNet &net)
Constructor.
static MELoop * gMesoNet
mesoscopic simulation infrastructure
void checkSampleInterval(SUMOTime splInterval, SumoXMLTag type, const std::string &id)
Checks whether the given frequency (sample interval) is valid.
A detector of vehicles passing an area between entry/exit points.
virtual MSE2Collector * createSingleLaneE2Detector(const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal pos, SUMOReal length, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold, const std::string &vTypes)
Creates an instance of an e2 detector using the given values.
Network state mean data collector for edges/lanes.
virtual ~NLDetectorBuilder()
Destructor.
E3DetectorDefinition * myE3Definition
definition of the currently parsed e3 detector
void beginE3Detector(const std::string &id, const std::string &device, SUMOTime splInterval, SUMOReal haltingSpeedThreshold, SUMOTime haltingTimeThreshold, const std::string &vTypes)
Stores temporary the initial information about an e3 detector to build.
MSNet & myNet
The net to fill.
Writes e2 state of a link for the time the link has yellow/red.
CrossSectionVector myEntries
List of detector's entries.
Representation of a lane in the micro simulation.
SUMOReal getPositionChecking(SUMOReal pos, MSLane *lane, bool friendlyPos, const std::string &detid)
Computes the position to use.
const std::string myDevice
The device the detector shall use.
An induction loop for mesoscopic simulation.
Base of value-generating classes (detectors)
An unextended detector measuring at a fixed position on a fixed lane.
SUMOTime myHaltingTimeThreshold
The time a vehicle's speed must be below haltingSpeedThreshold to be assigned as jammed.
E3DetectorDefinition(const std::string &id, const std::string &device, SUMOReal haltingSpeedThreshold, SUMOTime haltingTimeThreshold, SUMOTime splInterval, const std::string &vTypes)
Constructor.