 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
20 #ifndef MSDetectorControl_h
21 #define MSDetectorControl_h
194 typedef std::map< IntervalsKey, DetectorFileVec >
Intervals;
208 struct detectorEquals :
public std::binary_function< DetectorFilePair, MSDetectorFileOutput*, bool > {
211 return pair.first == det;
217 std::map<SumoXMLTag, NamedObjectCont< MSDetectorFileOutput*> >
myDetectors;
MSDetectorControl(const MSDetectorControl &)
Invalidated copy constructor.
std::map< IntervalsKey, DetectorFileVec > Intervals
Association of intervals to DetectorFilePair containers.
Base of value-generating classes (detectors)
MSDetectorControl & operator=(const MSDetectorControl &)
Invalidated assignment operator.
Static storage of an output device and its base (abstract) implementation.
Detectors container; responsible for string and output generation.
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.
void addDetectorAndInterval(MSDetectorFileOutput *det, OutputDevice *device, SUMOTime interval, SUMOTime begin=-1)
Adds one of the detectors as a new MSDetectorFileOutput.
Intervals myIntervals
Map that hold DetectorFileVec for given intervals.
bool operator()(const DetectorFilePair &pair, const MSDetectorFileOutput *det) const
Returns true if detectors are equal.
std::pair< MSDetectorFileOutput *, OutputDevice * > DetectorFilePair
A pair of a Detector with it's associated file-stream.
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.
void updateDetectors(const SUMOTime step)
Computes detector values.