SUMO - Simulation of Urban MObility
|
#include <config.h>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <cstdlib>
#include <string>
#include <xercesc/parsers/SAXParser.hpp>
#include <xercesc/sax2/SAX2XMLReader.hpp>
#include <utils/options/Option.h>
#include <utils/options/OptionsCont.h>
#include <utils/options/OptionsIO.h>
#include <utils/common/MsgHandler.h>
#include <utils/common/UtilExceptions.h>
#include <utils/common/SystemFrame.h>
#include <utils/common/RandHelper.h>
#include <utils/common/ToString.h>
#include <utils/xml/XMLSubSys.h>
#include <utils/common/StringUtils.h>
#include <od2trips/ODDistrictCont.h>
#include <od2trips/ODDistrictHandler.h>
#include <od2trips/ODMatrix.h>
#include <utils/common/TplConvert.h>
#include <utils/common/SUMOTime.h>
#include <utils/common/StringTokenizer.h>
#include <utils/common/FileHelpers.h>
#include <utils/common/SUMOVehicleParameter.h>
#include <utils/importio/LineReader.h>
#include <utils/iodevices/OutputDevice.h>
Go to the source code of this file.
Functions | |
bool | checkOptions () |
void | fillOptions () |
std::string | getNextNonCommentLine (LineReader &lr) |
void | loadDistricts (ODDistrictCont &districts, OptionsCont &oc) |
void | loadMatrix (OptionsCont &oc, ODMatrix &into) |
int | main (int argc, char **argv) |
SUMOTime | parseSingleTime (const std::string &time) |
Distribution_Points | parseTimeLine (const std::vector< std::string > &def, bool timelineDayInHours) |
SUMOReal | readFactor (LineReader &lr, SUMOReal scale) |
void | readO (LineReader &lr, ODMatrix &into, SUMOReal scale, std::string vehType, bool matrixHasVehType) |
std::pair< SUMOTime, SUMOTime > | readTime (LineReader &lr) |
void | readV (LineReader &lr, ODMatrix &into, SUMOReal scale, std::string vehType, bool matrixHasVehType) |
Definition in file od2trips_main.cpp.
bool checkOptions | ( | ) |
Definition at line 201 of file od2trips_main.cpp.
References SUMOVehicleParameter::arrivallaneValidate(), SUMOVehicleParameter::arrivalposValidate(), SUMOVehicleParameter::arrivalspeedValidate(), SUMOVehicleParameter::departlaneValidate(), SUMOVehicleParameter::departposValidate(), SUMOVehicleParameter::departspeedValidate(), OptionsCont::getOptions(), OptionsCont::getString(), OptionsCont::isSet(), and WRITE_ERROR.
void fillOptions | ( | ) |
Definition at line 77 of file od2trips_main.cpp.
References OptionsCont::addCallExample(), SystemFrame::addConfigurationOptions(), OptionsCont::addDescription(), OptionsCont::addOptionSubTopic(), SystemFrame::addReportOptions(), OptionsCont::addSynonyme(), OptionsCont::doRegister(), OptionsCont::getOptions(), RandHelper::insertRandOptions(), and SUMOTIME_MAXSTRING.
std::string getNextNonCommentLine | ( | LineReader & | lr | ) |
Definition at line 251 of file od2trips_main.cpp.
References LineReader::good(), LineReader::hasMore(), StringUtils::prune(), and LineReader::readLine().
Referenced by readFactor(), readO(), readTime(), and readV().
void loadDistricts | ( | ODDistrictCont & | districts, |
OptionsCont & | oc | ||
) |
Definition at line 228 of file od2trips_main.cpp.
References FileHelpers::exists(), OptionsCont::getString(), OptionsCont::isSet(), PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, PROGRESS_FAILED_MESSAGE, XMLSubSys::runParser(), and WRITE_ERROR.
Referenced by main().
void loadMatrix | ( | OptionsCont & | oc, |
ODMatrix & | into | ||
) |
Definition at line 425 of file od2trips_main.cpp.
References OptionsCont::getFloat(), OptionsCont::getString(), OptionsCont::getStringVector(), LineReader::good(), LineReader::readLine(), readO(), and readV().
Referenced by main().
Definition at line 466 of file od2trips_main.cpp.
References ODMatrix::applyCurve(), checkOptions(), SystemFrame::close(), OutputDevice::closeAll(), OutputDevice::createDeviceByOption(), fillOptions(), OptionsCont::getBool(), OutputDevice::getDeviceByOption(), MsgHandler::getErrorInstance(), ODMatrix::getNoDiscarded(), ODMatrix::getNoLoaded(), ODMatrix::getNoWritten(), OptionsIO::getOptions(), OptionsCont::getOptions(), OptionsCont::getString(), OptionsCont::getStringVector(), MsgHandler::inform(), XMLSubSys::init(), MsgHandler::initOutputOptions(), RandHelper::initRandGlobal(), OptionsCont::isSet(), loadDistricts(), loadMatrix(), parseTimeLine(), OptionsCont::processMetaOptions(), OptionsCont::setApplicationDescription(), OptionsCont::setApplicationName(), NamedObjectCont< T >::size(), string2time(), toString(), VERSION_STRING, ODMatrix::write(), WRITE_ERROR, and WRITE_MESSAGE.
SUMOTime parseSingleTime | ( | const std::string & | time | ) |
Definition at line 264 of file od2trips_main.cpp.
References TplConvert< E >::_2int().
Referenced by readTime().
Distribution_Points parseTimeLine | ( | const std::vector< std::string > & | def, |
bool | timelineDayInHours | ||
) |
Definition at line 171 of file od2trips_main.cpp.
References TplConvert< E >::_2int(), TplConvert< E >::_2SUMOReal(), StringTokenizer::next(), PositionVector::push_back(), StringTokenizer::size(), SUMOReal, and toString().
Referenced by main().
SUMOReal readFactor | ( | LineReader & | lr, |
SUMOReal | scale | ||
) |
Definition at line 294 of file od2trips_main.cpp.
References TplConvert< E >::_2SUMOReal(), getNextNonCommentLine(), and SUMOReal.
void readO | ( | LineReader & | lr, |
ODMatrix & | into, | ||
SUMOReal | scale, | ||
std::string | vehType, | ||
bool | matrixHasVehType | ||
) |
Definition at line 376 of file od2trips_main.cpp.
References TplConvert< E >::_2int(), TplConvert< E >::_2SUMOReal(), ODMatrix::add(), LineReader::getFileName(), getNextNonCommentLine(), LineReader::hasMore(), StringTokenizer::next(), PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, StringUtils::prune(), readFactor(), readTime(), StringTokenizer::size(), SUMOReal, toString(), and StringTokenizer::WHITECHARS.
Referenced by loadMatrix().
std::pair<SUMOTime, SUMOTime> readTime | ( | LineReader & | lr | ) |
Definition at line 275 of file od2trips_main.cpp.
References getNextNonCommentLine(), StringTokenizer::next(), parseSingleTime(), and StringTokenizer::WHITECHARS.
void readV | ( | LineReader & | lr, |
ODMatrix & | into, | ||
SUMOReal | scale, | ||
std::string | vehType, | ||
bool | matrixHasVehType | ||
) |
Definition at line 308 of file od2trips_main.cpp.
References TplConvert< E >::_2int(), TplConvert< E >::_2SUMOReal(), ODMatrix::add(), LineReader::getFileName(), getNextNonCommentLine(), LineReader::hasMore(), StringTokenizer::hasNext(), StringTokenizer::next(), PROGRESS_BEGIN_MESSAGE, PROGRESS_DONE_MESSAGE, StringUtils::prune(), readFactor(), readTime(), SUMOReal, and StringTokenizer::WHITECHARS.
Referenced by loadMatrix().