 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
44 : myStorage(into), myTimeOffset(timeOffset), myTimeScale(timeScale),
45 myStartTime(startTime), myEndTime(endTime), myDetectorContainer(dets),
46 myHaveWarnedAboutOverridingBoundaries(false), myHaveWarnedAboutPartialDefs(false) {}
61 if (line.find(
';') == std::string::npos) {
72 if (parsedTime < myStartTime || parsedTime >=
myEndTime) {
75 WRITE_WARNING(
"At least one value lies beyond given time boundaries.");
104 WRITE_WARNING(
"At least one line does not contain the correct number of columns.");
109 +
" The following values must be supplied : 'Detector', 'Time', 'qPKW'\n"
110 +
" The according column names must be given in the first line of the file.");
bool hasFullDefinition() const
Returns whether the number of named columns matches the actual number.
#define WRITE_WARNING(msg)
bool knows(const std::string &id) const
bool readLine(LineHandler &lh)
Reads a single (the next) line from the file and reports it to the given LineHandler.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
A container for RODFDetectors.
const RODFDetectorCon & myDetectorContainer
Container holding known detectors.
~RODFDetFlowLoader()
Destructor.
void parseLine(const std::string &line)
Parses the contents of the line.
const SUMOTime myTimeScale
The time scale to apply to read time values.
std::string get(const std::string &name, bool prune=false) const
Returns the named information.
Definition of the traffic during a certain time containing the flows and speeds.
std::string getFileName() const
Returns the name of the used file.
bool hasMore() const
Returns whether another line may be read (the file was not read completely)
void reinit(const std::string &def, const std::string &defDelim=";", const std::string &lineDelim=";", bool chomp=false, bool ignoreCase=true)
Reinitialises the parser.
Retrieves a file linewise and reports the lines to a handler.
bool know(const std::string &name) const
Returns the information whether the named column is known.
RODFDetFlowLoader(const RODFDetectorCon &dets, RODFDetectorFlows &into, SUMOTime startTime, SUMOTime endTime, SUMOTime timeOffset, SUMOTime timeScale)
Constructor.
const SUMOTime myTimeOffset
The time offset to apply to read time values.
void addFlow(const std::string &detector_id, SUMOTime timestamp, const FlowDef &fd)
bool myHaveWarnedAboutPartialDefs
Whether a warning about partial definitions was already written.
NamedColumnsParser myLineHandler
The value extractor.
bool myHaveWarnedAboutOverridingBoundaries
Whether a warning about overriding boundaries was already written.
RODFDetectorFlows & myStorage
The container for read detector values.
void read(const std::string &file)
Reads the given file assuming it contains detector values.