Exemple #1
0
void
AGHousehold::generateCars(SUMOReal rate) {
    int peopleInNeed = static_cast<int>(adults.size()) - static_cast<int>(cars.size());
    while (peopleInNeed > 0) {
        if (decisionProba(rate)) {
            addACar();
        }
        --peopleInNeed;
    }
}
Exemple #2
0
void
AGHousehold::generateCars(SUMOReal rate) {
    int peopleInNeed = static_cast<int>(myAdults.size()) - static_cast<int>(myCars.size());
    while (peopleInNeed > 0) {
        if (RandHelper::rand() < rate) {
            addACar();
        }
        --peopleInNeed;
    }
}