Eclipse SUMO - Simulation of Urban MObility
|
A loader for detector flows. More...
#include <RODFDetFlowLoader.h>
Public Member Functions | |
void | read (const std::string &file) |
Reads the given file assuming it contains detector values. | |
RODFDetFlowLoader (const RODFDetectorCon &dets, RODFDetectorFlows &into, SUMOTime startTime, SUMOTime endTime, SUMOTime timeOffset, SUMOTime timeScale) | |
Constructor. | |
~RODFDetFlowLoader () | |
Destructor. | |
Private Member Functions | |
RODFDetFlowLoader & | operator= (const RODFDetFlowLoader &src) |
Invalidated assignment operator. | |
RODFDetFlowLoader (const RODFDetFlowLoader &src) | |
Invalidated copy constructor. | |
Private Attributes | |
const RODFDetectorCon & | myDetectorContainer |
Container holding known detectors. | |
const SUMOTime | myEndTime |
bool | myHaveWarnedAboutOverridingBoundaries |
Whether a warning about overriding boundaries was already written. | |
bool | myHaveWarnedAboutPartialDefs |
Whether a warning about partial definitions was already written. | |
NamedColumnsParser | myLineHandler |
The value extractor. | |
const SUMOTime | myStartTime |
The first and the last time step to read. | |
RODFDetectorFlows & | myStorage |
The container for read detector values. | |
const SUMOTime | myTimeOffset |
The time offset to apply to read time values. | |
const SUMOTime | myTimeScale |
The time scale to apply to read time values. | |
A loader for detector flows.
Definition at line 40 of file RODFDetFlowLoader.h.
RODFDetFlowLoader::RODFDetFlowLoader | ( | const RODFDetectorCon & | dets, |
RODFDetectorFlows & | into, | ||
SUMOTime | startTime, | ||
SUMOTime | endTime, | ||
SUMOTime | timeOffset, | ||
SUMOTime | timeScale | ||
) |
Constructor.
[in] | dets | Definitions of known detectors |
[in,filled] | into Container to store read values into | |
[in] | startTime | The first time step for which values shall be read |
[in] | endTime | The last time step for which values shall be read |
[in] | timeOffset | The offset which shall be applied to the read times |
Definition at line 41 of file RODFDetFlowLoader.cpp.
RODFDetFlowLoader::~RODFDetFlowLoader | ( | ) |
Destructor.
Definition at line 51 of file RODFDetFlowLoader.cpp.
|
private |
Invalidated copy constructor.
|
private |
Invalidated assignment operator.
void RODFDetFlowLoader::read | ( | const std::string & | file | ) |
Reads the given file assuming it contains detector values.
Reads the first line, first, and parses it assuming it contains the names of the columns that follow within the next lines.
Then, the rest of the file is read and the read values for vehicle/heavy vehicle amounts and speeds are stored into "myStorage". Values that lie before "myStartTime" and behind "myEndTime" as well as values which refer to an unknown detector are omitted.
[in] | file | The name of the file to read |
IOError | Not yet implemented! |
ProcessError | Thrown if a value could not be parsed properly or a needed value is missing |
Definition at line 55 of file RODFDetFlowLoader.cpp.
References RODFDetectorFlows::addFlow(), fd, NamedColumnsParser::get(), LineReader::getFileName(), LineReader::getLineNumber(), NamedColumnsParser::hasFullDefinition(), LineReader::hasMore(), FlowDef::isLKW, NamedColumnsParser::know(), RODFDetectorCon::knows(), myDetectorContainer, myEndTime, myHaveWarnedAboutOverridingBoundaries, myHaveWarnedAboutPartialDefs, myLineHandler, myStorage, myTimeOffset, myTimeScale, NamedColumnsParser::parseLine(), LineReader::readLine(), NamedColumnsParser::reinit(), TL, StringUtils::toDouble(), toString(), and WRITE_WARNING.
Referenced by readDetectorFlows().
|
private |
Container holding known detectors.
Definition at line 93 of file RODFDetFlowLoader.h.
Referenced by read().
|
private |
Definition at line 87 of file RODFDetFlowLoader.h.
Referenced by read().
|
private |
Whether a warning about overriding boundaries was already written.
Definition at line 96 of file RODFDetFlowLoader.h.
Referenced by read().
|
private |
Whether a warning about partial definitions was already written.
Definition at line 99 of file RODFDetFlowLoader.h.
Referenced by read().
|
private |
|
private |
The first and the last time step to read.
Definition at line 87 of file RODFDetFlowLoader.h.
|
private |
The container for read detector values.
Definition at line 78 of file RODFDetFlowLoader.h.
Referenced by read().
|
private |
The time offset to apply to read time values.
Definition at line 81 of file RODFDetFlowLoader.h.
Referenced by read().
|
private |
The time scale to apply to read time values.
Definition at line 84 of file RODFDetFlowLoader.h.
Referenced by read().