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. | |
bool | makeSingleStep (SUMOTime end, RONet &net, SUMOAbstractRouter< ROEdge, ROVehicle > &router) |
unsigned int | openRoutes (RONet &net) |
Builds and opens all route loaders Route loaders are derived from ROTypedXMLRoutesLoader. | |
void | processAllRoutes (SUMOTime start, SUMOTime end, RONet &net, SUMOAbstractRouter< ROEdge, ROVehicle > &router) |
Loads all routes at once This is done for all previously build route loaders. | |
void | processAllRoutesWithBulkRouter (SUMOTime start, SUMOTime end, RONet &net, SUMOAbstractRouter< ROEdge, ROVehicle > &router) |
Loads all routes and processes them with BulkStarRouter. | |
void | processRoutesStepWise (SUMOTime start, SUMOTime end, RONet &net, SUMOAbstractRouter< ROEdge, ROVehicle > &router) |
Loads routes stepwise This is done for all previously build route loaders. | |
ROLoader (OptionsCont &oc, bool emptyDestinationsAllowed) | |
Constructor. | |
virtual | ~ROLoader () |
Destructor. | |
Protected Types | |
typedef std::vector < ROTypedXMLRoutesLoader * > | RouteLoaderCont |
Definition of route loader list. | |
Protected Member Functions | |
ROTypedXMLRoutesLoader * | buildNamedHandler (const std::string &optionName, const std::string &file, RONet &net) |
void | destroyHandlers () |
Deletes all handlers and clears their container ("myHandler") | |
SUMOTime | getMinTimeStep () const |
Returns the first time step known by the built handlers. | |
bool | openTypedRoutes (const std::string &optionName, RONet &net) |
Opens route handler of the given type. | |
void | writeStats (SUMOTime time, SUMOTime start, int absNo) |
Protected Attributes | |
bool | myEmptyDestinationsAllowed |
Information whether empty destinations are allowed. | |
RouteLoaderCont | myHandler |
List of route loaders. | |
OptionsCont & | myOptions |
Options to use. | |
Private Member Functions | |
ROLoader & | operator= (const ROLoader &src) |
Invalidated assignment operator. | |
ROLoader (const ROLoader &src) | |
Invalidated copy constructor. | |
Private Attributes | |
bool | myLogSteps |
Information whether the routing steps should be logged. |
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 65 of file ROLoader.h.
typedef std::vector<ROTypedXMLRoutesLoader*> ROLoader::RouteLoaderCont [protected] |
Definition of route loader list.
Definition at line 224 of file ROLoader.h.
ROLoader::ROLoader | ( | OptionsCont & | oc, |
bool | emptyDestinationsAllowed | ||
) |
Constructor.
[in] | oc | The options to use |
[in] | emptyDestinationsAllowed | Whether tripdefs may be given without destinations |
Definition at line 108 of file ROLoader.cpp.
ROLoader::~ROLoader | ( | ) | [virtual] |
ROLoader::ROLoader | ( | const ROLoader & | src | ) | [private] |
Invalidated copy constructor.
ROTypedXMLRoutesLoader * ROLoader::buildNamedHandler | ( | const std::string & | optionName, |
const std::string & | file, | ||
RONet & | net | ||
) | [protected] |
Definition at line 326 of file ROLoader.cpp.
References OptionsCont::getBool(), OptionsCont::getInt(), OptionsCont::getString(), myEmptyDestinationsAllowed, myOptions, and string2time().
Referenced by openTypedRoutes().
void ROLoader::destroyHandlers | ( | ) | [protected] |
Deletes all handlers and clears their container ("myHandler")
Definition at line 403 of file ROLoader.cpp.
References myHandler.
Referenced by openRoutes(), and ~ROLoader().
SUMOTime ROLoader::getMinTimeStep | ( | ) | const [protected] |
Returns the first time step known by the built handlers.
The handlers are responsible for not adding route definitions prior to "begin"-Option's value. These priori departures must also not be reported by them whaen asking via "getLastReadTimeStep".
Definition at line 239 of file ROLoader.cpp.
References myHandler.
Referenced by openRoutes(), and processRoutesStepWise().
void ROLoader::loadNet | ( | RONet & | toFill, |
ROAbstractEdgeBuilder & | eb | ||
) | [virtual] |
Loads the network.
Definition at line 121 of file ROLoader.cpp.
References FileHelpers::exists(), OptionsCont::getString(), OptionsCont::isSet(), myOptions, PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, PROGRESS_FAILED_MESSAGE, XMLSubSys::runParser(), and GenericSAXHandler::setFileName().
bool ROLoader::loadWeights | ( | RONet & | net, |
const std::string & | optionName, | ||
const std::string & | measure, | ||
bool | useLanes | ||
) |
Loads the net weights.
Definition at line 351 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().
bool ROLoader::makeSingleStep | ( | SUMOTime | end, |
RONet & | net, | ||
SUMOAbstractRouter< ROEdge, ROVehicle > & | router | ||
) |
Definition at line 218 of file ROLoader.cpp.
References MsgHandler::getErrorInstance(), myHandler, myOptions, RONet::saveAndRemoveRoutesUntil(), and MsgHandler::wasInformed().
Referenced by processRoutesStepWise().
unsigned int ROLoader::openRoutes | ( | RONet & | net | ) |
Builds and opens all route loaders Route loaders are derived from ROTypedXMLRoutesLoader.
Definition at line 156 of file ROLoader.cpp.
References destroyHandlers(), OptionsCont::getBool(), getMinTimeStep(), OptionsCont::getString(), myHandler, myOptions, openTypedRoutes(), string2time(), time2string(), and WRITE_MESSAGE.
Referenced by computeRoutes().
bool ROLoader::openTypedRoutes | ( | const std::string & | optionName, |
RONet & | net | ||
) | [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.
[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 290 of file ROLoader.cpp.
References buildNamedHandler(), OptionsCont::exists(), OptionsCont::getStringVector(), OptionsCont::isSet(), OptionsCont::isUsableFileList(), myHandler, myOptions, and WRITE_ERROR.
Referenced by openRoutes().
void ROLoader::processAllRoutes | ( | SUMOTime | start, |
SUMOTime | end, | ||
RONet & | net, | ||
SUMOAbstractRouter< ROEdge, ROVehicle > & | router | ||
) |
Loads all routes at once This is done for all previously build route loaders.
Definition at line 254 of file ROLoader.cpp.
References myHandler, myOptions, RONet::saveAndRemoveRoutesUntil(), SUMOTime_MAX, and writeStats().
Referenced by computeRoutes(), and processAllRoutesWithBulkRouter().
void ROLoader::processAllRoutesWithBulkRouter | ( | SUMOTime | start, |
SUMOTime | end, | ||
RONet & | net, | ||
SUMOAbstractRouter< ROEdge, ROVehicle > & | router | ||
) |
Loads all routes and processes them with BulkStarRouter.
Definition at line 274 of file ROLoader.cpp.
References myHandler, myOptions, processAllRoutes(), RONet::saveAndRemoveRoutesUntil(), and SUMOTime_MAX.
Referenced by computeRoutes().
void ROLoader::processRoutesStepWise | ( | SUMOTime | start, |
SUMOTime | end, | ||
RONet & | net, | ||
SUMOAbstractRouter< ROEdge, ROVehicle > & | router | ||
) |
Loads routes stepwise This is done for all previously build route loaders.
Definition at line 188 of file ROLoader.cpp.
References DELTA_T, RONet::furtherStored(), OptionsCont::getBool(), MsgHandler::getErrorInstance(), getMinTimeStep(), makeSingleStep(), myHandler, myLogSteps, myOptions, time2string(), MsgHandler::wasInformed(), WRITE_MESSAGE, and writeStats().
Referenced by computeRoutes().
void ROLoader::writeStats | ( | SUMOTime | time, |
SUMOTime | start, | ||
int | absNo | ||
) | [protected] |
Definition at line 394 of file ROLoader.cpp.
References myLogSteps, SUMOReal, time2string(), and toString().
Referenced by processAllRoutes(), and processRoutesStepWise().
bool ROLoader::myEmptyDestinationsAllowed [protected] |
Information whether empty destinations are allowed.
Definition at line 230 of file ROLoader.h.
Referenced by buildNamedHandler().
RouteLoaderCont ROLoader::myHandler [protected] |
List of route loaders.
Definition at line 227 of file ROLoader.h.
Referenced by destroyHandlers(), getMinTimeStep(), makeSingleStep(), openRoutes(), openTypedRoutes(), processAllRoutes(), processAllRoutesWithBulkRouter(), and processRoutesStepWise().
bool ROLoader::myLogSteps [private] |
Information whether the routing steps should be logged.
Definition at line 241 of file ROLoader.h.
Referenced by processRoutesStepWise(), and writeStats().
OptionsCont& ROLoader::myOptions [protected] |
Options to use.
Definition at line 221 of file ROLoader.h.
Referenced by buildNamedHandler(), loadNet(), loadWeights(), makeSingleStep(), openRoutes(), openTypedRoutes(), processAllRoutes(), processAllRoutesWithBulkRouter(), and processRoutesStepWise().