Path: blob/main/src/activitygen/activities/AGWorkAndSchool.h
169678 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// activitygen module4// Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)5// This program and the accompanying materials are made available under the6// terms of the Eclipse Public License 2.0 which is available at7// https://www.eclipse.org/legal/epl-2.0/8// This Source Code may also be made available under the following Secondary9// Licenses when the conditions for such availability set forth in the Eclipse10// Public License 2.0 are satisfied: GNU General Public License, version 211// or later which is available at12// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html13// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later14/****************************************************************************/15/// @file AGWorkAndSchool.h16/// @author Piotr Woznica17/// @author Daniel Krajzewicz18/// @author Walter Bamberger19/// @date July 201020///21// Generates trips to work and to school22/****************************************************************************/23#pragma once24#include <config.h>2526#include <activitygen/city/AGHousehold.h>27#include <activitygen/city/AGPosition.h>28#include "AGActivity.h"293031// ===========================================================================32// class definitions33// ===========================================================================34class AGWorkAndSchool : public AGActivity {35public:36AGWorkAndSchool(AGHousehold* hh, AGDataAndStatistics* das, std::list<AGTrip>* prevTrips) :37AGActivity(hh, das, prevTrips, 1) {};3839/**40* @Overwrite41*/42bool generateTrips();4344/**45* generate objects46*/47//void buildDestinations();48void buildChildrenAccompaniment();49void buildWorkDestinations();5051/**52* allocation of cars to the convenient adult:53* the adult able to accompany the other (adult) and children in need.54*/55void carAllocation();5657/**58* trip generation for adults and children59*/60bool carsToTrips();6162/**63* returns true if there is an unused car that can be driven by an adult64*/65bool isThereUnusedCar();6667/**68* main function of Accompaniment trip management:69* simple trips are analyzed whether they can be grouped together or not.70* return true if every thing worked well71*/72bool checkAndBuildTripConsistancy();7374/**75* checks whether the driver is able to accompany all people76* or if the others have to go too late to work for him77*/78bool checkDriversScheduleMatching();7980/**81* function generating Trip objects using the local objects82*/83void generateListTrips();8485/**86* function adding new drivers when a not used car is needed87* + when the person prefer the car to the bus (choice variable)88*/89void makePossibleDriversDrive();9091/**92* return the name of a car that is not used by another adult driver of the household93* in fact there is only 1 or 2 adults, so if the number of cars is greater that 194* at least one car isn't used95*/96std::string getUnusedCar();9798private:99/**100* list of destinations for children, which can be reach only using a car (too far from home)101* and therefore need to be accompanied:102* waiting list for the accompaniment103*/104//std::list<Position> childrenCarAccompaniment;105std::list<AGChild> childrenNeedingCarAccompaniment;106/**107* adult needing a car having a car but this car is not available because of an other person108*/109//std::list<Position> adultCarAccompaniment;110std::list<AGAdult> adultNeedingCarAccompaniment;111/**112* list of destinations for work by bus or car,113* car being possible (other wise bus or feet)114*/115//std::list<Position> workDestinations;116std::list<AGAdult> workingPeoplePossCar;117/**118* work destinations with use of car119*/120//std::list<Position> carDestinations;121std::list<AGAdult> personsDrivingCars;122/**123* adults of the household who are not in need of car for work124* but are able to accompany someone. used only in case of need.125*/126std::list<AGAdult> notNeedingDrivers;127/**128* list of temporary trips:129* contains accompaniment trips without any return to home.130*/131std::list<AGTrip> tempAccTrip;132std::list<AGTrip> tempTrip;133};134135136