Eclipse SUMO - Simulation of Urban MObility
RODFDetFlowLoader Class Reference

A loader for detector flows. More...

#include <RODFDetFlowLoader.h>

Collaboration diagram for RODFDetFlowLoader:
[legend]

Public Member Functions

void read (const std::string &file)
 Reads the given file assuming it contains detector values. More...
 
 RODFDetFlowLoader (const RODFDetectorCon &dets, RODFDetectorFlows &into, SUMOTime startTime, SUMOTime endTime, SUMOTime timeOffset, SUMOTime timeScale)
 Constructor. More...
 
 ~RODFDetFlowLoader ()
 Destructor. More...
 

Private Member Functions

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

Private Attributes

const RODFDetectorConmyDetectorContainer
 Container holding known detectors. More...
 
const SUMOTime myEndTime
 
bool myHaveWarnedAboutOverridingBoundaries
 Whether a warning about overriding boundaries was already written. More...
 
bool myHaveWarnedAboutPartialDefs
 Whether a warning about partial definitions was already written. More...
 
NamedColumnsParser myLineHandler
 The value extractor. More...
 
const SUMOTime myStartTime
 The first and the last time step to read. More...
 
RODFDetectorFlowsmyStorage
 The container for read detector values. More...
 
const SUMOTime myTimeOffset
 The time offset to apply to read time values. More...
 
const SUMOTime myTimeScale
 The time scale to apply to read time values. More...
 

Detailed Description

A loader for detector flows.

Definition at line 40 of file RODFDetFlowLoader.h.

Constructor & Destructor Documentation

◆ RODFDetFlowLoader() [1/2]

RODFDetFlowLoader::RODFDetFlowLoader ( const RODFDetectorCon dets,
RODFDetectorFlows into,
SUMOTime  startTime,
SUMOTime  endTime,
SUMOTime  timeOffset,
SUMOTime  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 41 of file RODFDetFlowLoader.cpp.

◆ ~RODFDetFlowLoader()

RODFDetFlowLoader::~RODFDetFlowLoader ( )

Destructor.

Definition at line 51 of file RODFDetFlowLoader.cpp.

◆ RODFDetFlowLoader() [2/2]

RODFDetFlowLoader::RODFDetFlowLoader ( const RODFDetFlowLoader src)
private

Invalidated copy constructor.

Member Function Documentation

◆ operator=()

RODFDetFlowLoader& RODFDetFlowLoader::operator= ( const RODFDetFlowLoader src)
private

Invalidated assignment operator.

◆ read()

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 55 of file RODFDetFlowLoader.cpp.

References RODFDetectorFlows::addFlow(), fd, NamedColumnsParser::get(), LineReader::getFileName(), LineReader::getLineNumber(), NamedColumnsParser::hasFullDefinition(), LineReader::hasMore(), 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().

Here is the caller graph for this function:

Field Documentation

◆ myDetectorContainer

const RODFDetectorCon& RODFDetFlowLoader::myDetectorContainer
private

Container holding known detectors.

Definition at line 93 of file RODFDetFlowLoader.h.

Referenced by read().

◆ myEndTime

const SUMOTime RODFDetFlowLoader::myEndTime
private

Definition at line 87 of file RODFDetFlowLoader.h.

Referenced by read().

◆ myHaveWarnedAboutOverridingBoundaries

bool RODFDetFlowLoader::myHaveWarnedAboutOverridingBoundaries
private

Whether a warning about overriding boundaries was already written.

Definition at line 96 of file RODFDetFlowLoader.h.

Referenced by read().

◆ myHaveWarnedAboutPartialDefs

bool RODFDetFlowLoader::myHaveWarnedAboutPartialDefs
private

Whether a warning about partial definitions was already written.

Definition at line 99 of file RODFDetFlowLoader.h.

Referenced by read().

◆ myLineHandler

NamedColumnsParser RODFDetFlowLoader::myLineHandler
private

The value extractor.

Definition at line 90 of file RODFDetFlowLoader.h.

Referenced by read().

◆ myStartTime

const SUMOTime RODFDetFlowLoader::myStartTime
private

The first and the last time step to read.

Definition at line 87 of file RODFDetFlowLoader.h.

◆ myStorage

RODFDetectorFlows& RODFDetFlowLoader::myStorage
private

The container for read detector values.

Definition at line 78 of file RODFDetFlowLoader.h.

Referenced by read().

◆ myTimeOffset

const SUMOTime RODFDetFlowLoader::myTimeOffset
private

The time offset to apply to read time values.

Definition at line 81 of file RODFDetFlowLoader.h.

Referenced by read().

◆ myTimeScale

const SUMOTime RODFDetFlowLoader::myTimeScale
private

The time scale to apply to read time values.

Definition at line 84 of file RODFDetFlowLoader.h.

Referenced by read().


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