49 const std::vector<const MSTransportable*>& _persons,
53 const MSEdge* _from,
double _fromPos,
55 const MSEdge* _to,
double _toPos,
57 const std::string& _group,
58 const std::string& _line) :
60 persons(_persons.begin(), _persons.end()),
105 std::string
getID()
const;
138 const MSEdge* from,
double fromPos,
140 const MSEdge* to,
double toPos,
143 const std::string& line,
145 int maxContainerCapacity);
149 const MSEdge* from,
double fromPos,
150 const MSEdge* to,
double toPos,
157 const MSEdge* from,
double fromPos,
158 const MSEdge* to,
double toPos,
159 std::string group,
double newFromPos);
183 const MSEdge* from,
double fromPos,
184 const MSEdge* via,
double viaPos,
185 const MSEdge* to,
double toPos,
187 double& timeDirect) ;
A device which collects info on the vehicle trip (mainly on departure and arrival)
sorts reservations by time
time_sorter()
Constructor.
int operator()(const Reservation *r1, const Reservation *r2) const
Comparing operator.
An algorithm that performs distpach for a taxi fleet.
OutputDevice * myOutput
optional file output for dispatch information
int remainingCapacity(const MSDevice_Taxi *taxi, const Reservation *res)
whether the given taxi has sufficient capacity to serve the reservation
static SUMOTime computePickupTime(SUMOTime t, const MSDevice_Taxi *taxi, const Reservation &res, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router)
compute time to pick up the given reservation
virtual std::string removeReservation(MSTransportable *person, const MSEdge *from, double fromPos, const MSEdge *to, double toPos, std::string group)
remove person from reservation. If the whole reservation is removed, return its id
bool myHasServableReservations
whether the last call to computeDispatch has left servable reservations
virtual Reservation * updateReservationFromPos(MSTransportable *person, const MSEdge *from, double fromPos, const MSEdge *to, double toPos, std::string group, double newFromPos)
update fromPos of the person's reservation. TODO: if there is already a reservation with the newFromP...
std::map< std::string, std::vector< Reservation * > > myGroupReservations
std::vector< Reservation * > getReservations()
retrieve all reservations
virtual std::vector< const Reservation * > getRunningReservations()
retrieve all reservations that were already dispatched and are still active
static double computeDetourTime(SUMOTime t, SUMOTime viaTime, const MSDevice_Taxi *taxi, const MSEdge *from, double fromPos, const MSEdge *via, double viaPos, const MSEdge *to, double toPos, SUMOAbstractRouter< MSEdge, SUMOVehicle > &router, double &timeDirect)
compute directTime and detourTime
virtual Reservation * addReservation(MSTransportable *person, SUMOTime reservationTime, SUMOTime pickupTime, SUMOTime earliestPickupTime, const MSEdge *from, double fromPos, const MSStoppingPlace *fromStop, const MSEdge *to, double toPos, const MSStoppingPlace *tostop, std::string group, const std::string &line, int maxCapacity, int maxContainerCapacity)
add a new reservation
bool hasServableReservations()
check whether there are still (servable) reservations in the system
virtual void fulfilledReservation(const Reservation *res)
erase reservation from storage
virtual void computeDispatch(SUMOTime now, const std::vector< MSDevice_Taxi * > &fleet)=0
computes dispatch and updates reservations
void servedReservation(const Reservation *res)
std::set< const Reservation * > myRunningReservations
virtual ~MSDispatch()
Destructor.
A road/street connecting two junctions.
A lane area vehicles can halt at.
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
std::map< std::string, std::string > Map
parameters map
bool operator==(const Reservation &other) const
const MSStoppingPlace * toStop
const MSStoppingPlace * fromStop
std::string getID() const
debug identification
Reservation(const std::string &_id, const std::vector< const MSTransportable * > &_persons, SUMOTime _reservationTime, SUMOTime _pickupTime, SUMOTime _earliestPickupTime, const MSEdge *_from, double _fromPos, const MSStoppingPlace *_fromStop, const MSEdge *_to, double _toPos, const MSStoppingPlace *_toStop, const std::string &_group, const std::string &_line)
SUMOTime earliestPickupTime
std::set< const MSTransportable * > persons