/****************************************************************************/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 AGActivityGen.h16/// @author Piotr Woznica17/// @author Daniel Krajzewicz18/// @author Walter Bamberger19/// @author Michael Behrisch20/// @date July 201021///22// Main class that handles City, Activities and Trips23/****************************************************************************/24#pragma once25#include <config.h>2627#include "city/AGCity.h"282930// ===========================================================================31// class declarations32// ===========================================================================33class OutputDevice;34class RONet;35class AGTrip;363738// ===========================================================================39// class definitions40// ===========================================================================41/**42* @class AGActivityGen43* @brief Central object handling City, Activities and Trips44*/45class AGActivityGen {46public:47//AGActivityGen() {};48/** @brief Constructor49*50* @param[in] input input stat-file name (containing information about the city)51* @param[in] output xml file in which we'll write the routes generated52* @param[in] net network of the city53*/54AGActivityGen(std::string input, OutputDevice& output, RONet* net) :55inputFile(input),56outputFile(output),57net(net),58//activities(),59city(net) {};60/** @brief build the internal city61*62* TO CALL 1: First function to be called:63* imports the XML input file and generates the whole city.64*/65void importInfoCity();6667/**@brief build activities and trips of the population and generate routes68*69* TO CALL 2:70* generates City's Activity and the corresponding trips71*72* @param[in] days : duration of the simulation (>=0) (day of the end - day of the beginning)73* @param[in] beginTime : instant of the simulation beginning (in the first day)74* @param[in] endTime : instant of the simulation ending (in the last day)75* NOTE: if (days==0) : endTime > beginTime76*77* EXAMPLE: if days=1, endTime=0, beginTime=0: The duration78* will be 24 hours from 12am to 12amof the next day79*/80void makeActivityTrips(int days = 1, int beginTime = 0, int endTime = 0);8182protected:83// @brief xml file statistics on the city and generated routes84std::string inputFile;85/// @brief The generated routes86OutputDevice& outputFile;87// @brief network of the city88RONet* net;89//Activities activities;90// @brief city object containing all households and vehicles91AGCity city;92// @brief time of beginning and ending of the simulation and the duration of the simulation in days (min 1 day (beginning and end in the same day)93int durationInDays, beginTime, endTime;9495/**96* @brief validation: compatibility of the given trip97*98* @param[in] trip to be validated99*100* @returns whether the trip is compatible with the time boundaries or not.101* for this begin, end and duration of the simulation must be defined102*/103bool timeTripValidation(const AGTrip& trip) const;104/**105* @brief generate the output file (trips or routes) using a trip list106*107* @param[in] trips generated by the different activities108*/109void generateOutputFile(std::list<AGTrip>& trips);110/**111* @breif introduce a slight variation into the departure time of "default" vehicles112*113* @param[in] trip on which a random (normally distributed) variation will be tried114*/115void varDepTime(AGTrip& trip) const;116117private:118/// @brief invalidated assignment operator119AGActivityGen& operator=(const AGActivityGen&);120};121122123