Ejemplo n.º 1
0
        private void pull_appropriate_kids(vehicle proper_car, cluster most_distant_cluster, cluster closest_cluster, int extra_seats)
        {
            List <location> selected_kids = new List <location>();

            //List<location> selected_kids = new List<location>();
            while (extra_seats > 0)
            {
                location closest = find_closest_location(closest_cluster, most_distant_cluster);
                selected_kids.Add(closest);
                closest_cluster.remove(closest);
                extra_seats--;
            }
            proper_car.fill_kids(selected_kids);
        }
Ejemplo n.º 2
0
        private void fill_vehicle_with_appropriate_kids(vehicle proper_car, cluster most_distant_cluster, cluster closest_cluster)
        {
            List <location> left_kids = new List <location>();
            //List<location> selected_kids = new List<location>();
            int extra_kids = most_distant_cluster.get_size() - proper_car.getCapacity();

            while (extra_kids > 0)
            {
                location closest = find_closest_location(most_distant_cluster, closest_cluster);
                left_kids.Add(closest);
                most_distant_cluster.remove(closest);
                extra_kids--;
            }
            proper_car.fill_kids(most_distant_cluster.get_cluster());

            most_distant_cluster.remove_all();
            most_distant_cluster.add_range(left_kids);
        }