SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RODFDetFlowLoader Class Reference

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, int timeScale)
 Constructor.
 ~RODFDetFlowLoader ()
 Destructor.

Private Member Functions

RODFDetFlowLoaderoperator= (const RODFDetFlowLoader &src)
 Invalidated assignment operator.
 RODFDetFlowLoader (const RODFDetFlowLoader &src)
 Invalidated copy constructor.

Private Attributes

const RODFDetectorConmyDetectorContainer
 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.
RODFDetectorFlowsmyStorage
 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.

Detailed Description

A loader for detector flows.

Definition at line 50 of file RODFDetFlowLoader.h.

Constructor & Destructor Documentation

RODFDetFlowLoader::RODFDetFlowLoader ( const RODFDetectorCon dets,
RODFDetectorFlows into,
SUMOTime  startTime,
SUMOTime  endTime,
SUMOTime  timeOffset,
int  timeScale 
)

Constructor.

Parameters
[in]detsDefinitions of known detectors
in,filled]into Container to store read values into
[in]startTimeThe first time step for which values shall be read
[in]endTimeThe last time step for which values shall be read
[in]timeOffsetThe offset which shall be applied to the read times

Definition at line 52 of file RODFDetFlowLoader.cpp.

RODFDetFlowLoader::~RODFDetFlowLoader ( )

Destructor.

Definition at line 62 of file RODFDetFlowLoader.cpp.

RODFDetFlowLoader::RODFDetFlowLoader ( const RODFDetFlowLoader src)
private

Invalidated copy constructor.

Member Function Documentation

RODFDetFlowLoader& RODFDetFlowLoader::operator= ( const RODFDetFlowLoader src)
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.

Parameters
[in]fileThe name of the file to read
Exceptions
IOErrorNot yet implemented!
ProcessErrorThrown if a value could not be parsed properly or a needed value is missing

Definition at line 66 of file RODFDetFlowLoader.cpp.

References TplConvert::_2SUMOReal(), RODFDetectorFlows::addFlow(), NamedColumnsParser::get(), LineReader::getFileName(), NamedColumnsParser::hasFullDefinition(), LineReader::hasMore(), FlowDef::isLKW, NamedColumnsParser::know(), RODFDetectorCon::knows(), myDetectorContainer, myEndTime, myHaveWarnedAboutOverridingBoundaries, myHaveWarnedAboutPartialDefs, myLineHandler, myStorage, myTimeOffset, myTimeScale, NamedColumnsParser::parseLine(), FlowDef::qLKW, FlowDef::qPKW, LineReader::readLine(), NamedColumnsParser::reinit(), SUMOReal, FlowDef::vLKW, FlowDef::vPKW, and WRITE_WARNING.

Referenced by readDetectorFlows().

Field Documentation

const RODFDetectorCon& RODFDetFlowLoader::myDetectorContainer
private

Container holding known detectors.

Definition at line 103 of file RODFDetFlowLoader.h.

Referenced by read().

const SUMOTime RODFDetFlowLoader::myEndTime
private

Definition at line 97 of file RODFDetFlowLoader.h.

Referenced by read().

bool RODFDetFlowLoader::myHaveWarnedAboutOverridingBoundaries
private

Whether a warning about overriding boundaries was already written.

Definition at line 106 of file RODFDetFlowLoader.h.

Referenced by read().

bool RODFDetFlowLoader::myHaveWarnedAboutPartialDefs
private

Whether a warning about partial definitions was already written.

Definition at line 109 of file RODFDetFlowLoader.h.

Referenced by read().

NamedColumnsParser RODFDetFlowLoader::myLineHandler
private

The value extractor.

Definition at line 100 of file RODFDetFlowLoader.h.

Referenced by read().

const SUMOTime RODFDetFlowLoader::myStartTime
private

The first and the last time step to read.

Definition at line 97 of file RODFDetFlowLoader.h.

RODFDetectorFlows& RODFDetFlowLoader::myStorage
private

The container for read detector values.

Definition at line 88 of file RODFDetFlowLoader.h.

Referenced by read().

const SUMOTime RODFDetFlowLoader::myTimeOffset
private

The time offset to apply to read time values.

Definition at line 91 of file RODFDetFlowLoader.h.

Referenced by read().

const SUMOTime RODFDetFlowLoader::myTimeScale
private

The time scale to apply to read time values.

Definition at line 94 of file RODFDetFlowLoader.h.

Referenced by read().


The documentation for this class was generated from the following files: