/****************************************************************************/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 AGActivityGenHandler.h16/// @author Piotr Woznica17/// @author Daniel Krajzewicz18/// @author Jakob Erdmann19/// @author Walter Bamberger20/// @date July 201021///22// The handler for parsing the statistics file.23/****************************************************************************/24#pragma once25#include <config.h>2627#include <string>28#include <utils/xml/SUMOSAXHandler.h>29#include <utils/common/UtilExceptions.h>30#include "city/AGCity.h"31#include "city/AGBusLine.h"323334// ===========================================================================35// class declarations36// ===========================================================================37class RONet;383940// ===========================================================================41// class definitions42// ===========================================================================43class AGActivityGenHandler : public SUMOSAXHandler {44public:45/** @brief Constructor46*47* @param[in] net The City instance to fill48*/49AGActivityGenHandler(AGCity& city, RONet* net);505152/// @brief Destructor53virtual ~AGActivityGenHandler();545556protected:57/// @name inherited from GenericSAXHandler58//@{5960/** @brief Called on the opening of a tag;61*62* @param[in] element ID of the currently opened element63* @param[in] attrs Attributes within the currently opened element64* @exception ProcessError If something fails65* @see GenericSAXHandler::myStartElement66*/67virtual void myStartElement(int element,68const SUMOSAXAttributes& attrs);69//@}7071protected:72/// @name called from myStartElement73//@{7475/**76* Parses attributes from an "general"-element in city file.77*/78void parseGeneralCityInfo(const SUMOSAXAttributes& attrs);79/*void parseInhabitants(const SUMOSAXAttributes &attrs);80void parseHouseholds(const SUMOSAXAttributes &attrs);81void parseChildrenAgeLimit(const SUMOSAXAttributes &attrs);82void parseRetirementAgeLimit(const SUMOSAXAttributes &attrs);83void parseCarRate(const SUMOSAXAttributes &attrs);84void parseUnemployment(const SUMOSAXAttributes &attrs);85void parseFootDistanceLimit(const SUMOSAXAttributes &attrs);86void parseIncomingTraffic(const SUMOSAXAttributes &attrs);87void parseOutgoingTraffic(const SUMOSAXAttributes &attrs);*/8889/**90* parse parameters, all are optional, default values are given.91*/92void parseParameters(const SUMOSAXAttributes& attrs);9394/**95* streets are extracted: it fills the streets list of the City object96* an additional computation is needed to normalize the number of inhabitants (and workpositions) in each street97*/98void parseStreets(const SUMOSAXAttributes& attrs);99100/**101* parse city entrances: the gates of the city, used for incoming and outgoing traffic102*/103void parseCityGates(const SUMOSAXAttributes& attrs);104105/**106* extraction of work opening and closing hours107*/108void parseWorkHours();109void parseOpeningHour(const SUMOSAXAttributes& attrs);110void parseClosingHour(const SUMOSAXAttributes& attrs);111112/**113* School extraction114*/115void parseSchools();116void parseSchool(const SUMOSAXAttributes& attrs);117118/**119* Bus stations and Bus extraction120* an additional computation have to be done to create buses' names and buses in the return way121*/122void parseBusStation(const SUMOSAXAttributes& attrs);123void parseBusLine(const SUMOSAXAttributes& attrs);124void parseStations();125void parseRevStations();126void parseStation(const SUMOSAXAttributes& attrs);127void parseFrequency(const SUMOSAXAttributes& attrs);128129/**130* population and children accompaniment bracket extraction131* then households and all population data will be computable132*/133void parsePopulation();134//void parseChildrenAccompaniment();135void parseBracket(const SUMOSAXAttributes& attrs);136137138protected:139/// @brief The city to store the information into140AGCity& myCity;141142/// @brief The name of the object that is currently processed143std::string myCurrentObject;144AGBusLine* currentBusLine;145146/// @brief indicator whether the current station (in bus line context) is a reverse station or not.147bool isRevStation;148149/// @brief The loaded network150RONet* net;151152/** @brief An indicator whether the next edge shall be read (internal edges are not read by now) */153bool myProcess;154155156private:157/// @brief Invalidated copy constructor158AGActivityGenHandler(const AGActivityGenHandler& src);159160/// @brief Invalidated assignment operator161AGActivityGenHandler& operator=(const AGActivityGenHandler& src);162163};164165166