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