39 #ifdef CHECK_MEMORY_LEAKS 41 #endif // CHECK_MEMORY_LEAKS 54 const std::string& vTypes)
56 startPosM(startPos), haltingTimeThresholdM(haltingTimeThreshold),
57 haltingSpeedThresholdM(haltingSpeedThreshold), jamDistThresholdM(jamDistThreshold),
58 myStartLaneID(lane->getID()), myUsage(usage) {}
69 if (length > dlength) {
92 LengthVector::iterator leni =
myLengths.begin();
95 for (; leni !=
myLengths.end(); leni++, lanei++, deti++) {
96 if ((*leni) < length) {
102 assert(lv.size() > 0);
103 assert(dv.size() > 0);
110 MSLane* toExtend = lv.back();
113 if (predeccessors.size() == 0) {
116 const std::vector<MSLane*>& lanes = e.
getLanes();
117 int idx = (int) distance(lanes.begin(), find(lanes.begin(), lanes.end(), toExtend));
118 while (predeccessors.size() == 0) {
119 if (idx - off >= 0) {
120 MSLane* tryMe = lanes[idx - off];
123 if (predeccessors.size() == 0 && idx + off < (int) lanes.size()) {
124 MSLane* tryMe = lanes[idx + off];
137 for (std::vector<MSLane*>::const_iterator i = predeccessors.begin(); i != predeccessors.end(); i++) {
141 SUMOReal lanelen = length - clength;
175 std::vector<MSLane*> ret;
177 MSEdgeVector::const_iterator i = predEdges.begin();
178 for (; i != predEdges.end(); ++i) {
183 bool fastAbort =
false;
185 for (LaneVector::const_iterator j = cl->begin(); !fastAbort && j != cl->end(); j++) {
187 for (MSLinkCont::const_iterator k = lc.begin(); !fastAbort && k != lc.end(); k++) {
188 if ((*k)->getLane() == l) {
203 const std::set<std::string>& vTypes) {
257 std::string ret = baseID + add + toString<int>(
bla++);
MS_E2_ZS_CollectorOverLanes(const std::string &id, DetectorUsage usage, MSLane *lane, SUMOReal startPos, SUMOTime haltingTimeThreshold, SUMOReal haltingSpeedThreshold, SUMOReal jamDistThreshold, const std::string &vTypes)
Constructor.
SUMOReal haltingSpeedThresholdM
Describes how slow a vehicle must be before being assigned to a jam.
SUMOReal getLength() const
Returns the lane's length.
std::vector< MSE2Collector * > DetectorVector
Definition of a detector storage.
MSEdge & getEdge() const
Returns the lane's edge.
virtual MSE2Collector * buildCollector(int c, int r, MSLane *l, SUMOReal start, SUMOReal end, const std::set< std::string > &vTypes)
Builds a single collector.
An areal (along a single lane) detector.
SUMOTime haltingTimeThresholdM
Describes how long a vehicle shall stay before being assigned to a jam.
const std::vector< MSLane * > * allowedLanes(const MSEdge &destination, SUMOVehicleClass vclass=SVC_IGNORING) const
Get the allowed lanes to reach the destination-edge.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
LengthVector myLengths
Storage for length combinations.
const MSEdgeVector & getIncomingEdges() const
Returns the list of edges from which this edge may be reached.
const std::string & getID() const
Returns the id.
std::vector< MSLane * > getLanePredeccessorLanes(MSLane *l)
Returns the list of lanes predecessing the given one.
std::vector< MSLane * > LaneVector
Definition of a lane storage.
const std::string & getStartLaneID() const
Returns the id of the lane this detector starts at.
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.
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.
std::set< std::string > myVehicleTypes
The vehicle types to look for (empty means all)
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.
void extendTo(SUMOReal length)
This method extends the current length up to the given.
SUMOReal getLength() const
Returns this detector's length [m].
std::string makeID(const std::string &baseID, int c, int r) const
Builds an id for one of the E2 collectors this detector uses.
void writeXMLDetectorProlog(OutputDevice &dev) const
Opens the XML-output using "detector" as root element.
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.
std::vector< MSEdge * > MSEdgeVector
LaneVectorVector myLaneCombinations
Storage for lane combinations.
Representation of a lane in the micro simulation.
vehicles ignoring classes
Base of value-generating classes (detectors)