Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/tools/VTypesHandler.h
169666 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2014-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 VTypesHandler.h
15
/// @author Jakob Erdmann
16
/// @date 12.01.2022
17
///
18
// An XML-Handler for reading vTypes
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <string>
24
#include <utility>
25
#include <utils/vehicle/SUMORouteHandler.h>
26
27
class EnergyParams;
28
29
// ===========================================================================
30
// class definitions
31
// ===========================================================================
32
/**
33
* @class VTypesHandler
34
* @brief An XML-Handler for amitran and netstate trajectories
35
*
36
* This SUMOSAXHandler parses vehicles and their speeds.
37
*/
38
class VTypesHandler : public SUMORouteHandler {
39
public:
40
static const int INVALID_VALUE = -999999;
41
42
public:
43
/** @brief Constructor
44
*
45
* @param[in] file The file that will be processed
46
*/
47
VTypesHandler(const std::string& file, std::map<std::string, SUMOVTypeParameter*>& vTypes);
48
49
50
/// @brief Destructor
51
~VTypesHandler();
52
53
void closeVType();
54
void openVehicleTypeDistribution(const SUMOSAXAttributes& attrs) {
55
UNUSED_PARAMETER(attrs);
56
}
57
void closeVehicleTypeDistribution() {}
58
void openRoute(const SUMOSAXAttributes& attrs) {
59
UNUSED_PARAMETER(attrs);
60
}
61
void openFlow(const SUMOSAXAttributes& attrs) {
62
UNUSED_PARAMETER(attrs);
63
}
64
void openRouteFlow(const SUMOSAXAttributes& attrs) {
65
UNUSED_PARAMETER(attrs);
66
}
67
void openTrip(const SUMOSAXAttributes& attrs) {
68
UNUSED_PARAMETER(attrs);
69
}
70
void closeRoute(const bool mayBeDisconnected = false) {
71
UNUSED_PARAMETER(mayBeDisconnected);
72
}
73
void openRouteDistribution(const SUMOSAXAttributes& attrs) {
74
UNUSED_PARAMETER(attrs);
75
}
76
void closeRouteDistribution() {}
77
void closeVehicle() {}
78
void closePerson() {}
79
void closePersonFlow() {}
80
void closeContainer() {}
81
void closeContainerFlow() {}
82
void closeFlow() {}
83
void closeTrip() {}
84
SUMOVehicleParameter::Stop* addStop(const SUMOSAXAttributes& attrs) {
85
UNUSED_PARAMETER(attrs);
86
return nullptr;
87
}
88
void addPersonTrip(const SUMOSAXAttributes& attrs) {
89
UNUSED_PARAMETER(attrs);
90
}
91
void addWalk(const SUMOSAXAttributes& attrs) {
92
UNUSED_PARAMETER(attrs);
93
}
94
void addRide(const SUMOSAXAttributes& attrs) {
95
UNUSED_PARAMETER(attrs);
96
}
97
void addTransport(const SUMOSAXAttributes& attrs) {
98
UNUSED_PARAMETER(attrs);
99
}
100
void addTranship(const SUMOSAXAttributes& attrs) {
101
UNUSED_PARAMETER(attrs);
102
}
103
104
protected:
105
106
107
private:
108
std::map<std::string, SUMOVTypeParameter*>& myVTypes;
109
110
111
private:
112
/// @brief invalidated copy constructor
113
VTypesHandler(const VTypesHandler& s);
114
115
/// @brief invalidated assignment operator
116
VTypesHandler& operator=(const VTypesHandler& s);
117
118
119
};
120
121