Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
NIVissimTL.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
19// -------------------
20/****************************************************************************/
21#pragma once
22#include <config.h>
23
24
25#include <map>
26#include <string>
27#include <vector>
31
32
33// ===========================================================================
34// class declarations
35// ===========================================================================
37class NBLoadedTLDef;
38class NBEdgeCont;
39
40
41// ===========================================================================
42// class definitions
43// ===========================================================================
48public:
49 NIVissimTL(int id, const std::string& type, const std::string& name,
50 SUMOTime absdur, SUMOTime offset);
52// void computeBounding();
53 std::string getType() const;
54 int getID() const;
55
56public:
57 static bool dictionary(int id, const std::string& type,
58 const std::string& name, SUMOTime absdur, SUMOTime offset);
59 static bool dictionary(int id, NIVissimTL* o);
60 static NIVissimTL* dictionary(int id);
61// static std::vector<int> getWithin(const AbstractPoly &poly, double offset);
62 static void clearDict();
64 NBEdgeCont& ec);
65
66public:
67 class NIVissimTLSignal;
69 typedef std::map<int, NIVissimTLSignal*> SSignalDictType;
70 typedef std::map<int, NIVissimTLSignalGroup*> SGroupDictType;
71 typedef std::map<int, SSignalDictType> SignalDictType;
72 typedef std::map<int, SGroupDictType> GroupDictType;
73
78 public:
79 NIVissimTLSignal(int id, const std::string& name,
80 const std::vector<int>& groupids, int edgeid, int laneno,
81 double position, const std::vector<int>& assignedVehicleTypes);
83 bool isWithin(const PositionVector& poly) const;
84 Position getPosition() const;
85 bool addTo(NBEdgeCont& ec, NBLoadedTLDef* node) const;
86
87 public:
88 static bool dictionary(int lsaid, int id, NIVissimTLSignal* o);
89 static NIVissimTLSignal* dictionary(int lsaid, int id);
90 static void clearDict();
91 static SSignalDictType getSignalsFor(int tlid);
92
93 protected:
94 int myID;
95 std::string myName;
96 std::vector<int> myGroupIDs;
98 int myLane;
99 double myPosition;
100 std::vector<int> myVehicleTypes;
102 };
103
105 public:
106 NIVissimTLSignalGroup(int id, const std::string& name,
107 bool isGreenBegin, const std::vector<SUMOTime>& times,
108 SUMOTime tredyellow, SUMOTime tyellow);
110 bool addTo(NBLoadedTLDef* node) const;
111 public:
112 static bool dictionary(int lsaid, int id, NIVissimTLSignalGroup* o);
113 static NIVissimTLSignalGroup* dictionary(int lsaid, int id);
114 static void clearDict();
115 static SGroupDictType getGroupsFor(int tlid);
116
117 private:
118 int myID;
119 std::string myName;
120 std::vector<SUMOTime> myTimes;
124 };
125
126protected:
127 int myID;
128 std::string myName;
132 std::string myType;
133private:
134 typedef std::map<int, NIVissimTL*> DictType;
136};
long long int SUMOTime
Definition GUI.h:36
Storage for edges, including some functionality operating on multiple edges.
Definition NBEdgeCont.h:59
A loaded (complete) traffic light logic.
A container for traffic light definitions and built programs.
static bool dictionary(int lsaid, int id, NIVissimTLSignalGroup *o)
static SGroupDictType getGroupsFor(int tlid)
static GroupDictType myDict
Definition NIVissimTL.h:123
std::vector< SUMOTime > myTimes
Definition NIVissimTL.h:120
bool addTo(NBLoadedTLDef *node) const
bool isWithin(const PositionVector &poly) const
static bool dictionary(int lsaid, int id, NIVissimTLSignal *o)
bool addTo(NBEdgeCont &ec, NBLoadedTLDef *node) const
Position getPosition() const
std::vector< int > myVehicleTypes
Definition NIVissimTL.h:100
static SSignalDictType getSignalsFor(int tlid)
std::vector< int > myGroupIDs
Definition NIVissimTL.h:96
static SignalDictType myDict
Definition NIVissimTL.h:101
std::string myName
Definition NIVissimTL.h:128
static DictType myDict
Definition NIVissimTL.h:135
SUMOTime myAbsDuration
Definition NIVissimTL.h:129
NIVissimTLSignalGroup * myCurrentGroup
Definition NIVissimTL.h:131
std::map< int, NIVissimTLSignalGroup * > SGroupDictType
Definition NIVissimTL.h:70
static bool dict_SetSignals(NBTrafficLightLogicCont &tlc, NBEdgeCont &ec)
static bool dictionary(int id, const std::string &type, const std::string &name, SUMOTime absdur, SUMOTime offset)
std::map< int, SGroupDictType > GroupDictType
Definition NIVissimTL.h:72
static void clearDict()
std::string getType() const
std::string myType
Definition NIVissimTL.h:132
std::map< int, SSignalDictType > SignalDictType
Definition NIVissimTL.h:71
std::map< int, NIVissimTL * > DictType
Definition NIVissimTL.h:134
SUMOTime myOffset
Definition NIVissimTL.h:130
std::map< int, NIVissimTLSignal * > SSignalDictType
Definition NIVissimTL.h:69
int getID() const
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.