public bool addRoute(Route r) { if (routes.Contains(r)) return false; routes.Add(r); return true; }
public Moveable(int volumeCapacity, int weightCapacity, Route route) { packages = new List<Package>(); VolumeCapacity = volumeCapacity; WeightCapacity = weightCapacity; CurrentRoute = route; }
public void removeRoute(Route rou) { if (route.Equals(rou)) route = null; }
public bool assignRoute(Route rou) { if (Routeless) { route = rou; return true; } return false; }
public DeliveryVehicle(int volumeCapacity, int weightCapacity, Route route) : base(volumeCapacity,weightCapacity,route) { }
public void removeRoute(Route r) { routes.Remove(r); }
private float[,] weightedAdjacency(Location[] locations, Route[] routes) { float[,] temp = new float[locations.Length, locations.Length]; for (int i = 0; i < locations.Length; ++i) for (int j = 0; j < locations.Length; ++j) temp[i, j] = float.PositiveInfinity; for (int i = 0; i < locations.Length - 1; ++i) for (int j = i + 1; j < locations.Length; ++j) for (int m = 0; m < routes.Length; ++m) if ((routes[m].Locations[0].Equals(locations[i]) && routes[m].Locations[1].Equals(locations[j])) || (routes[m].Locations[1].Equals(locations[i]) && routes[m].Locations[0].Equals(locations[j]))) temp[j, i] = temp[i, j] = routes[m].DurationInDays; return temp; }
public bool addRoute(String id, float duration, Location one, Location two, Moveable move) { Route r = new Route(id, duration, one, two, move); if (routes.Contains(r)) return false; move.assignRoute(r); routes.Add(r); move.changeLocation(); foreach (Location rLocation in r.Locations) { if (rLocation is StoreFront) (rLocation as StoreFront).addRoute(r); else if (rLocation is Warehouse) (rLocation as Warehouse).addRoute(r); } return true; }
public bool addDeliveryEmployee(string firstName, string middleName, string lastName, string id, string plainTextPassword, Route r) { DeliveryEmployee a = new DeliveryEmployee(firstName, middleName, lastName, id, plainTextPassword); a.CurrentRoute = r; return addEmployee(a); }
public Transport(string id, TRANSPORT_TYPES transportType, int volumeCapacity, int weightCapacity, bool tempControlled, Route route) : base(id, volumeCapacity,weightCapacity,route) { TransportType = transportType; TempControlled = tempControlled; }
public Transport(int transportType, int weightCapacity, int volumeCapacity, bool tempControlled, Route route) : base(volumeCapacity,weightCapacity,route) { TransportType = transportType; TempControlled = tempControlled; }
private void routeEditButton_Click(object sender, EventArgs e) { addRoute = false; routeAddButton.Text = SAVE; currentRoute = routesListBox.SelectedItem as Route; routeIdTextBox.Text = currentRoute.Id; routeDurationTextBox.Text = currentRoute.DurationInDays + ""; routeUsingListBox.Items.Clear(); routeUsingListBox.Items.AddRange(shippingSystem.RoutelessMoveable); routeUsingListBox.Items.Insert(0, currentRoute.CurrentMoveable); routeUsingListBox.SelectedIndex = 0; routeLocationOneListBox.SelectedIndex = shippingSystem.indexOf(currentRoute.Locations[0]); routeLocationTwoListBox.SelectedIndex = shippingSystem.indexOf(currentRoute.Locations[1]); }
private void addSnapshot(Snapshot snapshot, Route currentRoute) { //TODO }
public Snapshot(Route route) { }