54 for (std::vector<MSMeanData*>::const_iterator i =
myMeanData.begin(); i !=
myMeanData.end(); ++i) {
99 const std::vector<SumoXMLTag>
101 std::vector<SumoXMLTag> result;
103 result.push_back(i->first);
122 j.second->detectorUpdate(step);
126 i->detectorUpdate(step);
139 for (DetectorFileVec::iterator it = dfVec.begin(); it != dfVec.end(); ++it) {
162 detAndFileVec.push_back(std::make_pair(det, device));
163 myIntervals.insert(std::make_pair(key, detAndFileVec));
167 if (find_if(detAndFileVec.begin(), detAndFileVec.end(), bind2nd(
detectorEquals(), det)) == detAndFileVec.end()) {
168 detAndFileVec.push_back(std::make_pair(det, device));
171 WRITE_WARNING(
"MSDetectorControl::addDetectorAndInterval: detector already in container. Ignoring.");
std::vector< DetectorFilePair > DetectorFileVec
Container holding DetectorFilePair (with the same interval).
Data collector for edges/lanes.
SumoXMLTag
Numbers representing SUMO-XML - element names.
std::vector< MSMeanData * > myMeanData
List of harmonoise detectors.
std::map< IntervalsKey, SUMOTime > myLastCalls
The map that holds the last call for each sample interval.
void updateDetectors(const SUMOTime step)
Computes detector values.
void writeOutput(SUMOTime step, bool closing)
Writes the output to be generated within the given time step.
const std::string & getID() const
Returns the id.
A map of named object pointers.
Returns true if detectors are equal.
#define WRITE_WARNING(msg)
static OptionsCont & getOptions()
Retrieves the options.
virtual void writeXMLDetectorProlog(OutputDevice &dev) const =0
Open the XML-output.
NamedObjectCont< MSDetectorFileOutput * > myEmptyContainer
An empty container to return in getTypedDetectors() if no detectors of the asked type exist...
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
SUMOTime string2time(const std::string &r)
void add(SumoXMLTag type, MSDetectorFileOutput *d, const std::string &device, SUMOTime splInterval, SUMOTime begin=-1)
Adds a detector/output combination into the containers.
std::pair< SUMOTime, SUMOTime > IntervalsKey
Definition of the interval key.
std::map< SumoXMLTag, NamedObjectCont< MSDetectorFileOutput * > > myDetectors
The detectors map, first by detector type, then using NamedObjectCont (.
void close(SUMOTime step)
Closes the detector outputs.
const std::vector< SumoXMLTag > getAvailableTypes() const
Returns the list of available detector types.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
~MSDetectorControl()
Destructor.
virtual void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)=0
Write the generated output to the given device.
Static storage of an output device and its base (abstract) implementation.
MSDetectorControl()
Constructor.
Intervals myIntervals
Map that hold DetectorFileVec for given intervals.
void addDetectorAndInterval(MSDetectorFileOutput *det, OutputDevice *device, SUMOTime interval, SUMOTime begin=-1)
Adds one of the detectors as a new MSDetectorFileOutput.
const NamedObjectCont< MSDetectorFileOutput * > & getTypedDetectors(SumoXMLTag type) const
Returns the list of detectors of the given type.
Base of value-generating classes (detectors)
void init()
Adds the value collectors to all relevant edges.