55 double val,
double beg,
double end)
const {
64 WRITE_ERRORF(
TL(
"Trying to set a weight for the unknown edge '%'."),
id);
76 double val,
double beg,
double end)
const {
77 ROEdge* e = myNet.getEdge(
id);
85 WRITE_ERRORF(
TL(
"Trying to set a weight for the unknown edge '%'."),
id);
99 myLoaders(oc.exists(
"unsorted-input") && oc.getBool(
"unsorted-input") ? 0 :
DELTA_T) {
114 throw ProcessError(
TLF(
"The network file '%' is not accessible.", file));
131 edgeIt.second->cacheParamRestrictions(paramKeys);
140 for (std::vector<std::string>::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
142 throw ProcessError(
TLF(
"The additional file '%' is not accessible.", *fileIt));
145 handler.setFileName(*fileIt);
176 const std::string error =
"No route input specified or all routes were invalid.";
202 while (time <= end) {
212 if (time < end && time > end - increment) {
226 RONet& net,
const bool readAll) {
245 WRITE_ERRORF(
TL(
"The loader for % from file '%' could not be initialised (%)."), optionName, fileIt, e.what());
255 const std::string& measure,
const bool useLanes,
const bool boundariesOverride) {
261 std::vector<SAXWeightsHandler::ToRetrieveDefinition*> retrieverDefs;
267 if (measure !=
"traveltime") {
268 std::string umeasure = measure;
269 if (measure ==
"CO" || measure ==
"CO2" || measure ==
"HC" || measure ==
"PMx" || measure ==
"NOx" || measure ==
"fuel" || measure ==
"electricity") {
270 umeasure = measure +
"_perVeh";
278 for (std::vector<std::string>::const_iterator fileIt = files.begin(); fileIt != files.end(); ++fileIt) {
289 i.second->buildTimeLines(measure, boundariesOverride);
299 const double perc = (double)(time - start) / (double) absNo;
302 std::cout <<
"Reading up to time step: " +
time2string(time) +
"\r";
#define WRITE_WARNINGF(...)
#define WRITE_MESSAGEF(...)
#define WRITE_ERRORF(...)
#define WRITE_MESSAGE(msg)
#define WRITE_WARNING(msg)
#define PROGRESS_DONE_MESSAGE()
#define PROGRESS_FAILED_MESSAGE()
#define PROGRESS_BEGIN_MESSAGE(msg)
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
std::set< std::string > deprecatedVehicleClassesSeen
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static bool isReadable(std::string path)
Checks whether the given file is readable.
void setFileName(const std::string &name)
Sets the current file name.
bool wasInformed() const
Returns the information whether any messages were added.
static MsgHandler * getErrorInstance()
Returns the instance to add errors to.
A storage for options typed value containers)
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
bool exists(const std::string &name) const
Returns the information whether the named option is known.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
static OptionsCont & getOptions()
Retrieves the options.
bool isUsableFileList(const std::string &name) const
Checks whether the named option is usable as a file list (with at least a single file)
Interface for building instances of router-edges.
A basic edge for routing applications.
void addEffort(double value, double timeBegin, double timeEnd)
Adds a weight value.
void addTravelTime(double value, double timeBegin, double timeEnd)
Adds a travel time value.
Obtains edge travel times from a weights handler and stores them within the edges.
RONet & myNet
The network edges shall be obtained from.
void addEdgeWeight(const std::string &id, double val, double beg, double end) const
Adds a travel time for a given edge and time period.
Obtains edge weights from a weights handler and stores them within the edges.
void addEdgeWeight(const std::string &id, double val, double beg, double end) const
Adds an effort for a given edge and time period.
bool loadWeights(RONet &net, const std::string &optionName, const std::string &measure, const bool useLanes, const bool boundariesOverride)
Loads the net weights.
bool openTypedRoutes(const std::string &optionName, RONet &net, const bool readAll=false)
Opens route handler of the given type.
SUMORouteLoaderControl myLoaders
List of 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.
virtual ~ROLoader()
Destructor.
ROLoader(OptionsCont &oc, const bool emptyDestinationsAllowed, const bool logSteps)
Constructor.
virtual void loadNet(RONet &toFill, ROAbstractEdgeBuilder &eb)
Loads the network.
void writeStats(const SUMOTime time, const SUMOTime start, const SUMOTime absNo, bool endGiven)
void openRoutes(RONet &net)
Builds and opens all route loaders.
const bool myLogSteps
Information whether the routing steps should be logged.
OptionsCont & myOptions
Options to use.
const bool myEmptyDestinationsAllowed
Information whether empty destinations are allowed.
The handler that parses a SUMO-network for its usage in a router.
The router's network representation.
ROEdge * getEdge(const std::string &name) const
Retrieves an edge from the network.
bool furtherStored()
Returns the information whether further vehicles, persons or containers are stored.
SUMOTime saveAndRemoveRoutesUntil(OptionsCont &options, const RORouterProvider &provider, SUMOTime time)
Computes routes described by their definitions and saves them.
void setBidiEdges(const std::map< ROEdge *, std::string > &bidiMap)
add a taz for every junction unless a taz with the same id already exists
void addJunctionTaz(ROAbstractEdgeBuilder &eb)
add a taz for every junction unless a taz with the same id already exists
const NamedObjectCont< ROEdge * > & getEdgeMap() const
Parser and container for routes during their loading.
Complete definition about what shall be retrieved and where to store it.
An XML-handler for network weights.
SUMOTime getFirstLoadTime() const
returns the timestamp of the first loaded vehicle or flow
bool haveAllLoaded() const
returns whether loading is completed
void loadNext(SUMOTime step)
loads the next routes up to and including the given time step
void add(SUMORouteLoader *loader)
add another loader
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false, const bool isRoute=false, const bool isExternal=false, const bool catchExceptions=true)
Runs the given handler on the given file; returns if everything's ok.