Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
AGActivity.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2010-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/****************************************************************************/
23// Parent object for all activities. Derived classes generate trips for each
24// household.
25/****************************************************************************/
26#pragma once
27#include <config.h>
28
29#include "AGTrip.h"
31
32
33// ===========================================================================
34// class declarations
35// ===========================================================================
36class AGHousehold;
37
38
39// ===========================================================================
40// class definitions
41// ===========================================================================
43public:
44 AGActivity(AGHousehold* hh, AGDataAndStatistics* das, std::list<AGTrip>* prevTrips, int prio) :
45 myHousehold(hh),
46 myStatData(das),
47 myPreviousTrips(prevTrips),
48 activityPriority(prio),
49 genDone(false),
50 timePerKm(das->speedTimePerKm),
52
54 virtual ~AGActivity() {}
55
59 bool isGenerated();
60
65 virtual bool generateTrips() = 0;
66
75 int possibleTranspMean(AGPosition destination);
76
87
91 int timeToDrive(AGPosition from, AGPosition to);
92
97 int depHour(AGPosition from, AGPosition to, int arrival);
98 int arrHour(AGPosition from, AGPosition to, int departure);
99
103 int randomTimeBetween(int begin, int end);
104
105 std::list<AGTrip>& getPartialActivityTrips();
106
107protected:
109
111
112 std::list<AGTrip>* myPreviousTrips;
113 std::list<AGTrip> myPartialActivityTrips;
116 double timePerKm;
121
122};
double carPreference
Definition AGActivity.h:120
std::list< AGTrip > & getPartialActivityTrips()
bool isGenerated()
AGActivity(AGHousehold *hh, AGDataAndStatistics *das, std::list< AGTrip > *prevTrips, int prio)
Definition AGActivity.h:44
std::list< AGTrip > * myPreviousTrips
Definition AGActivity.h:112
virtual bool generateTrips()=0
AGHousehold * myHousehold
Definition AGActivity.h:108
std::list< AGTrip > myPartialActivityTrips
Definition AGActivity.h:113
virtual ~AGActivity()
empty destructor
Definition AGActivity.h:54
int availableTranspMeans(AGPosition from, AGPosition to)
AGDataAndStatistics * myStatData
Definition AGActivity.h:110
int possibleTranspMean(AGPosition destination)
int depHour(AGPosition from, AGPosition to, int arrival)
double timePerKm
Definition AGActivity.h:116
int arrHour(AGPosition from, AGPosition to, int departure)
int randomTimeBetween(int begin, int end)
int activityPriority
Definition AGActivity.h:114
int timeToDrive(AGPosition from, AGPosition to)
A location in the 2D plane freely positioned on a street.
Definition AGPosition.h:53