private bool DriverHomeOfficeReached(Driver driver) { return driver.location.Equals(location); }
private bool DriverUpdateIntervalReached(Driver driver) { return DateTime.UtcNow > driver.lastUpdate + updateInterval; }
private static Location UpdateDriverReturningLocation(Driver driver) { return driver.location = driver.route.GetCurrentWaypoint(driver.routeStartTime, DateTime.UtcNow); }
public DateTime UpdateDriverRouteAndGetETA(Driver driver, Location destination) { driver.routeStartTime = DateTime.UtcNow; driver.route = MapTools.GetRoute(driver.location, destination); DateTime eta = DateTime.UtcNow + driver.route.duration; Logger.Log(driver.name + " has a new route from " + driver.location + " to " + destination + ": ETA = " + eta); return eta; }
public void AddDriver(Driver d) { d.PartnerFleet = this; d.location = location; drivers.Add(d.ID, d); availableDrivers.AddLast(d); }
public PartnerTrip(Partner partner, string ID, Origination origination, Location pickupLocation, DateTime pickupTime, PaymentMethod? paymentMethod = null, string passengerID = null, string passengerName = null, Location dropoffLocation = null, DateTime? dropoffTime = null, List<Location> waypoints = null, VehicleType? vehicleType = null, double? maxPrice = null, int? minRating = null, PartnerFleet fleet = null, Driver driver = null, TimeSpan? duration = null, TimeSpan? driverRouteDuration = null, double? price = null) { this.ID = ID; this.origination = origination; this.service = Origination.Local; this.partner = partner; this.passengerID = passengerID; this.passengerName = passengerName; this.pickupLocation = pickupLocation; this.pickupTime = pickupTime; this.duration = duration; this.dropoffLocation = dropoffLocation; this.dropoffTime = dropoffTime; this.waypoints = waypoints; this.paymentMethod = paymentMethod; this.vehicleType = vehicleType; this.maxPrice = maxPrice; this.minRating = minRating; this.PartnerFleet = fleet; this.driver = driver; this.price = price; this.UpdateTripStatus(notifyPartner: false, status: Status.New); }
public PartnerTrip(PartnerTrip t) { this.ID = t.ID; this.passengerID = t.passengerID; this.passengerName = t.passengerName; this.origination = t.origination; this.service = t.service; this.luggage = t.luggage; this.persons = t.persons; this.pickupLocation = t.pickupLocation; this.pickupTime = t.pickupTime; this.duration = t.duration; this.dropoffLocation = t.dropoffLocation; this.dropoffTime = t.dropoffTime; this.waypoints = t.waypoints; this.paymentMethod = t.paymentMethod; this.vehicleType = t.vehicleType; this.price = t.price; this.maxPrice = t.maxPrice; this.minRating = t.minRating; this.PartnerFleet = t.PartnerFleet; this.driver = t.driver; this.lastUpdate = t.lastUpdate; this._status = t._status; this.partner = t.partner; this.lastDispatchAttempt = DateTime.MinValue; }