Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/libtraci/ParkingArea.cpp
169666 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2017-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 ParkingArea.cpp
15
/// @author Angelo Banse
16
/// @author Mirko Barthauer
17
/// @date 10.11.2020
18
///
19
// C++ TraCI client API implementation
20
/****************************************************************************/
21
#include <config.h>
22
23
#define LIBTRACI 1
24
#include <libsumo/TraCIConstants.h>
25
#include <libsumo/ParkingArea.h>
26
#include "Connection.h"
27
#include "Domain.h"
28
29
30
namespace libtraci {
31
32
typedef Domain<libsumo::CMD_GET_PARKINGAREA_VARIABLE, libsumo::CMD_SET_PARKINGAREA_VARIABLE> Dom;
33
34
35
// ===========================================================================
36
// static member definitions
37
// ===========================================================================
38
std::vector<std::string>
39
ParkingArea::getIDList() {
40
return Dom::getStringVector(libsumo::TRACI_ID_LIST, "");
41
}
42
43
int
44
ParkingArea::getIDCount() {
45
return Dom::getInt(libsumo::ID_COUNT, "");
46
}
47
48
49
std::string
50
ParkingArea::getLaneID(const std::string& stopID) {
51
return Dom::getString(libsumo::VAR_LANE_ID, stopID);
52
}
53
54
double
55
ParkingArea::getStartPos(const std::string& stopID) {
56
return Dom::getDouble(libsumo::VAR_POSITION, stopID);
57
}
58
59
double
60
ParkingArea::getEndPos(const std::string& stopID) {
61
return Dom::getDouble(libsumo::VAR_LANEPOSITION, stopID);
62
}
63
64
std::string
65
ParkingArea::getName(const std::string& stopID) {
66
return Dom::getString(libsumo::VAR_NAME, stopID);
67
}
68
69
int
70
ParkingArea::getVehicleCount(const std::string& stopID) {
71
return Dom::getInt(libsumo::VAR_STOP_STARTING_VEHICLES_NUMBER, stopID);
72
}
73
74
std::vector<std::string>
75
ParkingArea::getVehicleIDs(const std::string& stopID) {
76
return Dom::getStringVector(libsumo::VAR_STOP_STARTING_VEHICLES_IDS, stopID);
77
}
78
79
std::vector<std::string>
80
ParkingArea::getAcceptedBadges(const std::string& stopID) {
81
return Dom::getStringVector(libsumo::VAR_ACCESS_BADGE, stopID);
82
}
83
84
void
85
ParkingArea::setAcceptedBadges(const std::string& stopID, const std::vector<std::string>& badges) {
86
Dom::setStringVector(libsumo::VAR_ACCESS_BADGE, stopID, badges);
87
}
88
89
LIBTRACI_SUBSCRIPTION_IMPLEMENTATION(ParkingArea, PARKINGAREA)
90
LIBTRACI_PARAMETER_IMPLEMENTATION(ParkingArea, PARKINGAREA)
91
92
93
}
94
95
96
/****************************************************************************/
97
98