/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file NLDiscreteEventBuilder.h14/// @author Daniel Krajzewicz15/// @author Michael Behrisch16/// @date Sep, 200317///18// missing_desc19/****************************************************************************/20#pragma once21#include <config.h>2223#include <string>24#include <map>25#include <utils/xml/GenericSAXHandler.h>262728// ===========================================================================29// class declarations30// ===========================================================================31class MSNet;323334// ===========================================================================35// class definitions36// ===========================================================================37/**38* @class NLDiscreteEventBuilder39* This class is responsible for building event-handling actions which40* the simulation shall execute.41*/42class NLDiscreteEventBuilder {43public:44/// Known action types45enum ActionType {46/// "SaveTLSStates"47EV_SAVETLSTATE,48/// "SaveTLSSwitchTimes"49EV_SAVETLSWITCHES,50/// "SaveTLSSwitchStates"51EV_SAVETLSWITCHSTATES,52/// "SaveTLSProgram"53EV_SAVETLSPROGRAM54};5556/// Constructor57NLDiscreteEventBuilder(MSNet& net);5859/// Destructor60~NLDiscreteEventBuilder();6162/// Builds an action and saves it for further use63void addAction(const SUMOSAXAttributes& attrs, const std::string& basePath);6465private:66/// Builds an action which saves the state of a certain tls into a file67void buildSaveTLStateCommand(const SUMOSAXAttributes& attrs, const std::string& basePath);6869/// Builds an action which saves the switch times of links into a file70void buildSaveTLSwitchesCommand(const SUMOSAXAttributes& attrs, const std::string& basePath);7172/// Builds an action which saves the switch times and states of tls into a file73void buildSaveTLSwitchStatesCommand(const SUMOSAXAttributes& attrs, const std::string& basePath);7475/// Builds an action which saves the tls states as a loadable program into a file76void buildSaveTLSProgramCommand(const SUMOSAXAttributes& attrs, const std::string& basePath);7778private:79NLDiscreteEventBuilder& operator=(const NLDiscreteEventBuilder&); // just to avoid a compiler warning8081protected:82/// Definitions of a storage for build actions83typedef std::map<std::string, ActionType> KnownActions;8485/// Build actions that shall be executed during the simulation86KnownActions myActions;8788MSNet& myNet;8990};919293