35#define REBUILD_ITERATION_LIMIT 2
43 tripSet->push_back(t);
48 std::list<AGTrip>::iterator it;
49 for (it = t.begin(); it != t.end(); ++it) {
50 tripSet->push_back(*it);
61 std::list<AGBusLine>::iterator itBL;
68 std::cerr <<
"ERROR: " << numbErr <<
" bus lines couldn't been completely generated ( " << (float)numbErr * 100.0 / (
float)
myCity->
busLines.size() <<
"% )..." << std::endl;
70 std::cout <<
"no problem during bus line trip generation..." << std::endl;
73 std::cout <<
"after public transportation: " <<
trips.size() << std::endl;
79 std::list<AGHousehold>::iterator itHH;
86 std::cout <<
"WARNING: " << numbErr <<
" ( " << (float)numbErr * 100.0 / (
float)
myCity->
households.size() <<
"% ) households' trips haven't been generated: would probably need more iterations for rebuilding..." << std::endl;
88 std::cout <<
"no problem during households' trips generation..." << std::endl;
91 std::cout <<
"after household activities: " <<
trips.size() << std::endl;
97 std::cerr <<
"ERROR while generating in/Out traffic..." << std::endl;
99 std::cout <<
"no problem during in/out traffic generation..." << std::endl;
102 std::cout <<
"after incoming/outgoing traffic: " <<
trips.size() << std::endl;
108 std::cerr <<
"ERROR while generating random traffic..." << std::endl;
110 std::cout <<
"no problem during random traffic generation..." << std::endl;
113 std::cout <<
"after random traffic: " <<
trips.size() << std::endl;
119 bool generated =
false;
120 std::list<AGTrip> temporaTrips;
122 if (!temporaTrips.empty()) {
123 temporaTrips.clear();
153 std::list<AGBus>::iterator itB;
154 std::list<AGPosition>::iterator itS;
158 for (itB = bl.
buses.begin(); itB != bl.
buses.end(); ++itB) {
208 std::list<AGAdult>::iterator itA;
213 AGTrip wayTrip(
myCity->
cityGates[posi], itA->getWorkPosition().getPosition(), nom, itA->getWorkPosition().getOpening());
216 AGTrip retTrip(itA->getWorkPosition().getPosition(),
myCity->
cityGates[posi], nom, itA->getWorkPosition().getClosing());
217 trips.push_back(wayTrip);
218 trips.push_back(retTrip);
226 std::ostringstream os;
228 return prefix + os.str();
234 int totalTrips = 0, ttOneDayTrips = 0, ttDailyTrips = 0;
235 std::list<AGTrip>::iterator it;
236 for (it =
trips.begin(); it !=
trips.end(); ++it) {
243 totalTrips = ttOneDayTrips + ttDailyTrips *
nbrDays;
245 std::cout <<
"Before Random traffic generation (days are still entire):" << std::endl;
246 std::cout <<
"- Total number of trips: " << totalTrips << std::endl;
247 std::cout <<
"- Total daily trips: " << ttDailyTrips << std::endl;
248 std::cout <<
"- Total one-day trips: " << ttOneDayTrips << std::endl;
254 std::cout <<
"added uniform random trips: " << nbrRandUni << std::endl;
256 for (
int i = 0; i < nbrRandUni; ++i) {
262 trips.push_back(rdtr);
#define REBUILD_ITERATION_LIMIT
std::list< AGTrip > trips
bool generateTrips(AGHousehold &hh)
bool generateBusTraffic(AGBusLine bl)
bool generateRandomTraffic()
void addTrips(std::list< AGTrip > t, std::list< AGTrip > *tripSet)
std::string generateName(int i, std::string prefix)
void generateActivityTrips()
void addTrip(AGTrip t, std::list< AGTrip > *tripSet)
bool generateInOutTraffic()
std::list< AGTrip > & getPartialActivityTrips()
std::list< AGPosition > stations
std::list< AGBus > revBuses
std::list< AGPosition > revStations
std::list< AGHousehold > households
std::vector< AGPosition > cityGates
AGDataAndStatistics & statData
std::list< AGBusLine > busLines
const AGStreet & getRandomStreet()
std::list< AGAdult > peopleIncoming
double uniformRandomTrafficRate
int getRandomCityGateByIncoming()
A location in the 2D plane freely positioned on a street.
int getTime()
: returns the number of seconds from the beginning of the first day of simulation this includes
AGPosition getDep() const
void setDepTime(int time)
void setType(std::string type)
AGPosition getArr() const
void addLayOver(AGPosition by)
int estimateDepTime(int arrTime, double secPerKm) const
static double rand(SumoRNG *rng=nullptr)
Returns a random real number in [0, 1)