Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/elements/GNECandidateElement.h
169678 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 GNECandidateElement.h
15
/// @author Pablo Alvarez Lopez
16
/// @date May 2020
17
///
18
// class for candidate elements
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
24
// ===========================================================================
25
// class definitions
26
// ===========================================================================
27
28
class GNECandidateElement {
29
30
public:
31
/// @brief Constructor
32
GNECandidateElement();
33
34
/// @brief Destructor
35
~GNECandidateElement();
36
37
/// @brief reset candidate flags
38
void resetCandidateFlags();
39
40
/// @brief check if this element is a possible candidate
41
bool isPossibleCandidate() const;
42
43
/// @brief check if this element is a source candidate
44
bool isSourceCandidate() const;
45
46
/// @brief check if this element is a target candidate
47
bool isTargetCandidate() const;
48
49
/// @brief check if this element is a special candidate
50
bool isSpecialCandidate() const;
51
52
/// @brief check if this element is a conflicted candidate
53
bool isConflictedCandidate() const;
54
55
/// @brief check if this element is a invalid candidate
56
bool isInvalidCandidate() const;
57
58
/// @brief set element as possible candidate
59
void setPossibleCandidate(const bool value);
60
61
/// @brief set element as source candidate
62
void setSourceCandidate(const bool value);
63
64
/// @brief set element as target candidate
65
void setTargetCandidate(const bool value);
66
67
/// @brief set element as special candidate
68
void setSpecialCandidate(const bool value);
69
70
/// @brief set element as conflicted candidate
71
void setConflictedCandidate(const bool value);
72
73
/// @brief set element as invalid candidate
74
void setInvalidCandidate(const bool value);
75
76
/// @name functions for reachability
77
/// @{
78
79
/// @brief get current reachability (traveltime)
80
double getReachability() const;
81
82
/// @brief set current reachability (traveltime)
83
void setReachability(const double reachability);
84
85
/// @brief reset reachability (traveltime)
86
void resetReachability();
87
88
/// @}
89
90
protected:
91
/// @brief flag to mark this element as possible candidate
92
bool myPossibleCandidate = false;
93
94
/// @brief flag to mark this element as source candidate
95
bool mySourceCandidate = false;
96
97
/// @brief flag to mark this element as target candidate
98
bool myTargetCandidate = false;
99
100
/// @brief flag to mark this element as special candidate
101
bool mySpecialCandidate = false;
102
103
/// @brief flag to mark this element as conflicted candidate
104
bool myConflictedCandidate = false;
105
106
/// @brief flag to mark this element as invalid candidate
107
bool myInvalidCandidate = false;
108
109
/// @brief value for reachability
110
double myReachability = -1;
111
112
private:
113
/// @brief Invalidated copy constructor.
114
GNECandidateElement(const GNECandidateElement&) = delete;
115
116
/// @brief Invalidated assignment operator
117
GNECandidateElement& operator=(const GNECandidateElement& src) = delete;
118
};
119
120