Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/microsim/MSLogicJunction.h
185785 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 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
/****************************************************************************/
14
/// @file MSLogicJunction.h
15
/// @author Christian Roessel
16
/// @author Daniel Krajzewicz
17
/// @author Michael Behrisch
18
/// @author Jakob Erdmann
19
/// @date Wed, 12 Dez 2001
20
///
21
// with one ore more logics.
22
/****************************************************************************/
23
#pragma once
24
#include <config.h>
25
26
#include "MSJunction.h"
27
#include <utils/common/SUMOTime.h>
28
#include <utils/common/StdDefs.h>
29
#include <bitset>
30
#include <vector>
31
32
33
// ===========================================================================
34
// class declarations
35
// ===========================================================================
36
class MSLane;
37
38
39
// ===========================================================================
40
// class definitions
41
// ===========================================================================
42
/**
43
* @class MSLogicJunction
44
* A junction which may not let all vehicles through, but must perform any
45
* kind of an operation to determine which cars are allowed to drive in this
46
* step.
47
*/
48
class MSLogicJunction : public MSJunction {
49
public:
50
51
52
/// Destructor.
53
virtual ~MSLogicJunction();
54
55
/** @brief Container for link response and foes */
56
typedef std::bitset<SUMO_MAX_CONNECTIONS> LinkBits;
57
58
/// initialises the junction after the whole net has been loaded
59
virtual void postloadInit();
60
61
/** @brief Returns all internal lanes on the junction
62
*/
63
const std::vector<MSLane*> getInternalLanes() const;
64
65
protected:
66
/** @brief Constructor
67
* @param[in] id The id of the junction
68
* @param[in] id The type of the junction
69
* @param[in] position The position of the junction
70
* @param[in] shape The shape of the junction
71
* @param[in] incoming The incoming lanes
72
* @param[in] internal The internal lanes
73
*/
74
MSLogicJunction(const std::string& id,
75
SumoXMLNodeType type,
76
const Position& position,
77
const PositionVector& shape,
78
const std::string& name,
79
std::vector<MSLane*> incoming,
80
std::vector<MSLane*> internal
81
);
82
83
protected:
84
/// list of incoming lanes
85
std::vector<MSLane*> myIncomingLanes;
86
87
/// list of internal lanes
88
std::vector<MSLane*> myInternalLanes;
89
90
private:
91
/// @brief Invalidated copy constructor.
92
MSLogicJunction(const MSLogicJunction&);
93
94
/// @brief Invalidated assignment operator.
95
MSLogicJunction& operator=(const MSLogicJunction&);
96
97
};
98
99