Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/guinetload/GUITriggerBuilder.h
169667 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2004-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 GUITriggerBuilder.h
15
/// @author Daniel Krajzewicz
16
/// @author Sascha Krieg
17
/// @author Michael Behrisch
18
/// @author Jakob Erdmann
19
/// @author Johannes Rummel
20
/// @date Mon, 26.04.2004
21
///
22
// Builds trigger objects for guisim
23
/****************************************************************************/
24
#pragma once
25
#include <config.h>
26
27
#include <string>
28
#include <netload/NLTriggerBuilder.h>
29
#include <utils/common/RGBColor.h>
30
31
32
// ===========================================================================
33
// class declarations
34
// ===========================================================================
35
class MSTrigger;
36
class MSNet;
37
class MSLaneSpeedTrigger;
38
class MSCalibrator;
39
class MSTriggerControl;
40
41
42
// ===========================================================================
43
// class definitions
44
// ===========================================================================
45
/**
46
* @class GUITriggerBuilder
47
* @brief Builds trigger objects for guisim
48
*/
49
class GUITriggerBuilder : public NLTriggerBuilder {
50
public:
51
/// @brief Constructor
52
GUITriggerBuilder();
53
54
55
/// @brief Destructor
56
~GUITriggerBuilder();
57
58
59
protected:
60
/// @name building methods
61
///
62
/// Override NLTriggerBuilder-methods for building guisim-objects
63
/// @see NLTriggerBuilder
64
//@{
65
66
/** @brief Builds a lane speed trigger
67
*
68
* Simply calls the GUILaneSpeedTrigger constructor.
69
*
70
* @param[in] net The net the lane speed trigger belongs to
71
* @param[in] id The id of the lane speed trigger
72
* @param[in] destLanes List of lanes affected by this speed trigger
73
* @param[in] file Name of the file to read the speeds to set from
74
* @see MSLaneSpeedTrigger
75
* @exception ProcessError If the XML definition file is erroneous
76
*/
77
MSLaneSpeedTrigger* buildLaneSpeedTrigger(MSNet& net,
78
const std::string& id, const std::vector<MSLane*>& destLanes,
79
const std::string& file) override;
80
81
82
/** @brief builds an rerouter
83
*
84
* Simply calls the GUITriggeredRerouter constructor.
85
*
86
* @param[in] net The net the rerouter belongs to
87
* @param[in] id The id of the rerouter
88
* @param[in] edges The edges the rerouter is placed at
89
* @param[in] prob The probability the rerouter reroutes vehicles with
90
*/
91
MSTriggeredRerouter* buildRerouter(MSNet& net,
92
const std::string& id, MSEdgeVector& edges,
93
double prob, bool off, bool optional, SUMOTime timeThreshold,
94
const std::string& vTypes, const Position& pos, const double radius) override;
95
96
97
/** @brief Builds a bus stop
98
*
99
* Simply calls the GUIBusStop / GUIContainerStop constructor.
100
*
101
* @param[in] net The net the stop belongs to
102
* @param[in] id The id of the stop
103
* @param[in] lines Names of the lines that halt on this stop
104
* @param[in] lane The lane the stop is placed on
105
* @param[in] frompos Begin position of the stop on the lane
106
* @param[in] topos End position of the stop on the lane
107
* @param[in] element which kind of stop is to be built
108
* @exception InvalidArgument If the stop can not be added to the net (is duplicate)
109
*/
110
void buildStoppingPlace(MSNet& net, std::string id, std::vector<std::string> lines, MSLane* lane,
111
double frompos, double topos, const SumoXMLTag element, std::string string,
112
int personCapacity, double parkingLength, RGBColor& color, double angle) override;
113
114
115
/** @brief Builds a parking area
116
*
117
* Simply calls the GUIParkingArea constructor.
118
*
119
* @param[in] net The net the parking area belongs to
120
* @param[in] id The id of the parking area
121
* @param[in] lines Names of the lines that halt on this parking area
122
* @param[in] badges Names which grant access to this parking area
123
* @param[in] lane The lane the parking area is placed on
124
* @param[in] frompos Begin position of the parking area on the lane
125
* @param[in] topos End position of the parking area on the lane
126
* @param[in] capacity Capacity of the parking area
127
* @param[in] width Width of the default lot rectangle
128
* @param[in] length Length of the default lot rectangle
129
* @param[in] angle Angle of the default lot rectangle
130
* @exception InvalidArgument If the parking area can not be added to the net (is duplicate)
131
*/
132
void beginParkingArea(MSNet& net, const std::string& id,
133
const std::vector<std::string>& lines, const std::vector<std::string>& badges,
134
MSLane* lane, double frompos, double topos,
135
unsigned int capacity,
136
double width, double length, double angle, const std::string& name,
137
bool onRoad,
138
const std::string& departPos,
139
bool lefthand) override;
140
141
142
/** @brief Builds a charging station
143
*
144
* Simply calls the GUIChargingStation constructor.
145
*
146
* @param[in] net The net the charging station belongs to
147
* @param[in] id The id of the charging station
148
* @param[in] lane The lane the charging station is placed on
149
* @param[in] frompos Begin position of the charging station on the lane
150
* @param[in] topos End position of the charging station on the lane
151
* @param[in] chargingPower energy charged in every timeStep
152
* @param[in] efficiency efficiency of the charge
153
* @param[in] chargeInTransit enable or disable charge in transit
154
* @param[in] chargeDelay delay in the charge
155
* @param[in] chargeType charge type (normal, electric or fuel)
156
* @param[in] waitingTime waiting time until start charging
157
* @param[in] parkingArea The associated parking area
158
* @exception InvalidArgument If the charging station can not be added to the net (is duplicate)
159
*/
160
void buildChargingStation(MSNet& net, const std::string& id, MSLane* lane, double frompos, double topos, const std::string& name,
161
double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, std::string chargeType,
162
SUMOTime waitingTime, MSParkingArea* parkingArea) override;
163
164
165
/** @brief Builds an overhead wire segment
166
*
167
* Simply calls the GUIOverheadWire constructor and adds the result to the network.
168
*
169
* @param[in] net The net the overhead wire segment belongs to
170
* @param[in] id The id of the overhead wire segment
171
* @param[in] lane The lane the overhead wire segment is placed on
172
* @param[in] frompos Begin position of the overhead wire segment on the lane
173
* @param[in] topos End position of the overhead wire segment on the lane
174
* @param[in] voltageSource If the segment is the place of the connection of a traction substation
175
* @exception InvalidArgument If the overhead wire segment can not be added to the net (is duplicate according to the id)
176
*/
177
void buildOverheadWireSegment(MSNet& net, const std::string& id, MSLane* lane,
178
double frompos, double topos, bool voltageSource) override;
179
180
/** @brief Builds an overhead wire clamp
181
*
182
* Simply calls the GUIOverheadWireClamp constructor and adds the result to the network.
183
*
184
* @param[in] net The net the overhead wire clamp belongs to
185
* @param[in] id The id of the overhead wire clamp
186
* @param[in] lane_start The lane, where is the overhead wire segment placed, to the start of which the overhead wire clamp is connected
187
* @param[in] lane_end The lane, where is the overhead wire segment placed, to the end of which the overhead wire clamp is connected
188
*/
189
void buildOverheadWireClamp(MSNet& net, const std::string& id, MSLane* lane_start, MSLane* lane_end) override;
190
/// @}
191
192
193
/** @brief End a parking area
194
* (it must be added to the SUMORTree after all parking spaces are loaded
195
*/
196
void endParkingArea() override;
197
198
/** @brief End a stopping place
199
*
200
* @exception InvalidArgument If the current stopping place is 0
201
*/
202
void endStoppingPlace() override;
203
};
204
205