45 : myStorage(into), myTimeOffset(timeOffset), myTimeScale(timeScale),
46 myStartTime(startTime), myEndTime(endTime), myDetectorContainer(dets),
47 myHaveWarnedAboutOverridingBoundaries(false), myHaveWarnedAboutPartialDefs(false) {}
62 if (line.find(
';') == std::string::npos) {
73 if (time < myStartTime || time >=
myEndTime) {
76 WRITE_WARNING(
TL(
"At least one value lies beyond given time boundaries."));
104 WRITE_WARNING(
TL(
"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.");
#define WRITE_WARNING(msg)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Retrieves a file linewise and reports the lines to a handler.
bool readLine(LineHandler &lh)
Reads a single (the next) line from the file and reports it to the given LineHandler.
bool hasMore() const
Returns whether another line may be read (the file was not read completely)
std::string getFileName() const
Returns the name of the used file.
bool hasFullDefinition() const
Returns whether the number of named columns matches the actual number.
void reinit(const std::string &def, const std::string &defDelim=";", const std::string &lineDelim=";", bool chomp=false, bool ignoreCase=true)
Reinitialises the parser.
bool know(const std::string &name) const
Returns the information whether the named column is known.
void parseLine(const std::string &line)
Parses the contents of the line.
std::string get(const std::string &name, bool prune=false) const
Returns the named information.
const SUMOTime myTimeOffset
The time offset to apply to read time values.
RODFDetFlowLoader(const RODFDetectorCon &dets, RODFDetectorFlows &into, SUMOTime startTime, SUMOTime endTime, SUMOTime timeOffset, SUMOTime timeScale)
Constructor.
RODFDetectorFlows & myStorage
The container for read detector values.
const SUMOTime myTimeScale
The time scale to apply to read time values.
NamedColumnsParser myLineHandler
The value extractor.
bool myHaveWarnedAboutPartialDefs
Whether a warning about partial definitions was already written.
const RODFDetectorCon & myDetectorContainer
Container holding known detectors.
void read(const std::string &file)
Reads the given file assuming it contains detector values.
~RODFDetFlowLoader()
Destructor.
bool myHaveWarnedAboutOverridingBoundaries
Whether a warning about overriding boundaries was already written.
A container for RODFDetectors.
bool knows(const std::string &id) const
void addFlow(const std::string &detector_id, SUMOTime timestamp, const FlowDef &fd)
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
Definition of the traffic during a certain time containing the flows and speeds.