43std::vector<std::string>
44ParkingArea::getIDList() {
45 std::vector<std::string> ids;
47 ids.push_back(item.first);
49 std::sort(ids.begin(), ids.end());
54ParkingArea::getIDCount() {
55 return (
int)getIDList().size();
60ParkingArea::getLaneID(
const std::string& stopID) {
61 return getParkingArea(stopID)->getLane().getID();
65ParkingArea::getStartPos(
const std::string& stopID) {
66 return getParkingArea(stopID)->getBeginLanePosition();
70ParkingArea::getEndPos(
const std::string& stopID) {
71 return getParkingArea(stopID)->getEndLanePosition();
75ParkingArea::getName(
const std::string& stopID) {
76 return getParkingArea(stopID)->getMyName();
80ParkingArea::getVehicleCount(
const std::string& stopID) {
81 return (
int)getParkingArea(stopID)->getStoppedVehicles().size();
84std::vector<std::string>
85ParkingArea::getVehicleIDs(
const std::string& stopID) {
86 std::vector<std::string> result;
87 for (
const SUMOVehicle* veh : getParkingArea(stopID)->getStoppedVehicles()) {
88 result.push_back(veh->getID());
93std::vector<std::string>
94ParkingArea::getAcceptedBadges(
const std::string& stopID) {
95 return dynamic_cast<MSParkingArea*
>(getParkingArea(stopID))->getAcceptedBadges();
100ParkingArea::setAcceptedBadges(
const std::string& stopID,
const std::vector<std::string>& badges) {
101 dynamic_cast<MSParkingArea*
>(getParkingArea(stopID))->setAcceptedBadges(badges);
106ParkingArea::getParameter(
const std::string& stopID,
const std::string& param) {
115ParkingArea::setParameter(
const std::string& stopID,
const std::string& key,
const std::string& value) {
116 getParkingArea(stopID)->setParameter(key, value);
124ParkingArea::getParkingArea(
const std::string&
id) {
129std::shared_ptr<VariableWrapper>
130ParkingArea::makeWrapper() {
131 return std::make_shared<Helper::SubscriptionWrapper>(handleVariable, mySubscriptionResults, myContextSubscriptionResults);
136ParkingArea::handleVariable(
const std::string& objID,
const int variable, VariableWrapper* wrapper,
tcpip::Storage* paramData) {
139 return wrapper->wrapStringList(objID, variable, getIDList());
141 return wrapper->wrapInt(objID, variable, getIDCount());
143 return wrapper->wrapString(objID, variable, getLaneID(objID));
145 return wrapper->wrapDouble(objID, variable, getStartPos(objID));
147 return wrapper->wrapDouble(objID, variable, getEndPos(objID));
149 return wrapper->wrapString(objID, variable, getName(objID));
151 return wrapper->wrapStringList(objID, variable, getAcceptedBadges(objID));
153 return wrapper->wrapInt(objID, variable, getVehicleCount(objID));
155 return wrapper->wrapStringList(objID, variable, getVehicleIDs(objID));
158 return wrapper->wrapString(objID, variable, getParameter(objID, paramData->
readString()));
161 return wrapper->wrapStringPair(objID, variable, getParameterWithKey(objID, paramData->
readString()));
@ SUMO_TAG_PARKING_AREA
A parking area.
#define LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(CLASS, DOM)
#define LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION(CLASS)
The simulated network and simulation perfomer.
A lane area vehicles can halt at.
A lane area vehicles can halt at.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
C++ TraCI client API implementation.
Representation of a vehicle.
static MSStoppingPlace * getStoppingPlace(const std::string &id, const SumoXMLTag type)
virtual std::string readString()
virtual int readUnsignedByte()
TRACI_CONST int VAR_ACCESS_BADGE
TRACI_CONST int VAR_STOP_STARTING_VEHICLES_NUMBER
TRACI_CONST int TRACI_ID_LIST
std::map< std::string, libsumo::SubscriptionResults > ContextSubscriptionResults
TRACI_CONST int VAR_POSITION
std::map< std::string, libsumo::TraCIResults > SubscriptionResults
{object->{variable->value}}
TRACI_CONST int VAR_PARAMETER
TRACI_CONST int VAR_LANEPOSITION
TRACI_CONST int VAR_LANE_ID
TRACI_CONST int VAR_PARAMETER_WITH_KEY
TRACI_CONST int VAR_STOP_STARTING_VEHICLES_IDS