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-2020 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),
45  { }
46 
49  SUMOTime reservationTime,
50  SUMOTime pickupTime,
51  const MSEdge* from, double fromPos,
52  const MSEdge* to, double toPos,
53  const std::string& group,
54  int maxCapacity);
55 
57  virtual void computeDispatch(SUMOTime /*now*/, const std::vector<MSDevice_Taxi*>& /*fleet*/) {}
58 
59  std::string getReservationID(Reservation* res);
60 
62  void interpretDispatch(MSDevice_Taxi* taxi, const std::vector<std::string>& reservationsIDs);
63 
64 private:
67 
68 private:
71 
72 };
long long int SUMOTime
Definition: SUMOTime.h:31
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.
StringBijection< Reservation * > myReservationLookup
std::string getReservationID(Reservation *res)
Reservation * addReservation(MSTransportable *person, SUMOTime reservationTime, SUMOTime pickupTime, const MSEdge *from, double fromPos, const MSEdge *to, double toPos, const std::string &group, int maxCapacity)
add a new reservation
void interpretDispatch(MSDevice_Taxi *taxi, const std::vector< std::string > &reservationsIDs)
trigger taxi dispatch.
virtual void computeDispatch(SUMOTime, const std::vector< MSDevice_Taxi * > &)
do nothing (dispatch happens via TraCI calls)
MSDispatch_TraCI(const std::map< std::string, std::string > &params)
An algorithm that performs distpach for a taxi fleet.
Definition: MSDispatch.h:85
A road/street connecting two junctions.
Definition: MSEdge.h:77