def provideFeedback(self,comment,rating, booking): bookings = self.getAllBookings(self) for book in bookings: if book.__gid == booking: groupId = book.__groupID cs = CabSharing()#singleton group = cs.getGroupFromID(cs, groupId) driver = group.getDriverSub(group) driver.addComment(driver, comment) driver.updateRatings(driver, rating)
def bookCab(self,bookingPref): cs = CabSharing()#singleton passenger = bookingPref['passenger'] pickup = bookingPref['pickup'] dropoff = bookingPref['dropoff'] time = bookingPref['time'] rating = bookingPref['rating'] shared = bookingPref['shared'] accomp = bookingPref['accomp'] grp = bookingPref['grp'] booking = Booking(self,passenger,pickup,dropoff,time,rating,shared,accomp,grp) cs.addBookingToGrid(cs, booking) self.__bookings.append(booking)
def cancelCab(self,bID): cs = CabSharing()#singleton cs.cancelBooking(cs, bID)
def endTrip(self,travelSummary): cs = CabSharing()#singleton cs.endTrip(cs, travelSummary)