Line data Source code
1 : /****************************************************************************/
2 : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 : // Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4 : // activitygen module
5 : // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
6 : // This program and the accompanying materials are made available under the
7 : // terms of the Eclipse Public License 2.0 which is available at
8 : // https://www.eclipse.org/legal/epl-2.0/
9 : // This Source Code may also be made available under the following Secondary
10 : // Licenses when the conditions for such availability set forth in the Eclipse
11 : // Public License 2.0 are satisfied: GNU General Public License, version 2
12 : // or later which is available at
13 : // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
14 : // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
15 : /****************************************************************************/
16 : /// @file AGActivities.h
17 : /// @author Piotr Woznica
18 : /// @author Daniel Krajzewicz
19 : /// @author Walter Bamberger
20 : /// @date July 2010
21 : ///
22 : // Main class that manages activities taken in account and generates the
23 : // inhabitants' trip list.
24 : /****************************************************************************/
25 : #pragma once
26 : #include <config.h>
27 :
28 : #include <list>
29 : #include "AGTrip.h"
30 : #include <activitygen/city/AGCity.h>
31 : #include <activitygen/city/AGBusLine.h>
32 : #include <activitygen/city/AGHousehold.h>
33 :
34 :
35 : // ===========================================================================
36 : // class definitions
37 : // ===========================================================================
38 : class AGActivities {
39 : public:
40 9 : AGActivities(AGCity* city, int days) :
41 9 : myCity(city),
42 9 : nbrDays(days) {};
43 : void addTrip(AGTrip t, std::list<AGTrip>* tripSet);
44 : void addTrips(std::list<AGTrip> t, std::list<AGTrip>* tripSet);
45 : void generateActivityTrips();
46 :
47 : /**
48 : * trips contains trips as well for one day as for every day,
49 : * these trips will be regenerated with small variations
50 : * by ActivityGen at the end of the simulation
51 : * before generating the trip file
52 : */
53 : std::list<AGTrip> trips;
54 :
55 : private:
56 : bool generateTrips(AGHousehold& hh);
57 : bool generateBusTraffic(AGBusLine bl);
58 : bool generateInOutTraffic();
59 : bool generateRandomTraffic();
60 :
61 : /**
62 : * generates car names, given the unique (number, prefix)
63 : */
64 : std::string generateName(int i, std::string prefix);
65 :
66 : AGCity* myCity;
67 :
68 : int nbrDays;
69 :
70 : };
|