Path: blob/main/src/netimport/vissim/tempstructs/NIVissimConflictArea.h
169684 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2002-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 NIVissimConflictArea.h14/// @author Lukas Grohmann15/// @date Aug 201516///17// -------------------18/****************************************************************************/19#pragma once20#include <config.h>212223#include <map>24#include <string>25#include <utils/common/StringUtils.h>26#include "NIVissimConnection.h"27#include <netbuild/NBEdgeCont.h>28#include <netbuild/NBEdge.h>29#include <netbuild/NBNode.h>303132// ===========================================================================33// class declarations34// ===========================================================================35363738// ===========================================================================39// class definitions40// ===========================================================================41/**42* @class NIVissimConflictArea43* @brief A temporary storage for conflict areas imported from Vissim44*/45class NIVissimConflictArea {46public:47/// Constructor48NIVissimConflictArea(int id, const std::string& link1,49const std::string& link2,50const std::string& status);515253/// Destructor54~NIVissimConflictArea();5556public:57/** @brief Adds the described item to the dictionary58Builds the conflict area first */59static bool dictionary(int id, const std::string& link1,60const std::string& link2, const std::string& status);6162/// Adds the conflict area to the dictionary63static bool dictionary(int id, NIVissimConflictArea* ca);6465/// Returns the named dictionary66static NIVissimConflictArea* dictionary(int id);6768/// Returns the conflict area from the dictionary, which defines69/// the priority rule of the two given links70static NIVissimConflictArea* dict_findByLinks(const std::string& link1,71const std::string& link2);7273/// Clears the dictionary74static void clearDict();7576/// Returns the dictionary including all conflict areas77static std::map<int, NIVissimConflictArea*> getConflictAreas() {78return myDict;79}8081/// Returns the ID of the conflic area82int getID() {83return myConflictID;84}8586/// Returns the first link of the conflic area87std::string getFirstLink() {88return myFirstLink;89}9091/// Returns the second link of the conflic area92std::string getSecondLink() {93return mySecondLink;94}9596/// Returns the priority regulation of the conflic area97std::string getStatus() {98return myStatus;99}100101/// Sets the priority regulation according to the VISSIM conflict area data102static void setPriorityRegulation(NBEdgeCont& ec);103104105106private:107/// The id of the conflict area108int myConflictID;109110/// The first link of the conflict area111std::string myFirstLink;112113/// The second link of the conflict area114std::string mySecondLink;115116/// The priority regulation of the conflict area117std::string myStatus;118119private:120/// @brief Definition of the dictionary type121typedef std::map<int, NIVissimConflictArea*> DictType;122123/// @brief The dictionary124static DictType myDict;125};126127128