Exemplo n.º 1
0
 public bool addRoute(Route r)
 {
     if (routes.Contains(r))
         return false;
     routes.Add(r);
     return true;
 }
Exemplo n.º 2
0
        public Moveable(int volumeCapacity, int weightCapacity, Route route)
        {
            packages = new List<Package>();

            VolumeCapacity = volumeCapacity;
            WeightCapacity = weightCapacity;
            CurrentRoute = route;
        }
Exemplo n.º 3
0
 public void removeRoute(Route rou)
 {
     if (route.Equals(rou))
         route = null;
 }
Exemplo n.º 4
0
 public bool assignRoute(Route rou)
 {
     if (Routeless)
     {
         route = rou;
         return true;
     }
     return false;
 }
Exemplo n.º 5
0
 public DeliveryVehicle(int volumeCapacity, int weightCapacity, Route route)
     : base(volumeCapacity,weightCapacity,route)
 {
 }
Exemplo n.º 6
0
 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);
 }
Exemplo n.º 10
0
 public Transport(string id, TRANSPORT_TYPES transportType, int volumeCapacity, int weightCapacity, bool tempControlled, Route route)
     : base(id, volumeCapacity,weightCapacity,route)
 {
     TransportType = transportType;
     TempControlled = tempControlled;
 }
Exemplo n.º 11
0
 public Transport(int transportType, int weightCapacity, int volumeCapacity, bool tempControlled, Route route)
     : base(volumeCapacity,weightCapacity,route)
 {
     TransportType = transportType;
     TempControlled = tempControlled;
 }
Exemplo n.º 12
0
        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]);
        }
Exemplo n.º 13
0
 private void addSnapshot(Snapshot snapshot, Route currentRoute)
 {
     //TODO
 }
Exemplo n.º 14
0
 public Snapshot(Route route)
 {
 }