38 #ifdef CHECK_MEMORY_LEAKS
40 #endif // CHECK_MEMORY_LEAKS
54 startPosM(startPos), haltingTimeThresholdM(haltingTimeThreshold),
55 haltingSpeedThresholdM(haltingSpeedThreshold), jamDistThresholdM(jamDistThreshold),
56 myStartLaneID(lane->getID()), myUsage(usage) {}
67 if (length > dlength) {
90 LengthVector::iterator leni =
myLengths.begin();
93 for (; leni !=
myLengths.end(); leni++, lanei++, deti++) {
94 if ((*leni) < length) {
100 assert(lv.size() > 0);
101 assert(dv.size() > 0);
108 MSLane* toExtend = lv.back();
111 if (predeccessors.size() == 0) {
114 const std::vector<MSLane*>& lanes = e.
getLanes();
115 int idx = (
int) distance(lanes.begin(), find(lanes.begin(), lanes.end(), toExtend));
116 while (predeccessors.size() == 0) {
117 if (idx - off >= 0) {
118 MSLane* tryMe = lanes[idx - off];
121 if (predeccessors.size() == 0 && idx + off < (
int) lanes.size()) {
122 MSLane* tryMe = lanes[idx + off];
135 for (std::vector<MSLane*>::const_iterator i = predeccessors.begin(); i != predeccessors.end(); i++) {
139 SUMOReal lanelen = length - clength;
173 std::vector<MSLane*> ret;
175 std::vector<MSEdge*>::const_iterator i = predEdges.begin();
176 for (; i != predEdges.end(); ++i) {
181 bool fastAbort =
false;
183 for (LaneVector::const_iterator j = cl->begin(); !fastAbort && j != cl->end(); j++) {
185 for (MSLinkCont::const_iterator k = lc.begin(); !fastAbort && k != lc.end(); k++) {
186 if ((*k)->getLane() == l) {
239 size_t ,
size_t )
const {
254 std::string ret = baseID + add + toString<size_t>(
bla++);
SUMOReal haltingSpeedThresholdM
Describes how slow a vehicle must be before being assigned to a jam.
MSEdge & getEdge() const
Returns the lane's edge.
std::vector< MSE2Collector * > DetectorVector
Definition of a detector storage.
const std::string & getStartLaneID() const
Returns the id of the lane this detector starts at.
An areal (along a single lane) detector.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
SUMOTime haltingTimeThresholdM
Describes how long a vehicle shall stay before being assigned to a jam.
SUMOReal getLength() const
Returns the lane's length.
LengthVector myLengths
Storage for length combinations.
std::vector< MSLane * > getLanePredeccessorLanes(MSLane *l)
Returns the list of lanes predecessing the given one.
std::vector< MSLane * > LaneVector
Definition of a lane storage.
std::string makeID(const std::string &baseID, size_t c, size_t r) const
Builds an id for one of the E2 collectors this detector uses.
bool writeXMLHeader(const std::string &rootElement, const std::string &attrs="", const std::string &comment="")
Writes an XML header with optional configuration.
DetectorUsage myUsage
Information about how this detector is used.
virtual MSE2Collector * buildCollector(size_t c, size_t r, MSLane *l, SUMOReal start, SUMOReal end)
Builds a single collector.
const std::string & getID() const
Returns the id.
A road/street connecting two junctions.
SUMOReal jamDistThresholdM
Describes how long a jam must be before being recognized.
std::string myStartLaneID
The id of the lane this detector starts at.
MS_E2_ZS_CollectorOverLanes(const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal startPos, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold)
Constructor.
SUMOReal myLength
The length of the collector.
virtual ~MS_E2_ZS_CollectorOverLanes()
Destructor.
SUMOReal startPosM
The position the collector starts at.
DetectorVectorVector myDetectorCombinations
Storage for detector combinations.
const std::vector< MSLane * > * allowedLanes(const MSEdge &destination, SUMOVehicleClass vclass=SVC_UNKNOWN) const
Get the allowed lanes to reach the destination-edge.
const std::vector< MSEdge * > & getIncomingEdges() const
Returns the list of edges from which this edge may be reached.
void extendTo(SUMOReal length)
This method extends the current length up to the given.
void init(MSLane *lane, SUMOReal detLength)
Builds the consecutive E2 detectors.
void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)
Writes collected values into the given stream.
LaneDetMap myAlreadyBuild
Storage for detectors which already have been build for a single lane.
Static storage of an output device and its base (abstract) implementation.
LaneVectorVector myLaneCombinations
Storage for lane combinations.
void writeXMLDetectorProlog(OutputDevice &dev) const
Opens the XML-output using "detector" as root element.
Representation of a lane in the micro simulation.
Base of value-generating classes (detectors)
SUMOReal getLength() const
Returns this detector's length [m].