/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2010-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 AGActivity.h16/// @author Piotr Woznica17/// @author Daniel Krajzewicz18/// @author Walter Bamberger19/// @author Michael Behrisch20/// @date July 201021///22// Parent object for all activities. Derived classes generate trips for each23// household.24/****************************************************************************/25#pragma once26#include <config.h>2728#include "AGTrip.h"29#include <activitygen/city/AGDataAndStatistics.h>303132// ===========================================================================33// class declarations34// ===========================================================================35class AGHousehold;363738// ===========================================================================39// class definitions40// ===========================================================================41class AGActivity {42public:43AGActivity(AGHousehold* hh, AGDataAndStatistics* das, std::list<AGTrip>* prevTrips, int prio) :44myHousehold(hh),45myStatData(das),46myPreviousTrips(prevTrips),47activityPriority(prio),48genDone(false),49timePerKm(das->speedTimePerKm),50carPreference(das->carPreference) {};5152/// @brief empty destructor53virtual ~AGActivity() {}5455/**56* returns whether the generation could have been well done57*/58bool isGenerated();5960/**61* main function called for trip generation62* this function is overwritten in every child-class (every activity)63*/64virtual bool generateTrips() = 0;6566/**67* determine the possible transportation means, what would be chosen:68* 1 = foot69* 2 = bus70* 4 = car71* any combination is possible by simply addition of these values72* (ex. 7 means: 4+2+1 <=> foot, bus and car possible / 5 means: 4+1 <=> only foot and car are possible)73*/74int possibleTranspMean(AGPosition destination);7576/**77* determine the possible means for a trip from one position to a destination.78* whether CAR is necessary or not, BUS available or not...79* 1 = by foot possible.80* 2 = by bus possible.81* 0 = by bus or foot NOT possible => only by car.82* @NOTE: 4 is useless because it is always possible83* @NOTE: 3 = 2 + 1 = means bus and foot possible.84*/85int availableTranspMeans(AGPosition from, AGPosition to);8687/**88* evaluation of the needed time for going from one point to an other using the car89*/90int timeToDrive(AGPosition from, AGPosition to);9192/**93* estimates the departure/arrival time given the departure location94* the arrival location and the wished arrival/departure time95*/96int depHour(AGPosition from, AGPosition to, int arrival);97int arrHour(AGPosition from, AGPosition to, int departure);9899/**100* evaluates a random time between the given two time instants101*/102int randomTimeBetween(int begin, int end);103104std::list<AGTrip>& getPartialActivityTrips();105106protected:107AGHousehold* myHousehold;108109AGDataAndStatistics* myStatData;110111std::list<AGTrip>* myPreviousTrips;112std::list<AGTrip> myPartialActivityTrips;113int activityPriority;114bool genDone;115double timePerKm;116/**117* rate of taking the car instead of the bus because of personal preference118*/119double carPreference;120121};122123124