114 if (trip.
getType() !=
"default") {
120 depTime += variation;
121 if (depTime.
getDay() > 0) {
134 if (trips.size() != 0) {
135 std::list<AGTrip>::iterator it;
137 int firstTrip = trips.front().getTime() + trips.front().getDay() * 86400;
138 int lastTrip = trips.front().getTime() + trips.front().getDay() * 86400;
139 std::map<int, int> histogram;
140 for (
int i = 0; i < 100; ++i) {
144 for (it = trips.begin(); it != trips.end(); ++it) {
147 if (it->getTime() + 86400 * it->getDay() > lastTrip) {
148 lastTrip = it->getTime() + 86400 * it->getDay();
150 if (it->getTime() + 86400 * it->getDay() < firstTrip) {
151 firstTrip = it->getTime() + 86400 * it->getDay();
154 ++histogram[(it->getTime()) / 3600];
162 for (
int i = 0; i < 100; ++i) {
163 if (histogram[i] > 0) {
164 std::cout <<
"histogram[ hour " << i <<
" ] = " << histogram[i] << std::endl;
168 std::cout <<
"No real trips were generated" << std::endl;
187 std::list<AGTrip> expTrips;
188 std::map<std::string, int> carUsed;
189 std::list<AGTrip>::iterator it;
191 for (it = acts.
trips.begin(); it != acts.
trips.end(); ++it) {
194 AGTrip tr(it->getDep(), it->getArr(), it->getVehicleName(), it->getTime(), currday);
201 std::ostringstream os;
207 expTrips.push_back(tr);
213 AGTrip tr(it->getDep(), it->getArr(), it->getVehicleName(), it->getTime(), it->getDay());
220 std::ostringstream os;
226 expTrips.push_back(tr);
233 std::cout <<
"total trips generated: " << acts.
trips.size() << std::endl;
234 std::cout <<
"total trips finally taken: " << expTrips.size() << std::endl;
240 std::cout <<
"...sorted by departure time.\n" << std::endl;
#define PROGRESS_DONE_MESSAGE()
#define PROGRESS_FAILED_MESSAGE()
#define PROGRESS_BEGIN_MESSAGE(msg)
std::list< AGTrip > trips
void generateActivityTrips()
bool timeTripValidation(const AGTrip &trip) const
validation: compatibility of the given trip
void generateOutputFile(std::list< AGTrip > &trips)
generate the output file (trips or routes) using a trip list
void importInfoCity()
build the internal city
void varDepTime(AGTrip &trip) const
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 addTrip(const AGTrip &trip)
void generateWorkPositions()
AGDataAndStatistics & statData
void generatePopulation()
double departureVariation
int getSecondsInCurrentDay()
void setVehicleName(std::string name)
void setDepTime(int time)
void addLayOverWithoutDestination(AGTrip &trip)
void setType(std::string type)
const std::string & getType() const
const std::string & getVehicleName() const
static double randNorm(double mean, double variance, SumoRNG *rng=nullptr)
Access to a random number from a normal distribution.
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.