24 #ifndef MSDetectorControl_h
25 #define MSDetectorControl_h
203 typedef std::map< IntervalsKey, DetectorFileVec >
Intervals;
217 struct detectorEquals :
public std::binary_function< DetectorFilePair, MSDetectorFileOutput*, bool > {
220 return pair.first == det;
226 std::map<SumoXMLTag, NamedObjectCont< MSDetectorFileOutput*> >
myDetectors;
std::vector< DetectorFilePair > DetectorFileVec
Container holding DetectorFilePair (with the same interval).
std::pair< MSDetectorFileOutput *, OutputDevice * > DetectorFilePair
A pair of a Detector with it's associated file-stream.
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.
Detectors container; responsible for string and output generation.
Returns true if detectors are equal.
const NamedObjectCont< MSDetectorFileOutput * > & getTypedDetectors(SumoXMLTag type) const
Returns the list of detectors of the given type.
NamedObjectCont< MSDetectorFileOutput * > myEmptyContainer
An empty container to return in getTypedDetectors() if no detectors of the asked type exist...
void add(SumoXMLTag type, MSDetectorFileOutput *d, const std::string &device, SUMOTime splInterval, SUMOTime begin=-1)
Adds a detector/output combination into the containers.
MSDetectorControl & operator=(const MSDetectorControl &)
Invalidated assignment operator.
std::map< IntervalsKey, DetectorFileVec > Intervals
Association of intervals to DetectorFilePair containers.
std::pair< SUMOTime, SUMOTime > IntervalsKey
Definition of the interval key.
bool operator()(const DetectorFilePair &pair, const MSDetectorFileOutput *det) const
Returns true if detectors are equal.
std::map< SumoXMLTag, NamedObjectCont< MSDetectorFileOutput * > > myDetectors
The detectors map, first by detector type, then using NamedObjectCont (.
const std::vector< SumoXMLTag > getAvailableTypes() const
Returns the list of available detector types.
void close(SUMOTime step)
Closes the detector outputs.
~MSDetectorControl()
Destructor.
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.
Base of value-generating classes (detectors)