Eclipse SUMO - Simulation of Urban MObility
MSDispatch_TraCI.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2007-2022 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 /****************************************************************************/
18 // An algorithm that performs dispatch for the taxi device
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
23 #include <set>
24 #include <vector>
25 #include <map>
27 #include <utils/common/SUMOTime.h>
28 #include "MSDispatch.h"
29 #include "MSDevice_Taxi.h"
30 
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
35 
40 class MSDispatch_TraCI : public MSDispatch {
41 public:
42  MSDispatch_TraCI(const std::map<std::string, std::string>& params) :
43  MSDispatch(params)
44  { }
45 
48  SUMOTime reservationTime,
49  SUMOTime pickupTime,
50  const MSEdge* from, double fromPos,
51  const MSEdge* to, double toPos,
52  std::string group,
53  const std::string& line,
54  int maxCapacity,
55  int maxContainerCapacity) override;
56 
58  std::string removeReservation(MSTransportable* person,
59  const MSEdge* from, double fromPos,
60  const MSEdge* to, double toPos,
61  std::string group) override;
62 
64  void computeDispatch(SUMOTime /*now*/, const std::vector<MSDevice_Taxi*>& /*fleet*/) override {}
65 
67  void interpretDispatch(MSDevice_Taxi* taxi, const std::vector<std::string>& reservationsIDs);
68 
70  std::string splitReservation(std::string resID, std::vector<std::string> personIDs);
71 
73  void fulfilledReservation(const Reservation* res) override;
74 
75 private:
77 
78 private:
81 
82 };
long long int SUMOTime
Definition: SUMOTime.h:32
A device which collects info on the vehicle trip (mainly on departure and arrival)
Definition: MSDevice_Taxi.h:48
A dispatch algorithm that services customers in reservation order and always sends the closest availa...
MSDispatch_TraCI & operator=(const MSDispatch_TraCI &)=delete
Invalidated assignment operator.
void fulfilledReservation(const Reservation *res) override
erase reservation from storage
std::string splitReservation(std::string resID, std::vector< std::string > personIDs)
split existing reservations and return the new reservation id
StringBijection< const Reservation * > myReservationLookup
void computeDispatch(SUMOTime, const std::vector< MSDevice_Taxi * > &) override
do nothing (dispatch happens via TraCI calls)
void interpretDispatch(MSDevice_Taxi *taxi, const std::vector< std::string > &reservationsIDs)
trigger taxi dispatch.
MSDispatch_TraCI(const std::map< std::string, std::string > &params)
Reservation * addReservation(MSTransportable *person, SUMOTime reservationTime, SUMOTime pickupTime, const MSEdge *from, double fromPos, const MSEdge *to, double toPos, std::string group, const std::string &line, int maxCapacity, int maxContainerCapacity) override
add a new reservation
std::string removeReservation(MSTransportable *person, const MSEdge *from, double fromPos, const MSEdge *to, double toPos, std::string group) override
remove person from reservation. If the whole reservation is removed, return it's id
An algorithm that performs distpach for a taxi fleet.
Definition: MSDispatch.h:102
A road/street connecting two junctions.
Definition: MSEdge.h:77