SUMO - Simulation of Urban MObility
|
The data loader. More...
#include <ROLoader.h>
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 | |
virtual void | loadNet (RONet &toFill, ROAbstractEdgeBuilder &eb) |
Loads the network. | |
bool | loadWeights (RONet &net, const std::string &optionName, const std::string &measure, bool useLanes) |
Loads the net weights. | |
void | openRoutes (RONet &net) |
Builds and opens all route loaders. | |
void | processRoutes (SUMOTime start, SUMOTime end, RONet &net, SUMOAbstractRouter< ROEdge, ROVehicle > &router) |
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) |
Opens route handler of the given type. | |
void | writeStats (SUMOTime time, SUMOTime start, int absNo) |
Private Member Functions | |
ROLoader & | operator= (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. | |
OptionsCont & | myOptions |
Options to use. |
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 63 of file ROLoader.h.
ROLoader::ROLoader | ( | OptionsCont & | oc, |
const bool | emptyDestinationsAllowed, | ||
const bool | logSteps | ||
) |
Constructor.
[in] | oc | The options to use |
[in] | emptyDestinationsAllowed | Whether trips may be given without destinations |
Definition at line 115 of file ROLoader.cpp.
|
virtual |
Destructor.
Definition at line 123 of file ROLoader.cpp.
|
private |
Invalidated copy constructor.
|
virtual |
Loads the network.
Definition at line 128 of file ROLoader.cpp.
References deprecatedVehicleClassesSeen, OptionsCont::getString(), OptionsCont::getStringVector(), FileHelpers::isReadable(), OptionsCont::isSet(), myOptions, PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, PROGRESS_FAILED_MESSAGE, XMLSubSys::runParser(), GenericSAXHandler::setFileName(), toString(), and WRITE_WARNING.
Referenced by initNet().
bool ROLoader::loadWeights | ( | RONet & | net, |
const std::string & | optionName, | ||
const std::string & | measure, | ||
bool | useLanes | ||
) |
Loads the net weights.
Definition at line 266 of file ROLoader.cpp.
References RONet::getEdgeMap(), OptionsCont::getStringVector(), OptionsCont::isUsableFileList(), myOptions, PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, XMLSubSys::runParser(), and WRITE_MESSAGE.
Referenced by initNet().
void ROLoader::openRoutes | ( | RONet & | net | ) |
Builds and opens all route loaders.
Definition at line 169 of file ROLoader.cpp.
References RONet::furtherStored(), OptionsCont::getBool(), MsgHandler::getErrorInstance(), SUMORouteLoaderControl::getFirstLoadTime(), OptionsCont::getString(), SUMORouteLoaderControl::loadNext(), myLoaders, myOptions, openTypedRoutes(), string2time(), time2string(), MsgHandler::wasInformed(), and WRITE_MESSAGE.
Referenced by computeRoutes().
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.
[in] | optionName | The name of the option that refers to which handler and which files shall be used |
[in] | net | The net to assign to the built handlers |
Definition at line 231 of file ROLoader.cpp.
References SUMORouteLoaderControl::add(), OptionsCont::exists(), OptionsCont::getBool(), OptionsCont::getStringVector(), OptionsCont::isSet(), OptionsCont::isUsableFileList(), myEmptyDestinationsAllowed, myLoaders, myOptions, and WRITE_ERROR.
Referenced by openRoutes().
void ROLoader::processRoutes | ( | SUMOTime | start, |
SUMOTime | end, | ||
RONet & | net, | ||
SUMOAbstractRouter< ROEdge, ROVehicle > & | router | ||
) |
Loads routes from all previously build route loaders.
Definition at line 196 of file ROLoader.cpp.
References DELTA_T, RONet::furtherStored(), OptionsCont::getBool(), MsgHandler::getErrorInstance(), SUMORouteLoaderControl::getFirstLoadTime(), SUMORouteLoaderControl::loadNext(), myLoaders, myLogSteps, myOptions, RONet::saveAndRemoveRoutesUntil(), time2string(), MsgHandler::wasInformed(), WRITE_MESSAGE, and writeStats().
Referenced by computeRoutes().
Definition at line 309 of file ROLoader.cpp.
References myLogSteps, SUMOReal, time2string(), and toString().
Referenced by processRoutes().
|
private |
Information whether empty destinations are allowed.
Definition at line 194 of file ROLoader.h.
Referenced by openTypedRoutes().
|
private |
List of route loaders.
Definition at line 200 of file ROLoader.h.
Referenced by openRoutes(), openTypedRoutes(), and processRoutes().
|
private |
Information whether the routing steps should be logged.
Definition at line 197 of file ROLoader.h.
Referenced by processRoutes(), and writeStats().
|
private |
Options to use.
Definition at line 191 of file ROLoader.h.
Referenced by loadNet(), loadWeights(), openRoutes(), openTypedRoutes(), and processRoutes().