 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
115 if (trip.
getType() !=
"default") {
121 depTime += variation;
122 if (depTime.
getDay() > 0) {
135 if (trips.size() != 0) {
136 std::list<AGTrip>::iterator it;
138 int firstTrip = trips.front().getTime() + trips.front().getDay() * 86400;
139 int lastTrip = trips.front().getTime() + trips.front().getDay() * 86400;
140 std::map<int, int> histogram;
141 for (
int i = 0; i < 100; ++i) {
145 for (it = trips.begin(); it != trips.end(); ++it) {
148 if (it->getTime() + 86400 * it->getDay() > lastTrip) {
149 lastTrip = it->getTime() + 86400 * it->getDay();
151 if (it->getTime() + 86400 * it->getDay() < firstTrip) {
152 firstTrip = it->getTime() + 86400 * it->getDay();
155 ++histogram[(it->getTime()) / 3600];
163 for (
int i = 0; i < 100; ++i) {
164 if (histogram[i] > 0) {
165 std::cout <<
"histogram[ hour " << i <<
" ] = " << histogram[i] << std::endl;
169 std::cout <<
"No real trips were generated" << std::endl;
188 std::list<AGTrip> expTrips;
189 std::map<std::string, int> carUsed;
190 std::list<AGTrip>::iterator it;
192 for (it = acts.
trips.begin(); it != acts.
trips.end(); ++it) {
195 AGTrip tr(it->getDep(), it->getArr(), it->getVehicleName(), it->getTime(), currday);
202 std::ostringstream os;
208 expTrips.push_back(tr);
214 AGTrip tr(it->getDep(), it->getArr(), it->getVehicleName(), it->getTime(), it->getDay());
221 std::ostringstream os;
227 expTrips.push_back(tr);
234 std::cout <<
"total trips generated: " << acts.
trips.size() << std::endl;
235 std::cout <<
"total trips finally taken: " << expTrips.size() << std::endl;
241 std::cout <<
"...sorted by departure time.\n" << std::endl;
int getSecondsInCurrentDay()
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
void addLayOverWithoutDestination(AGTrip &trip)
#define PROGRESS_FAILED_MESSAGE()
void generateWorkPositions()
void varDepTime(AGTrip &trip) const
std::list< AGTrip > trips
const std::string & getType() const
static double randNorm(double mean, double variance, std::mt19937 *rng=0)
Access to a random number from a normal distribution.
double departureVariation
OutputDevice & outputFile
The generated routes.
void makeActivityTrips(int days=1, int beginTime=0, int endTime=0)
build activities and trips of the population and generate routes
void setType(std::string type)
void generatePopulation()
void generateOutputFile(std::list< AGTrip > &trips)
generate the output file (trips or routes) using a trip list
void addTrip(const AGTrip &trip)
void generateActivityTrips()
bool timeTripValidation(const AGTrip &trip) const
validation: compatibility of the given trip
#define PROGRESS_BEGIN_MESSAGE(msg)
#define PROGRESS_DONE_MESSAGE()
void setDepTime(int time)
void setVehicleName(std::string name)
const std::string & getVehicleName() const
void importInfoCity()
build the internal city
AGDataAndStatistics & statData