Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
ROLoader Class Reference

The data loader. More...

#include <ROLoader.h>

Collaboration diagram for ROLoader:
[legend]

Data Structures

class  EdgeFloatTimeLineRetriever_EdgeTravelTime
 Obtains edge travel times from a weights handler and stores them within the edges. More...
 
class  EdgeFloatTimeLineRetriever_EdgeWeight
 Obtains edge weights from a weights handler and stores them within the edges. More...
 

Public Member Functions

SUMORouteHandlergetRouteHandler ()
 
virtual void loadNet (RONet &toFill, ROAbstractEdgeBuilder &eb)
 Loads the network.
 
bool loadWeights (RONet &net, const std::string &optionName, const std::string &measure, const bool useLanes, const bool boundariesOverride)
 Loads the net weights.
 
void openRoutes (RONet &net)
 Builds and opens all route loaders.
 
void processRoutes (const SUMOTime start, const SUMOTime end, const SUMOTime increment, RONet &net, const RORouterProvider &provider)
 Loads routes from all previously build route loaders.
 
 ROLoader (OptionsCont &oc, const bool emptyDestinationsAllowed, const bool logSteps)
 Constructor.
 
virtual ~ROLoader ()
 Destructor.
 

Protected Member Functions

bool openTypedRoutes (const std::string &optionName, RONet &net, const bool readAll=false)
 Opens route handler of the given type.
 
void writeStats (const SUMOTime time, const SUMOTime start, const SUMOTime absNo, bool endGiven)
 

Private Member Functions

ROLoaderoperator= (const ROLoader &src)
 Invalidated assignment operator.
 
 ROLoader (const ROLoader &src)
 Invalidated copy constructor.
 

Private Attributes

const bool myEmptyDestinationsAllowed
 Information whether empty destinations are allowed.
 
SUMORouteLoaderControl myLoaders
 List of route loaders.
 
const bool myLogSteps
 Information whether the routing steps should be logged.
 
OptionsContmyOptions
 Options to use.
 

Detailed Description

The data loader.

Loads the network and route descriptions using further classes.

Is capable to either load all routes in one step or go through them step wise.

Definition at line 54 of file ROLoader.h.

Constructor & Destructor Documentation

◆ ROLoader() [1/2]

ROLoader::ROLoader ( OptionsCont oc,
const bool  emptyDestinationsAllowed,
const bool  logSteps 
)

Constructor.

Parameters
[in]ocThe options to use
[in]emptyDestinationsAllowedWhether trips may be given without destinations
Todo:
Recheck usage of emptyDestinationsAllowed

Definition at line 95 of file ROLoader.cpp.

◆ ~ROLoader()

ROLoader::~ROLoader ( )
virtual

Destructor.

Definition at line 103 of file ROLoader.cpp.

◆ ROLoader() [2/2]

ROLoader::ROLoader ( const ROLoader src)
private

Invalidated copy constructor.

Member Function Documentation

◆ getRouteHandler()

SUMORouteHandler * ROLoader::getRouteHandler ( )

Definition at line 308 of file ROLoader.cpp.

References SUMORouteLoaderControl::getFirstLoader(), SUMORouteLoader::getRouteHandler(), and myLoaders.

Referenced by computeRoutes().

Here is the caller graph for this function:

◆ loadNet()

void ROLoader::loadNet ( RONet toFill,
ROAbstractEdgeBuilder eb 
)
virtual

◆ loadWeights()

bool ROLoader::loadWeights ( RONet net,
const std::string &  optionName,
const std::string &  measure,
const bool  useLanes,
const bool  boundariesOverride 
)

Loads the net weights.

Definition at line 254 of file ROLoader.cpp.

References RONet::getEdgeMap(), OptionsCont::getStringVector(), OptionsCont::isUsableFileList(), myOptions, PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, XMLSubSys::runParser(), TL, and WRITE_MESSAGE.

Referenced by initNet().

Here is the caller graph for this function:

◆ openRoutes()

void ROLoader::openRoutes ( RONet net)

Builds and opens all route loaders.

Definition at line 163 of file ROLoader.cpp.

References RONet::furtherStored(), OptionsCont::getBool(), MsgHandler::getErrorInstance(), SUMORouteLoaderControl::getFirstLoadTime(), OptionsCont::getString(), SUMORouteLoaderControl::loadNext(), myLoaders, myOptions, openTypedRoutes(), string2time(), time2string(), WRITE_MESSAGE, and WRITE_WARNING.

Referenced by computeRoutes().

Here is the caller graph for this function:

◆ openTypedRoutes()

bool ROLoader::openTypedRoutes ( const std::string &  optionName,
RONet net,
const bool  readAll = false 
)
protected

Opens route handler of the given type.

Checks whether the given option name is known, returns true if not (this means that everything's ok, though the according handler is not built).

Checks then whether the given option name is set and his value is one or a set of valid (existing) files. This is done via a call to "OptionsCont::isUsableFileList" (which generates a proper error message).

If the given files are valid, the proper instance(s) is built using "buildNamedHandler" and if this could be done, it is added to the list of route handlers to use ("myHandler")

Returns whether the wished handler(s) could be built.

Parameters
[in]optionNameThe name of the option that refers to which handler and which files shall be used
[in]netThe net to assign to the built handlers
Returns
Whether the wished handler(s) could be built

Definition at line 225 of file ROLoader.cpp.

References SUMORouteLoaderControl::add(), OptionsCont::getBool(), OptionsCont::getStringVector(), OptionsCont::isSet(), OptionsCont::isUsableFileList(), myEmptyDestinationsAllowed, myLoaders, myOptions, XMLSubSys::runParser(), TL, and WRITE_ERRORF.

Referenced by openRoutes().

Here is the caller graph for this function:

◆ operator=()

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

Invalidated assignment operator.

◆ processRoutes()

void ROLoader::processRoutes ( const SUMOTime  start,
const SUMOTime  end,
const SUMOTime  increment,
RONet net,
const RORouterProvider provider 
)

Loads routes from all previously build route loaders.

Definition at line 193 of file ROLoader.cpp.

References RONet::furtherStored(), MsgHandler::getErrorInstance(), SUMORouteLoaderControl::getFirstLoadTime(), OptionsCont::getOptions(), SUMORouteLoaderControl::haveAllLoaded(), OptionsCont::isDefault(), SUMORouteLoaderControl::loadNext(), MIN2(), myLoaders, myLogSteps, myOptions, RONet::saveAndRemoveRoutesUntil(), time2string(), TL, MsgHandler::wasInformed(), WRITE_MESSAGEF, and writeStats().

Referenced by computeRoutes().

Here is the caller graph for this function:

◆ writeStats()

void ROLoader::writeStats ( const SUMOTime  time,
const SUMOTime  start,
const SUMOTime  absNo,
bool  endGiven 
)
protected

Definition at line 296 of file ROLoader.cpp.

References myLogSteps, time2string(), and toString().

Referenced by processRoutes().

Here is the caller graph for this function:

Field Documentation

◆ myEmptyDestinationsAllowed

const bool ROLoader::myEmptyDestinationsAllowed
private

Information whether empty destinations are allowed.

Definition at line 181 of file ROLoader.h.

Referenced by openTypedRoutes().

◆ myLoaders

SUMORouteLoaderControl ROLoader::myLoaders
private

List of route loaders.

Definition at line 187 of file ROLoader.h.

Referenced by getRouteHandler(), openRoutes(), openTypedRoutes(), and processRoutes().

◆ myLogSteps

const bool ROLoader::myLogSteps
private

Information whether the routing steps should be logged.

Definition at line 184 of file ROLoader.h.

Referenced by processRoutes(), and writeStats().

◆ myOptions

OptionsCont& ROLoader::myOptions
private

Options to use.

Definition at line 178 of file ROLoader.h.

Referenced by loadNet(), loadWeights(), openRoutes(), openTypedRoutes(), and processRoutes().


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